{"action":"closed","number":46,"pull_request":{"url":"https://api.github.com/repos/DemocracyOS/core/pulls/46","id":221297909,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxMjk3OTA5","html_url":"https://github.com/DemocracyOS/core/pull/46","diff_url":"https://github.com/DemocracyOS/core/pull/46.diff","patch_url":"https://github.com/DemocracyOS/core/pull/46.patch","issue_url":"https://api.github.com/repos/DemocracyOS/core/issues/46","number":46,"state":"closed","locked":false,"title":"Adding Comments for documents","user":{"login":"guillecro","id":8771166,"node_id":"MDQ6VXNlcjg3NzExNjY=","avatar_url":"https://avatars1.githubusercontent.com/u/8771166?v=4","gravatar_id":"","url":"https://api.github.com/users/guillecro","html_url":"https://github.com/guillecro","followers_url":"https://api.github.com/users/guillecro/followers","following_url":"https://api.github.com/users/guillecro/following{/other_user}","gists_url":"https://api.github.com/users/guillecro/gists{/gist_id}","starred_url":"https://api.github.com/users/guillecro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillecro/subscriptions","organizations_url":"https://api.github.com/users/guillecro/orgs","repos_url":"https://api.github.com/users/guillecro/repos","events_url":"https://api.github.com/users/guillecro/events{/privacy}","received_events_url":"https://api.github.com/users/guillecro/received_events","type":"User","site_admin":false},"body":"- Added `richText` and `allowComments` to `customForms`. It declares which fields has richText and which fields allows comments. This will be handy later for validations and also for the front end to render proper components for that.\r\n- Created model `Comment`. It saves a comment related to a field of a document\r\n- Better .env\r\n- Better gitignore organization\r\n- Removed `old` code\r\n- Revisited some documents API endpoints \r\n- Added new db-apis: `Document.listGeneralComments( query )` and `Comment.getAll(query)`, `Comment.create(comment)`,`Comment.resolve(query)` \r\n- Added 4 new API endpoints\r\n\r\n| URI | Description | Auth |\r\n| --- | --- | --- |\r\n| `GET /api/v1/documents/:id/comments` | Retrieves a list of comments of the documents. Available queryStrings - `field` and `ids` | - |\r\n| `POST /api/v1/documents/:id/comments` | Creates a new comment in a document. The request body requires 2 fields: `field` and `comment`. The `field` is part of the fields of customForm. First, during a POST request, it validates if the `field` is part of the `allowComments` array of the customForm of the document. If not, it throws an Exception. If everything is ok, the comment is saved | authenticated |\r\n| `PUT /api/v1/documents/:id/update/:field` | Updates the content of a field of a document. There is only one possible addition: a mark labeled as a comment  | - |\r\n| `PUT /:id/comments/:idComment/resolve` | Resolves a comment of a document. This only sets the value `true` to the field `resolved` of a comment. Only the author of the document can do this | authenticated & must be the author |\r\n- Updated API documentation\r\n\r\nNote 1: A test revision might be needed\r\nNote 2: I might play around with [mocha-steps](https://www.npmjs.com/package/mocha-steps) cause I am having some issues with a POST and GET test.. Sometimes I need the POST to end properly before the GET and right now it does it job but a few times it fails. ","created_at":"2018-10-09T03:26:07Z","updated_at":"2018-10-09T18:18:55Z","closed_at":"2018-10-09T18:18:55Z","merged_at":"2018-10-09T18:18:55Z","merge_commit_sha":"fc3f104abed70fe940eae25f0020f7efb6dd90b3","assignee":{"login":"guillecro","id":8771166,"node_id":"MDQ6VXNlcjg3NzExNjY=","avatar_url":"https://avatars1.githubusercontent.com/u/8771166?v=4","gravatar_id":"","url":"https://api.github.com/users/guillecro","html_url":"https://github.com/guillecro","followers_url":"https://api.github.com/users/guillecro/followers","following_url":"https://api.github.com/users/guillecro/following{/other_user}","gists_url":"https://api.github.com/users/guillecro/gists{/gist_id}","starred_url":"https://api.github.com/users/guillecro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillecro/subscriptions","organizations_url":"https://api.github.com/users/guillecro/orgs","repos_url":"https://api.github.com/users/guillecro/repos","events_url":"https://api.github.com/users/guillecro/events{/privacy}","received_events_url":"https://api.github.com/users/guillecro/received_events","type":"User","site_admin":false},"assignees":[{"login":"guillecro","id":8771166,"node_id":"MDQ6VXNlcjg3NzExNjY=","avatar_url":"https://avatars1.githubusercontent.com/u/8771166?v=4","gravatar_id":"","url":"https://api.github.com/users/guillecro","html_url":"https://github.com/guillecro","followers_url":"https://api.github.com/users/guillecro/followers","following_url":"https://api.github.com/users/guillecro/following{/other_user}","gists_url":"https://api.github.com/users/guillecro/gists{/gist_id}","starred_url":"https://api.github.com/users/guillecro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillecro/subscriptions","organizations_url":"https://api.github.com/users/guillecro/orgs","repos_url":"https://api.github.com/users/guillecro/repos","events_url":"https://api.github.com/users/guillecro/events{/privacy}","received_events_url":"https://api.github.com/users/guillecro/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"franciclo","id":9025698,"node_id":"MDQ6VXNlcjkwMjU2OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/9025698?v=4","gravatar_id":"","url":"https://api.github.com/users/franciclo","html_url":"https://github.com/franciclo","followers_url":"https://api.github.com/users/franciclo/followers","following_url":"https://api.github.com/users/franciclo/following{/other_user}","gists_url":"https://api.github.com/users/franciclo/gists{/gist_id}","starred_url":"https://api.github.com/users/franciclo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franciclo/subscriptions","organizations_url":"https://api.github.com/users/franciclo/orgs","repos_url":"https://api.github.com/users/franciclo/repos","events_url":"https://api.github.com/users/franciclo/events{/privacy}","received_events_url":"https://api.github.com/users/franciclo/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DemocracyOS/core/pulls/46/commits","review_comments_url":"https://api.github.com/repos/DemocracyOS/core/pulls/46/comments","review_comment_url":"https://api.github.com/repos/DemocracyOS/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DemocracyOS/core/issues/46/comments","statuses_url":"https://api.github.com/repos/DemocracyOS/core/statuses/303854f900e25d33d87aa75daa4b2de0597b5cbc","head":{"label":"DemocracyOS:add/comments","ref":"add/comments","sha":"303854f900e25d33d87aa75daa4b2de0597b5cbc","user":{"login":"DemocracyOS","id":4107101,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDcxMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/4107101?v=4","gravatar_id":"","url":"https://api.github.com/users/DemocracyOS","html_url":"https://github.com/DemocracyOS","followers_url":"https://api.github.com/users/DemocracyOS/followers","following_url":"https://api.github.com/users/DemocracyOS/following{/other_user}","gists_url":"https://api.github.com/users/DemocracyOS/gists{/gist_id}","starred_url":"https://api.github.com/users/DemocracyOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemocracyOS/subscriptions","organizations_url":"https://api.github.com/users/DemocracyOS/orgs","repos_url":"https://api.github.com/users/DemocracyOS/repos","events_url":"https://api.github.com/users/DemocracyOS/events{/privacy}","received_events_url":"https://api.github.com/users/DemocracyOS/received_events","type":"Organization","site_admin":false},"repo":{"id":134959248,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ5NTkyNDg=","name":"core","full_name":"DemocracyOS/core","private":false,"owner":{"login":"DemocracyOS","id":4107101,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDcxMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/4107101?v=4","gravatar_id":"","url":"https://api.github.com/users/DemocracyOS","html_url":"https://github.com/DemocracyOS","followers_url":"https://api.github.com/users/DemocracyOS/followers","following_url":"https://api.github.com/users/DemocracyOS/following{/other_user}","gists_url":"https://api.github.com/users/DemocracyOS/gists{/gist_id}","starred_url":"https://api.github.com/users/DemocracyOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemocracyOS/subscriptions","organizations_url":"https://api.github.com/users/DemocracyOS/orgs","repos_url":"https://api.github.com/users/DemocracyOS/repos","events_url":"https://api.github.com/users/DemocracyOS/events{/privacy}","received_events_url":"https://api.github.com/users/DemocracyOS/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DemocracyOS/core","description":null,"fork":false,"url":"https://api.github.com/repos/DemocracyOS/core","forks_url":"https://api.github.com/repos/DemocracyOS/core/forks","keys_url":"https://api.github.com/repos/DemocracyOS/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DemocracyOS/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DemocracyOS/core/teams","hooks_url":"https://api.github.com/repos/DemocracyOS/core/hooks","issue_events_url":"https://api.github.com/repos/DemocracyOS/core/issues/events{/number}","events_url":"https://api.github.com/repos/DemocracyOS/core/events","assignees_url":"https://api.github.com/repos/DemocracyOS/core/assignees{/user}","branches_url":"https://api.github.com/repos/DemocracyOS/core/branches{/branch}","tags_url":"https://api.github.com/repos/DemocracyOS/core/tags","blobs_url":"https://api.github.com/repos/DemocracyOS/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DemocracyOS/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DemocracyOS/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/DemocracyOS/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DemocracyOS/core/statuses/{sha}","languages_url":"https://api.github.com/repos/DemocracyOS/core/languages","stargazers_url":"https://api.github.com/repos/DemocracyOS/core/stargazers","contributors_url":"https://api.github.com/repos/DemocracyOS/core/contributors","subscribers_url":"https://api.github.com/repos/DemocracyOS/core/subscribers","subscription_url":"https://api.github.com/repos/DemocracyOS/core/subscription","commits_url":"https://api.github.com/repos/DemocracyOS/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/DemocracyOS/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/DemocracyOS/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/DemocracyOS/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/DemocracyOS/core/contents/{+path}","compare_url":"https://api.github.com/repos/DemocracyOS/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DemocracyOS/core/merges","archive_url":"https://api.github.com/repos/DemocracyOS/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DemocracyOS/core/downloads","issues_url":"https://api.github.com/repos/DemocracyOS/core/issues{/number}","pulls_url":"https://api.github.com/repos/DemocracyOS/core/pulls{/number}","milestones_url":"https://api.github.com/repos/DemocracyOS/core/milestones{/number}","notifications_url":"https://api.github.com/repos/DemocracyOS/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DemocracyOS/core/labels{/name}","releases_url":"https://api.github.com/repos/DemocracyOS/core/releases{/id}","deployments_url":"https://api.github.com/repos/DemocracyOS/core/deployments","created_at":"2018-05-26T12:25:30Z","updated_at":"2018-10-09T15:52:48Z","pushed_at":"2018-10-09T18:18:55Z","git_url":"git://github.com/DemocracyOS/core.git","ssh_url":"git@github.com:DemocracyOS/core.git","clone_url":"https://github.com/DemocracyOS/core.git","svn_url":"https://github.com/DemocracyOS/core","homepage":null,"size":1396,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"DemocracyOS:development","ref":"development","sha":"843e469a5f1c5cf2a1df06d0c00fddaee63ca61a","user":{"login":"DemocracyOS","id":4107101,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDcxMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/4107101?v=4","gravatar_id":"","url":"https://api.github.com/users/DemocracyOS","html_url":"https://github.com/DemocracyOS","followers_url":"https://api.github.com/users/DemocracyOS/followers","following_url":"https://api.github.com/users/DemocracyOS/following{/other_user}","gists_url":"https://api.github.com/users/DemocracyOS/gists{/gist_id}","starred_url":"https://api.github.com/users/DemocracyOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemocracyOS/subscriptions","organizations_url":"https://api.github.com/users/DemocracyOS/orgs","repos_url":"https://api.github.com/users/DemocracyOS/repos","events_url":"https://api.github.com/users/DemocracyOS/events{/privacy}","received_events_url":"https://api.github.com/users/DemocracyOS/received_events","type":"Organization","site_admin":false},"repo":{"id":134959248,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ5NTkyNDg=","name":"core","full_name":"DemocracyOS/core","private":false,"owner":{"login":"DemocracyOS","id":4107101,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDcxMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/4107101?v=4","gravatar_id":"","url":"https://api.github.com/users/DemocracyOS","html_url":"https://github.com/DemocracyOS","followers_url":"https://api.github.com/users/DemocracyOS/followers","following_url":"https://api.github.com/users/DemocracyOS/following{/other_user}","gists_url":"https://api.github.com/users/DemocracyOS/gists{/gist_id}","starred_url":"https://api.github.com/users/DemocracyOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemocracyOS/subscriptions","organizations_url":"https://api.github.com/users/DemocracyOS/orgs","repos_url":"https://api.github.com/users/DemocracyOS/repos","events_url":"https://api.github.com/users/DemocracyOS/events{/privacy}","received_events_url":"https://api.github.com/users/DemocracyOS/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DemocracyOS/core","description":null,"fork":false,"url":"https://api.github.com/repos/DemocracyOS/core","forks_url":"https://api.github.com/repos/DemocracyOS/core/forks","keys_url":"https://api.github.com/repos/DemocracyOS/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DemocracyOS/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DemocracyOS/core/teams","hooks_url":"https://api.github.com/repos/DemocracyOS/core/hooks","issue_events_url":"https://api.github.com/repos/DemocracyOS/core/issues/events{/number}","events_url":"https://api.github.com/repos/DemocracyOS/core/events","assignees_url":"https://api.github.com/repos/DemocracyOS/core/assignees{/user}","branches_url":"https://api.github.com/repos/DemocracyOS/core/branches{/branch}","tags_url":"https://api.github.com/repos/DemocracyOS/core/tags","blobs_url":"https://api.github.com/repos/DemocracyOS/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DemocracyOS/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DemocracyOS/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/DemocracyOS/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DemocracyOS/core/statuses/{sha}","languages_url":"https://api.github.com/repos/DemocracyOS/core/languages","stargazers_url":"https://api.github.com/repos/DemocracyOS/core/stargazers","contributors_url":"https://api.github.com/repos/DemocracyOS/core/contributors","subscribers_url":"https://api.github.com/repos/DemocracyOS/core/subscribers","subscription_url":"https://api.github.com/repos/DemocracyOS/core/subscription","commits_url":"https://api.github.com/repos/DemocracyOS/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/DemocracyOS/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/DemocracyOS/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/DemocracyOS/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/DemocracyOS/core/contents/{+path}","compare_url":"https://api.github.com/repos/DemocracyOS/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DemocracyOS/core/merges","archive_url":"https://api.github.com/repos/DemocracyOS/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DemocracyOS/core/downloads","issues_url":"https://api.github.com/repos/DemocracyOS/core/issues{/number}","pulls_url":"https://api.github.com/repos/DemocracyOS/core/pulls{/number}","milestones_url":"https://api.github.com/repos/DemocracyOS/core/milestones{/number}","notifications_url":"https://api.github.com/repos/DemocracyOS/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DemocracyOS/core/labels{/name}","releases_url":"https://api.github.com/repos/DemocracyOS/core/releases{/id}","deployments_url":"https://api.github.com/repos/DemocracyOS/core/deployments","created_at":"2018-05-26T12:25:30Z","updated_at":"2018-10-09T15:52:48Z","pushed_at":"2018-10-09T18:18:55Z","git_url":"git://github.com/DemocracyOS/core.git","ssh_url":"git@github.com:DemocracyOS/core.git","clone_url":"https://github.com/DemocracyOS/core.git","svn_url":"https://github.com/DemocracyOS/core","homepage":null,"size":1396,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DemocracyOS/core/pulls/46"},"html":{"href":"https://github.com/DemocracyOS/core/pull/46"},"issue":{"href":"https://api.github.com/repos/DemocracyOS/core/issues/46"},"comments":{"href":"https://api.github.com/repos/DemocracyOS/core/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/DemocracyOS/core/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/DemocracyOS/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DemocracyOS/core/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/DemocracyOS/core/statuses/303854f900e25d33d87aa75daa4b2de0597b5cbc"}},"author_association":"COLLABORATOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"guillecro","id":8771166,"node_id":"MDQ6VXNlcjg3NzExNjY=","avatar_url":"https://avatars1.githubusercontent.com/u/8771166?v=4","gravatar_id":"","url":"https://api.github.com/users/guillecro","html_url":"https://github.com/guillecro","followers_url":"https://api.github.com/users/guillecro/followers","following_url":"https://api.github.com/users/guillecro/following{/other_user}","gists_url":"https://api.github.com/users/guillecro/gists{/gist_id}","starred_url":"https://api.github.com/users/guillecro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillecro/subscriptions","organizations_url":"https://api.github.com/users/guillecro/orgs","repos_url":"https://api.github.com/users/guillecro/repos","events_url":"https://api.github.com/users/guillecro/events{/privacy}","received_events_url":"https://api.github.com/users/guillecro/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":30,"additions":678,"deletions":28044,"changed_files":148}}
{"actor":{"display_login":"guillecro"}}