{"action":"created","issue":{"url":"https://api.github.com/repos/yunity/foodsaving-backend/issues/385","repository_url":"https://api.github.com/repos/yunity/foodsaving-backend","labels_url":"https://api.github.com/repos/yunity/foodsaving-backend/issues/385/labels{/name}","comments_url":"https://api.github.com/repos/yunity/foodsaving-backend/issues/385/comments","events_url":"https://api.github.com/repos/yunity/foodsaving-backend/issues/385/events","html_url":"https://github.com/yunity/foodsaving-backend/issues/385","id":255891008,"number":385,"title":"Add optional agreement for groups","user":{"login":"nicksellen","id":31616,"avatar_url":"https://avatars2.githubusercontent.com/u/31616?v=4","gravatar_id":"","url":"https://api.github.com/users/nicksellen","html_url":"https://github.com/nicksellen","followers_url":"https://api.github.com/users/nicksellen/followers","following_url":"https://api.github.com/users/nicksellen/following{/other_user}","gists_url":"https://api.github.com/users/nicksellen/gists{/gist_id}","starred_url":"https://api.github.com/users/nicksellen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicksellen/subscriptions","organizations_url":"https://api.github.com/users/nicksellen/orgs","repos_url":"https://api.github.com/users/nicksellen/repos","events_url":"https://api.github.com/users/nicksellen/events{/privacy}","received_events_url":"https://api.github.com/users/nicksellen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-07T10:31:32Z","updated_at":"2017-09-07T18:22:55Z","closed_at":null,"author_association":"OWNER","body":"This is the backend implementation of https://github.com/yunity/foodsaving-frontend/issues/324#issuecomment-312685256, this is the proposal from a discussion between me, @tiltec, and @djahnie:\r\n\r\n> 0. The legal agreement should be optional and per-group, decided by group admins\r\n> 1. We need some people (group admins) in the group who are able to edit the legal agreement -> #356 \r\n> 2. If the legal agreements gets changed, all members have to accept again (simpler implementation)\r\n> 3.1 If users are already in the group and have not accepted the latest agreement, they should be showed a dialog and be prompted to agree on it.\r\n> 3.2 If users join a group, joining and accepting should be done in one step\r\n> \r\n> Probably we could record the date when the users agreed, so we could later compare it to the change time of the agreement.\r\n\r\nI don't think any of the subsequent discussion changes that idea.\r\n\r\nFor implementation, my initial idea was to:\r\n* add a new group role (using our new roles system) called `GROUP_AGREEMENT_MANAGER` (the existing one being `GROUP_MEMBERSHIP_MANAGER`)\r\n* add a `groups.Agreement` model which has `title`, and `content` text fields\r\n* add a one2one relationship from group -> agreements (denoting the active agreement)\r\n* add a foreign from agreements -> group (denoting which group an agreement is related to)\r\n* add an agreed_to foreign key to agreements on group membership (recording the agreement a given user has agreed to)\r\n\r\nRationales:\r\n* minor changes to the agreement (e.g. typo, italic change, new line added) does not need to get everyone to re-agree (what is minor is up to the group/law to decide)\r\n* we record explicitly which agreement a user agreed to instead of implicitly by date\r\n* we keep the history of agreements as is useful (could prune them where nothing refers to them anymore, but seems potentially useful to keep any agreement that is refered to in an agreed_to field, presumably the old agreement is still fine for letting them browse the site, but they would need to accept the new agreement to do certain other things)"},"comment":{"url":"https://api.github.com/repos/yunity/foodsaving-backend/issues/comments/327883220","html_url":"https://github.com/yunity/foodsaving-backend/issues/385#issuecomment-327883220","issue_url":"https://api.github.com/repos/yunity/foodsaving-backend/issues/385","id":327883220,"user":{"login":"tiltec","id":4410802,"avatar_url":"https://avatars3.githubusercontent.com/u/4410802?v=4","gravatar_id":"","url":"https://api.github.com/users/tiltec","html_url":"https://github.com/tiltec","followers_url":"https://api.github.com/users/tiltec/followers","following_url":"https://api.github.com/users/tiltec/following{/other_user}","gists_url":"https://api.github.com/users/tiltec/gists{/gist_id}","starred_url":"https://api.github.com/users/tiltec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiltec/subscriptions","organizations_url":"https://api.github.com/users/tiltec/orgs","repos_url":"https://api.github.com/users/tiltec/repos","events_url":"https://api.github.com/users/tiltec/events{/privacy}","received_events_url":"https://api.github.com/users/tiltec/received_events","type":"User","site_admin":false},"created_at":"2017-09-07T18:22:55Z","updated_at":"2017-09-07T18:22:55Z","author_association":"OWNER","body":"Seems to be a good model. I thought about using something like https://github.com/etianen/django-reversion from model versions & rollback, but it doesn't fit this purpose.\r\n\r\nHow would the transition between \"group without agreement\" and \"group with agreement\" look like? And the reverse?\r\n\r\n**adding agreement**\r\n\r\n- the user with `GROUP_MEMBERSHIP_MANAGER` appoints someone as `GROUP_AGREEMENT_MANAGER`\r\n- `GROUP_AGREEMENT_MANAGER` pushes an agreement and set it as active (one2one)\r\n- all users have to agree before they can do any action inside the group\r\n\r\n**removing an agreement***\r\n\r\n- `GROUP_AGREEMENT_MANAGER` removes the active agreement\r\n\r\n**switching agreements (major change)**\r\n\r\n- `GROUP_AGREEMENT_MANAGER` writes a new agreement and changes the active agreement"}}
{"actor":{"display_login":"tiltec"}}