{"action":"created","issue":{"url":"https://api.github.com/repos/popolo-project/popolo-spec/issues/104","labels_url":"https://api.github.com/repos/popolo-project/popolo-spec/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/popolo-project/popolo-spec/issues/104/comments","events_url":"https://api.github.com/repos/popolo-project/popolo-spec/issues/104/events","html_url":"https://github.com/popolo-project/popolo-spec/issues/104","id":90416496,"number":104,"title":"Best way to model a Candidacy","user":{"login":"tmtmtmtm","id":57483,"avatar_url":"https://avatars.githubusercontent.com/u/57483?v=3","gravatar_id":"","url":"https://api.github.com/users/tmtmtmtm","html_url":"https://github.com/tmtmtmtm","followers_url":"https://api.github.com/users/tmtmtmtm/followers","following_url":"https://api.github.com/users/tmtmtmtm/following{/other_user}","gists_url":"https://api.github.com/users/tmtmtmtm/gists{/gist_id}","starred_url":"https://api.github.com/users/tmtmtmtm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmtmtmtm/subscriptions","organizations_url":"https://api.github.com/users/tmtmtmtm/orgs","repos_url":"https://api.github.com/users/tmtmtmtm/repos","events_url":"https://api.github.com/users/tmtmtmtm/events{/privacy}","received_events_url":"https://api.github.com/users/tmtmtmtm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/popolo-project/popolo-spec/labels/Documentation","name":"Documentation","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/popolo-project/popolo-spec/milestones/7","html_url":"https://github.com/popolo-project/popolo-spec/milestones/2015%20Priority","labels_url":"https://api.github.com/repos/popolo-project/popolo-spec/milestones/7/labels","id":1253698,"number":7,"title":"2015 Priority","description":"","creator":{"login":"jpmckinney","id":26463,"avatar_url":"https://avatars.githubusercontent.com/u/26463?v=3","gravatar_id":"","url":"https://api.github.com/users/jpmckinney","html_url":"https://github.com/jpmckinney","followers_url":"https://api.github.com/users/jpmckinney/followers","following_url":"https://api.github.com/users/jpmckinney/following{/other_user}","gists_url":"https://api.github.com/users/jpmckinney/gists{/gist_id}","starred_url":"https://api.github.com/users/jpmckinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpmckinney/subscriptions","organizations_url":"https://api.github.com/users/jpmckinney/orgs","repos_url":"https://api.github.com/users/jpmckinney/repos","events_url":"https://api.github.com/users/jpmckinney/events{/privacy}","received_events_url":"https://api.github.com/users/jpmckinney/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":0,"state":"open","created_at":"2015-08-13T14:28:22Z","updated_at":"2015-08-13T14:28:57Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-06-23T15:18:04Z","updated_at":"2015-10-26T08:35:58Z","closed_at":null,"body":"There's been some discussion around how to best model election candidates for YourNextRepresentative as it expands to cope with a variety of different election systems. I'm opening this issue to give us place to consolidate that discussion, and hopefully arrive at a consensus.\r\n\r\nOne stumbling point in the discussion to date seems to have been how best to track what Party someone is representing. Much of this seems to have paralleled the discussions around how to track the Party of an elected legislator, so I believe the solution will probably be very similar. \r\n\r\nI can imagine two scenarios that would make a simple \"look up what Organisation (with a classification of Party) this Person has an active Membership in\" query problematic (on top of the normal issues around this sort of indirection):\r\n\r\n* someone who is a currently MP for one party, but is standing for a different party in the upcoming election\r\n* someone who is standing simultaneously for two different parties\r\n\r\nI suspect neither of these are particularly common, but I've seen both happen.\r\n\r\nI would propose, therefore, that the best approach is to parallel the current consensus around what the membership would look like post-election, and mirror it as much as possible into the pre-election model. In particular this would involve a Membership of either the Post (in a constituency-based model using those), or the Legislature as a whole (possibly with an Area attached), using the `on_behalf_of` property, the `legislative_period` property, and setting a `role` of \"candidate\" rather than \"member\".\r\n\r\nSo, for example, Fred Bloggs standing for the People's Party in the 2015 election would be:\r\n\r\nMembership:\r\n```\r\n{\r\n    person_id: \"fred_bloggs\",\r\n    post_id: \"constituency/southern_heights\"    (or organization_id) \r\n    role: \"candidate\",\r\n    on_behalf_of_id: \"peoples_party\",\r\n    legislative_period: \"term/2015\",\r\n}\r\n```\r\n(with an optional `start_date` for when the candidacy was declared, and `end_date` if they drop out before the election)\r\n\r\nAnd then, if he were elected, an almost identical separate membership:\r\n```\r\n{\r\n    person_id: \"fred_bloggs\",\r\n    post_id: \"constituency/southern_heights\"    (or organization_id) \r\n    role: \"member\",\r\n    on_behalf_of_id: \"peoples_party\",  {{1}}\r\n    legislative_period: \"term/2015\",\r\n}\r\n```\r\n\r\nThoughts? Problems? Suggestions? \r\n\r\n---\r\n{{1}} as a slight aside, this would also enable quite a clean approach for cases where there's a strong distinction between the Party a person stands for election on behalf of, and the Parliamentary Party/Faction that their actual legislative membership would be on behalf of — and might thus also provide a nice way to model that scenario even in the absence of tracking the losing candidates.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/popolo-project/popolo-spec/issues/comments/151059912","html_url":"https://github.com/popolo-project/popolo-spec/issues/104#issuecomment-151059912","issue_url":"https://api.github.com/repos/popolo-project/popolo-spec/issues/104","id":151059912,"user":{"login":"tmtmtmtm","id":57483,"avatar_url":"https://avatars.githubusercontent.com/u/57483?v=3","gravatar_id":"","url":"https://api.github.com/users/tmtmtmtm","html_url":"https://github.com/tmtmtmtm","followers_url":"https://api.github.com/users/tmtmtmtm/followers","following_url":"https://api.github.com/users/tmtmtmtm/following{/other_user}","gists_url":"https://api.github.com/users/tmtmtmtm/gists{/gist_id}","starred_url":"https://api.github.com/users/tmtmtmtm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmtmtmtm/subscriptions","organizations_url":"https://api.github.com/users/tmtmtmtm/orgs","repos_url":"https://api.github.com/users/tmtmtmtm/repos","events_url":"https://api.github.com/users/tmtmtmtm/events{/privacy}","received_events_url":"https://api.github.com/users/tmtmtmtm/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T08:35:58Z","updated_at":"2015-10-26T08:35:58Z","body":"Hi @Floppy — there are still definitely unanswered questions in the modelling of the Memberships here, but one thing that doesn't seem to have been mentioned in the discussion here to date that should help with at least _part_ of your issue, is that for modelling the Election itself (with dates etc), you should be using an [Event](http://www.popoloproject.com/specs/event.html)\r\n\r\n"}}