{"action":"created","comment":{"url":"https://api.github.com/repos/youpin-city/youpin-api/pulls/comments/89990607","pull_request_review_id":10515442,"id":89990607,"diff_hunk":"@@ -31,6 +30,8 @@ const summarySchema = new Schema({\n   updatedAt: { type: Date, default: Date.now },\n });\n \n+summarySchema.index({ organization: 1, date: 1 }, { unique: true });\n+\n const Model = mongoose.model('summary', summarySchema);","path":"src/services/summary/summary-model.js","position":null,"original_position":27,"commit_id":"81255987caac19fa406eb453f005bfd01af136b0","original_commit_id":"27f10f1f146a82129038843cdac6682447d26d46","user":{"login":"parnurzeal","id":841616,"avatar_url":"https://avatars.githubusercontent.com/u/841616?v=3","gravatar_id":"","url":"https://api.github.com/users/parnurzeal","html_url":"https://github.com/parnurzeal","followers_url":"https://api.github.com/users/parnurzeal/followers","following_url":"https://api.github.com/users/parnurzeal/following{/other_user}","gists_url":"https://api.github.com/users/parnurzeal/gists{/gist_id}","starred_url":"https://api.github.com/users/parnurzeal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parnurzeal/subscriptions","organizations_url":"https://api.github.com/users/parnurzeal/orgs","repos_url":"https://api.github.com/users/parnurzeal/repos","events_url":"https://api.github.com/users/parnurzeal/events{/privacy}","received_events_url":"https://api.github.com/users/parnurzeal/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2016-11-29T11:26:21Z","updated_at":"2016-11-29T11:26:22Z","html_url":"https://github.com/youpin-city/youpin-api/pull/156#discussion_r89990607","pull_request_url":"https://api.github.com/repos/youpin-city/youpin-api/pulls/156","_links":{"self":{"href":"https://api.github.com/repos/youpin-city/youpin-api/pulls/comments/89990607"},"html":{"href":"https://github.com/youpin-city/youpin-api/pull/156#discussion_r89990607"},"pull_request":{"href":"https://api.github.com/repos/youpin-city/youpin-api/pulls/156"}}},"pull_request":{"url":"https://api.github.com/repos/youpin-city/youpin-api/pulls/156","id":95517086,"html_url":"https://github.com/youpin-city/youpin-api/pull/156","diff_url":"https://github.com/youpin-city/youpin-api/pull/156.diff","patch_url":"https://github.com/youpin-city/youpin-api/pull/156.patch","issue_url":"https://api.github.com/repos/youpin-city/youpin-api/issues/156","number":156,"state":"open","locked":false,"title":"Add trigger param to recalculate summaries","user":{"login":"parnurzeal","id":841616,"avatar_url":"https://avatars.githubusercontent.com/u/841616?v=3","gravatar_id":"","url":"https://api.github.com/users/parnurzeal","html_url":"https://github.com/parnurzeal","followers_url":"https://api.github.com/users/parnurzeal/followers","following_url":"https://api.github.com/users/parnurzeal/following{/other_user}","gists_url":"https://api.github.com/users/parnurzeal/gists{/gist_id}","starred_url":"https://api.github.com/users/parnurzeal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parnurzeal/subscriptions","organizations_url":"https://api.github.com/users/parnurzeal/orgs","repos_url":"https://api.github.com/users/parnurzeal/repos","events_url":"https://api.github.com/users/parnurzeal/events{/privacy}","received_events_url":"https://api.github.com/users/parnurzeal/received_events","type":"User","site_admin":false},"body":"Continuing PR for #141 to add Trigger param to trigger a summary recalculation.\r\nTo trigger it, just add `trigger=true` to `/summaries` routing.\r\nEx. to trigger the calculation (date: 2016-11-25 -> 2016-11-28, organization: ChulalongkornUni), we can run following:\r\n`localhost:3100/summaries?trigger=true&organization=ChulalongkornUni&start_date=2016-11-25&end_date=2016-11-28` \r\n\r\nNote that I also change the summary model to utilise just String type instead of ObjectId... to reduce complexity of the implementation.","created_at":"2016-11-28T15:17:19Z","updated_at":"2016-11-29T11:26:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28b6009c487d54ea2a24cc78cf24404a95572dc4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/youpin-city/youpin-api/pulls/156/commits","review_comments_url":"https://api.github.com/repos/youpin-city/youpin-api/pulls/156/comments","review_comment_url":"https://api.github.com/repos/youpin-city/youpin-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/youpin-city/youpin-api/issues/156/comments","statuses_url":"https://api.github.com/repos/youpin-city/youpin-api/statuses/81255987caac19fa406eb453f005bfd01af136b0","head":{"label":"parnurzeal:iss141_calculate_summary","ref":"iss141_calculate_summary","sha":"81255987caac19fa406eb453f005bfd01af136b0","user":{"login":"parnurzeal","id":841616,"avatar_url":"https://avatars.githubusercontent.com/u/841616?v=3","gravatar_id":"","url":"https://api.github.com/users/parnurzeal","html_url":"https://github.com/parnurzeal","followers_url":"https://api.github.com/users/parnurzeal/followers","following_url":"https://api.github.com/users/parnurzeal/following{/other_user}","gists_url":"https://api.github.com/users/parnurzeal/gists{/gist_id}","starred_url":"https://api.github.com/users/parnurzeal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parnurzeal/subscriptions","organizations_url":"https://api.github.com/users/parnurzeal/orgs","repos_url":"https://api.github.com/users/parnurzeal/repos","events_url":"https://api.github.com/users/parnurzeal/events{/privacy}","received_events_url":"https://api.github.com/users/parnurzeal/received_events","type":"User","site_admin":false},"repo":{"id":63762572,"name":"youpin-api","full_name":"parnurzeal/youpin-api","owner":{"login":"parnurzeal","id":841616,"avatar_url":"https://avatars.githubusercontent.com/u/841616?v=3","gravatar_id":"","url":"https://api.github.com/users/parnurzeal","html_url":"https://github.com/parnurzeal","followers_url":"https://api.github.com/users/parnurzeal/followers","following_url":"https://api.github.com/users/parnurzeal/following{/other_user}","gists_url":"https://api.github.com/users/parnurzeal/gists{/gist_id}","starred_url":"https://api.github.com/users/parnurzeal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parnurzeal/subscriptions","organizations_url":"https://api.github.com/users/parnurzeal/orgs","repos_url":"https://api.github.com/users/parnurzeal/repos","events_url":"https://api.github.com/users/parnurzeal/events{/privacy}","received_events_url":"https://api.github.com/users/parnurzeal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/parnurzeal/youpin-api","description":"YouPin's API","fork":true,"url":"https://api.github.com/repos/parnurzeal/youpin-api","forks_url":"https://api.github.com/repos/parnurzeal/youpin-api/forks","keys_url":"https://api.github.com/repos/parnurzeal/youpin-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/parnurzeal/youpin-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/parnurzeal/youpin-api/teams","hooks_url":"https://api.github.com/repos/parnurzeal/youpin-api/hooks","issue_events_url":"https://api.github.com/repos/parnurzeal/youpin-api/issues/events{/number}","events_url":"https://api.github.com/repos/parnurzeal/youpin-api/events","assignees_url":"https://api.github.com/repos/parnurzeal/youpin-api/assignees{/user}","branches_url":"https://api.github.com/repos/parnurzeal/youpin-api/branches{/branch}","tags_url":"https://api.github.com/repos/parnurzeal/youpin-api/tags","blobs_url":"https://api.github.com/repos/parnurzeal/youpin-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/parnurzeal/youpin-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/parnurzeal/youpin-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/parnurzeal/youpin-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/parnurzeal/youpin-api/statuses/{sha}","languages_url":"https://api.github.com/repos/parnurzeal/youpin-api/languages","stargazers_url":"https://api.github.com/repos/parnurzeal/youpin-api/stargazers","contributors_url":"https://api.github.com/repos/parnurzeal/youpin-api/contributors","subscribers_url":"https://api.github.com/repos/parnurzeal/youpin-api/subscribers","subscription_url":"https://api.github.com/repos/parnurzeal/youpin-api/subscription","commits_url":"https://api.github.com/repos/parnurzeal/youpin-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/parnurzeal/youpin-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/parnurzeal/youpin-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/parnurzeal/youpin-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/parnurzeal/youpin-api/contents/{+path}","compare_url":"https://api.github.com/repos/parnurzeal/youpin-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/parnurzeal/youpin-api/merges","archive_url":"https://api.github.com/repos/parnurzeal/youpin-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/parnurzeal/youpin-api/downloads","issues_url":"https://api.github.com/repos/parnurzeal/youpin-api/issues{/number}","pulls_url":"https://api.github.com/repos/parnurzeal/youpin-api/pulls{/number}","milestones_url":"https://api.github.com/repos/parnurzeal/youpin-api/milestones{/number}","notifications_url":"https://api.github.com/repos/parnurzeal/youpin-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/parnurzeal/youpin-api/labels{/name}","releases_url":"https://api.github.com/repos/parnurzeal/youpin-api/releases{/id}","deployments_url":"https://api.github.com/repos/parnurzeal/youpin-api/deployments","created_at":"2016-07-20T08:02:41Z","updated_at":"2016-07-20T08:02:42Z","pushed_at":"2016-11-29T11:25:56Z","git_url":"git://github.com/parnurzeal/youpin-api.git","ssh_url":"git@github.com:parnurzeal/youpin-api.git","clone_url":"https://github.com/parnurzeal/youpin-api.git","svn_url":"https://github.com/parnurzeal/youpin-api","homepage":null,"size":681,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"youpin-city:master","ref":"master","sha":"eda59c09d6f89431b48714a1325ee7546ef79ff6","user":{"login":"youpin-city","id":19252417,"avatar_url":"https://avatars.githubusercontent.com/u/19252417?v=3","gravatar_id":"","url":"https://api.github.com/users/youpin-city","html_url":"https://github.com/youpin-city","followers_url":"https://api.github.com/users/youpin-city/followers","following_url":"https://api.github.com/users/youpin-city/following{/other_user}","gists_url":"https://api.github.com/users/youpin-city/gists{/gist_id}","starred_url":"https://api.github.com/users/youpin-city/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youpin-city/subscriptions","organizations_url":"https://api.github.com/users/youpin-city/orgs","repos_url":"https://api.github.com/users/youpin-city/repos","events_url":"https://api.github.com/users/youpin-city/events{/privacy}","received_events_url":"https://api.github.com/users/youpin-city/received_events","type":"Organization","site_admin":false},"repo":{"id":61938140,"name":"youpin-api","full_name":"youpin-city/youpin-api","owner":{"login":"youpin-city","id":19252417,"avatar_url":"https://avatars.githubusercontent.com/u/19252417?v=3","gravatar_id":"","url":"https://api.github.com/users/youpin-city","html_url":"https://github.com/youpin-city","followers_url":"https://api.github.com/users/youpin-city/followers","following_url":"https://api.github.com/users/youpin-city/following{/other_user}","gists_url":"https://api.github.com/users/youpin-city/gists{/gist_id}","starred_url":"https://api.github.com/users/youpin-city/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youpin-city/subscriptions","organizations_url":"https://api.github.com/users/youpin-city/orgs","repos_url":"https://api.github.com/users/youpin-city/repos","events_url":"https://api.github.com/users/youpin-city/events{/privacy}","received_events_url":"https://api.github.com/users/youpin-city/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/youpin-city/youpin-api","description":"YouPin's API","fork":false,"url":"https://api.github.com/repos/youpin-city/youpin-api","forks_url":"https://api.github.com/repos/youpin-city/youpin-api/forks","keys_url":"https://api.github.com/repos/youpin-city/youpin-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/youpin-city/youpin-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/youpin-city/youpin-api/teams","hooks_url":"https://api.github.com/repos/youpin-city/youpin-api/hooks","issue_events_url":"https://api.github.com/repos/youpin-city/youpin-api/issues/events{/number}","events_url":"https://api.github.com/repos/youpin-city/youpin-api/events","assignees_url":"https://api.github.com/repos/youpin-city/youpin-api/assignees{/user}","branches_url":"https://api.github.com/repos/youpin-city/youpin-api/branches{/branch}","tags_url":"https://api.github.com/repos/youpin-city/youpin-api/tags","blobs_url":"https://api.github.com/repos/youpin-city/youpin-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/youpin-city/youpin-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/youpin-city/youpin-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/youpin-city/youpin-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/youpin-city/youpin-api/statuses/{sha}","languages_url":"https://api.github.com/repos/youpin-city/youpin-api/languages","stargazers_url":"https://api.github.com/repos/youpin-city/youpin-api/stargazers","contributors_url":"https://api.github.com/repos/youpin-city/youpin-api/contributors","subscribers_url":"https://api.github.com/repos/youpin-city/youpin-api/subscribers","subscription_url":"https://api.github.com/repos/youpin-city/youpin-api/subscription","commits_url":"https://api.github.com/repos/youpin-city/youpin-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/youpin-city/youpin-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/youpin-city/youpin-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/youpin-city/youpin-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/youpin-city/youpin-api/contents/{+path}","compare_url":"https://api.github.com/repos/youpin-city/youpin-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/youpin-city/youpin-api/merges","archive_url":"https://api.github.com/repos/youpin-city/youpin-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/youpin-city/youpin-api/downloads","issues_url":"https://api.github.com/repos/youpin-city/youpin-api/issues{/number}","pulls_url":"https://api.github.com/repos/youpin-city/youpin-api/pulls{/number}","milestones_url":"https://api.github.com/repos/youpin-city/youpin-api/milestones{/number}","notifications_url":"https://api.github.com/repos/youpin-city/youpin-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/youpin-city/youpin-api/labels{/name}","releases_url":"https://api.github.com/repos/youpin-city/youpin-api/releases{/id}","deployments_url":"https://api.github.com/repos/youpin-city/youpin-api/deployments","created_at":"2016-06-25T10:19:48Z","updated_at":"2016-11-19T15:58:47Z","pushed_at":"2016-11-29T11:25:57Z","git_url":"git://github.com/youpin-city/youpin-api.git","ssh_url":"git@github.com:youpin-city/youpin-api.git","clone_url":"https://github.com/youpin-city/youpin-api.git","svn_url":"https://github.com/youpin-city/youpin-api","homepage":null,"size":702,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":29,"forks":8,"open_issues":29,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/youpin-city/youpin-api/pulls/156"},"html":{"href":"https://github.com/youpin-city/youpin-api/pull/156"},"issue":{"href":"https://api.github.com/repos/youpin-city/youpin-api/issues/156"},"comments":{"href":"https://api.github.com/repos/youpin-city/youpin-api/issues/156/comments"},"review_comments":{"href":"https://api.github.com/repos/youpin-city/youpin-api/pulls/156/comments"},"review_comment":{"href":"https://api.github.com/repos/youpin-city/youpin-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/youpin-city/youpin-api/pulls/156/commits"},"statuses":{"href":"https://api.github.com/repos/youpin-city/youpin-api/statuses/81255987caac19fa406eb453f005bfd01af136b0"}}}}
{"actor":{"display_login":"parnurzeal"}}