{"action":"created","comment":{"url":"https://api.github.com/repos/samsao/slack_office_bot/pulls/comments/90741435","pull_request_review_id":11262458,"id":90741435,"diff_hunk":"@@ -1,39 +1,102 @@\n-const Task = require('./task.js');\n const Constants = require(\"./../constants\");\n+const StringFormat = require('string-format');\n+const Task = require('./task.js');\n \n-\n+/**\n+ * Constructor\n+ *\n+ * @param tasks Bot's tasks\n+ */\n function TaskStatistics(tasks) {\n-\tthis.amountOfTasks = tasks.length;\n-\tthis.unassignedTasks = 0;\n-\tthis.completedTasks = 0;\n-\tthis.uncompleteTasks = 0;\n-\tthis.uncompleteUsers = [];\n+\tthis.tasksCount = tasks.length;\n+\tthis.completedTasks = [];\n+\tthis.uncompletedTasks = [];\n+\tthis.unassignedTasks = [];\n \n-\tthis.getStatistics(tasks);\n-}\n-\n-TaskStatistics.prototype.getStatistics = function(tasks) {\n \tvar self = this;\n \ttasks.forEach(function(task) {\n \t\tif (task.assignee) {\n \t\t\tif (task.done) {\n-\t\t\t\tself.completedTasks += 1;\n+\t\t\t\tself.completedTasks.push(task);\n \t\t\t} else {\n-\t\t\t\tself.uncompleteTasks += 1;\n-\t\t\t\tself.uncompleteUsers.push(task.assignee);\n+\t\t\t\tself.uncompletedTasks.push(task);\n \t\t\t}\n \t\t} else {\n-\t\t\tself.unassignedTasks += 1;\n+\t\t\tself.unassignedTasks.push(task);\n \t\t}\n \t});\n+}\n \n+/**\n+ * Returns the statistics message attachments\n+ *\n+ */","path":"model/taskStatistics.js","position":48,"original_position":48,"commit_id":"3b79dab2e1759271625ea27e4e31fd6fc6b723fe","original_commit_id":"3b79dab2e1759271625ea27e4e31fd6fc6b723fe","user":{"login":"GlisboaDev","id":8302455,"avatar_url":"https://avatars.githubusercontent.com/u/8302455?v=3","gravatar_id":"","url":"https://api.github.com/users/GlisboaDev","html_url":"https://github.com/GlisboaDev","followers_url":"https://api.github.com/users/GlisboaDev/followers","following_url":"https://api.github.com/users/GlisboaDev/following{/other_user}","gists_url":"https://api.github.com/users/GlisboaDev/gists{/gist_id}","starred_url":"https://api.github.com/users/GlisboaDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlisboaDev/subscriptions","organizations_url":"https://api.github.com/users/GlisboaDev/orgs","repos_url":"https://api.github.com/users/GlisboaDev/repos","events_url":"https://api.github.com/users/GlisboaDev/events{/privacy}","received_events_url":"https://api.github.com/users/GlisboaDev/received_events","type":"User","site_admin":false},"body":"Should this be here? taskStatistics is a model with just the statistics, it doesn't really know about the format of the messages","created_at":"2016-12-03T00:05:28Z","updated_at":"2016-12-03T00:13:17Z","html_url":"https://github.com/samsao/slack_office_bot/pull/20#discussion_r90741435","pull_request_url":"https://api.github.com/repos/samsao/slack_office_bot/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/samsao/slack_office_bot/pulls/comments/90741435"},"html":{"href":"https://github.com/samsao/slack_office_bot/pull/20#discussion_r90741435"},"pull_request":{"href":"https://api.github.com/repos/samsao/slack_office_bot/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/samsao/slack_office_bot/pulls/20","id":96241029,"html_url":"https://github.com/samsao/slack_office_bot/pull/20","diff_url":"https://github.com/samsao/slack_office_bot/pull/20.diff","patch_url":"https://github.com/samsao/slack_office_bot/pull/20.patch","issue_url":"https://api.github.com/repos/samsao/slack_office_bot/issues/20","number":20,"state":"open","locked":false,"title":"Feature/final review","user":{"login":"cartierjf","id":2409861,"avatar_url":"https://avatars.githubusercontent.com/u/2409861?v=3","gravatar_id":"","url":"https://api.github.com/users/cartierjf","html_url":"https://github.com/cartierjf","followers_url":"https://api.github.com/users/cartierjf/followers","following_url":"https://api.github.com/users/cartierjf/following{/other_user}","gists_url":"https://api.github.com/users/cartierjf/gists{/gist_id}","starred_url":"https://api.github.com/users/cartierjf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cartierjf/subscriptions","organizations_url":"https://api.github.com/users/cartierjf/orgs","repos_url":"https://api.github.com/users/cartierjf/repos","events_url":"https://api.github.com/users/cartierjf/events{/privacy}","received_events_url":"https://api.github.com/users/cartierjf/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-02T08:43:30Z","updated_at":"2016-12-03T00:13:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fc30267190a4ccced48ccd4d2237605d362b17c","assignee":{"login":"GlisboaDev","id":8302455,"avatar_url":"https://avatars.githubusercontent.com/u/8302455?v=3","gravatar_id":"","url":"https://api.github.com/users/GlisboaDev","html_url":"https://github.com/GlisboaDev","followers_url":"https://api.github.com/users/GlisboaDev/followers","following_url":"https://api.github.com/users/GlisboaDev/following{/other_user}","gists_url":"https://api.github.com/users/GlisboaDev/gists{/gist_id}","starred_url":"https://api.github.com/users/GlisboaDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlisboaDev/subscriptions","organizations_url":"https://api.github.com/users/GlisboaDev/orgs","repos_url":"https://api.github.com/users/GlisboaDev/repos","events_url":"https://api.github.com/users/GlisboaDev/events{/privacy}","received_events_url":"https://api.github.com/users/GlisboaDev/received_events","type":"User","site_admin":false},"assignees":[{"login":"GlisboaDev","id":8302455,"avatar_url":"https://avatars.githubusercontent.com/u/8302455?v=3","gravatar_id":"","url":"https://api.github.com/users/GlisboaDev","html_url":"https://github.com/GlisboaDev","followers_url":"https://api.github.com/users/GlisboaDev/followers","following_url":"https://api.github.com/users/GlisboaDev/following{/other_user}","gists_url":"https://api.github.com/users/GlisboaDev/gists{/gist_id}","starred_url":"https://api.github.com/users/GlisboaDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlisboaDev/subscriptions","organizations_url":"https://api.github.com/users/GlisboaDev/orgs","repos_url":"https://api.github.com/users/GlisboaDev/repos","events_url":"https://api.github.com/users/GlisboaDev/events{/privacy}","received_events_url":"https://api.github.com/users/GlisboaDev/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/samsao/slack_office_bot/pulls/20/commits","review_comments_url":"https://api.github.com/repos/samsao/slack_office_bot/pulls/20/comments","review_comment_url":"https://api.github.com/repos/samsao/slack_office_bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/samsao/slack_office_bot/issues/20/comments","statuses_url":"https://api.github.com/repos/samsao/slack_office_bot/statuses/3b79dab2e1759271625ea27e4e31fd6fc6b723fe","head":{"label":"samsao:feature/final_review","ref":"feature/final_review","sha":"3b79dab2e1759271625ea27e4e31fd6fc6b723fe","user":{"login":"samsao","id":6145949,"avatar_url":"https://avatars.githubusercontent.com/u/6145949?v=3","gravatar_id":"","url":"https://api.github.com/users/samsao","html_url":"https://github.com/samsao","followers_url":"https://api.github.com/users/samsao/followers","following_url":"https://api.github.com/users/samsao/following{/other_user}","gists_url":"https://api.github.com/users/samsao/gists{/gist_id}","starred_url":"https://api.github.com/users/samsao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samsao/subscriptions","organizations_url":"https://api.github.com/users/samsao/orgs","repos_url":"https://api.github.com/users/samsao/repos","events_url":"https://api.github.com/users/samsao/events{/privacy}","received_events_url":"https://api.github.com/users/samsao/received_events","type":"Organization","site_admin":false},"repo":{"id":74071527,"name":"slack_office_bot","full_name":"samsao/slack_office_bot","owner":{"login":"samsao","id":6145949,"avatar_url":"https://avatars.githubusercontent.com/u/6145949?v=3","gravatar_id":"","url":"https://api.github.com/users/samsao","html_url":"https://github.com/samsao","followers_url":"https://api.github.com/users/samsao/followers","following_url":"https://api.github.com/users/samsao/following{/other_user}","gists_url":"https://api.github.com/users/samsao/gists{/gist_id}","starred_url":"https://api.github.com/users/samsao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samsao/subscriptions","organizations_url":"https://api.github.com/users/samsao/orgs","repos_url":"https://api.github.com/users/samsao/repos","events_url":"https://api.github.com/users/samsao/events{/privacy}","received_events_url":"https://api.github.com/users/samsao/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/samsao/slack_office_bot","description":"Our slack bot to manage office tasks","fork":false,"url":"https://api.github.com/repos/samsao/slack_office_bot","forks_url":"https://api.github.com/repos/samsao/slack_office_bot/forks","keys_url":"https://api.github.com/repos/samsao/slack_office_bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samsao/slack_office_bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samsao/slack_office_bot/teams","hooks_url":"https://api.github.com/repos/samsao/slack_office_bot/hooks","issue_events_url":"https://api.github.com/repos/samsao/slack_office_bot/issues/events{/number}","events_url":"https://api.github.com/repos/samsao/slack_office_bot/events","assignees_url":"https://api.github.com/repos/samsao/slack_office_bot/assignees{/user}","branches_url":"https://api.github.com/repos/samsao/slack_office_bot/branches{/branch}","tags_url":"https://api.github.com/repos/samsao/slack_office_bot/tags","blobs_url":"https://api.github.com/repos/samsao/slack_office_bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samsao/slack_office_bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samsao/slack_office_bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/samsao/slack_office_bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samsao/slack_office_bot/statuses/{sha}","languages_url":"https://api.github.com/repos/samsao/slack_office_bot/languages","stargazers_url":"https://api.github.com/repos/samsao/slack_office_bot/stargazers","contributors_url":"https://api.github.com/repos/samsao/slack_office_bot/contributors","subscribers_url":"https://api.github.com/repos/samsao/slack_office_bot/subscribers","subscription_url":"https://api.github.com/repos/samsao/slack_office_bot/subscription","commits_url":"https://api.github.com/repos/samsao/slack_office_bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/samsao/slack_office_bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/samsao/slack_office_bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/samsao/slack_office_bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/samsao/slack_office_bot/contents/{+path}","compare_url":"https://api.github.com/repos/samsao/slack_office_bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samsao/slack_office_bot/merges","archive_url":"https://api.github.com/repos/samsao/slack_office_bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samsao/slack_office_bot/downloads","issues_url":"https://api.github.com/repos/samsao/slack_office_bot/issues{/number}","pulls_url":"https://api.github.com/repos/samsao/slack_office_bot/pulls{/number}","milestones_url":"https://api.github.com/repos/samsao/slack_office_bot/milestones{/number}","notifications_url":"https://api.github.com/repos/samsao/slack_office_bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samsao/slack_office_bot/labels{/name}","releases_url":"https://api.github.com/repos/samsao/slack_office_bot/releases{/id}","deployments_url":"https://api.github.com/repos/samsao/slack_office_bot/deployments","created_at":"2016-11-17T22:04:10Z","updated_at":"2016-11-17T22:12:39Z","pushed_at":"2016-12-02T08:43:30Z","git_url":"git://github.com/samsao/slack_office_bot.git","ssh_url":"git@github.com:samsao/slack_office_bot.git","clone_url":"https://github.com/samsao/slack_office_bot.git","svn_url":"https://github.com/samsao/slack_office_bot","homepage":null,"size":74,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"samsao:develop","ref":"develop","sha":"0c9a6a39e5b99c35de7977ab35a2c34e7ac3b5d9","user":{"login":"samsao","id":6145949,"avatar_url":"https://avatars.githubusercontent.com/u/6145949?v=3","gravatar_id":"","url":"https://api.github.com/users/samsao","html_url":"https://github.com/samsao","followers_url":"https://api.github.com/users/samsao/followers","following_url":"https://api.github.com/users/samsao/following{/other_user}","gists_url":"https://api.github.com/users/samsao/gists{/gist_id}","starred_url":"https://api.github.com/users/samsao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samsao/subscriptions","organizations_url":"https://api.github.com/users/samsao/orgs","repos_url":"https://api.github.com/users/samsao/repos","events_url":"https://api.github.com/users/samsao/events{/privacy}","received_events_url":"https://api.github.com/users/samsao/received_events","type":"Organization","site_admin":false},"repo":{"id":74071527,"name":"slack_office_bot","full_name":"samsao/slack_office_bot","owner":{"login":"samsao","id":6145949,"avatar_url":"https://avatars.githubusercontent.com/u/6145949?v=3","gravatar_id":"","url":"https://api.github.com/users/samsao","html_url":"https://github.com/samsao","followers_url":"https://api.github.com/users/samsao/followers","following_url":"https://api.github.com/users/samsao/following{/other_user}","gists_url":"https://api.github.com/users/samsao/gists{/gist_id}","starred_url":"https://api.github.com/users/samsao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samsao/subscriptions","organizations_url":"https://api.github.com/users/samsao/orgs","repos_url":"https://api.github.com/users/samsao/repos","events_url":"https://api.github.com/users/samsao/events{/privacy}","received_events_url":"https://api.github.com/users/samsao/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/samsao/slack_office_bot","description":"Our slack bot to manage office tasks","fork":false,"url":"https://api.github.com/repos/samsao/slack_office_bot","forks_url":"https://api.github.com/repos/samsao/slack_office_bot/forks","keys_url":"https://api.github.com/repos/samsao/slack_office_bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samsao/slack_office_bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samsao/slack_office_bot/teams","hooks_url":"https://api.github.com/repos/samsao/slack_office_bot/hooks","issue_events_url":"https://api.github.com/repos/samsao/slack_office_bot/issues/events{/number}","events_url":"https://api.github.com/repos/samsao/slack_office_bot/events","assignees_url":"https://api.github.com/repos/samsao/slack_office_bot/assignees{/user}","branches_url":"https://api.github.com/repos/samsao/slack_office_bot/branches{/branch}","tags_url":"https://api.github.com/repos/samsao/slack_office_bot/tags","blobs_url":"https://api.github.com/repos/samsao/slack_office_bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samsao/slack_office_bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samsao/slack_office_bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/samsao/slack_office_bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samsao/slack_office_bot/statuses/{sha}","languages_url":"https://api.github.com/repos/samsao/slack_office_bot/languages","stargazers_url":"https://api.github.com/repos/samsao/slack_office_bot/stargazers","contributors_url":"https://api.github.com/repos/samsao/slack_office_bot/contributors","subscribers_url":"https://api.github.com/repos/samsao/slack_office_bot/subscribers","subscription_url":"https://api.github.com/repos/samsao/slack_office_bot/subscription","commits_url":"https://api.github.com/repos/samsao/slack_office_bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/samsao/slack_office_bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/samsao/slack_office_bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/samsao/slack_office_bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/samsao/slack_office_bot/contents/{+path}","compare_url":"https://api.github.com/repos/samsao/slack_office_bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samsao/slack_office_bot/merges","archive_url":"https://api.github.com/repos/samsao/slack_office_bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samsao/slack_office_bot/downloads","issues_url":"https://api.github.com/repos/samsao/slack_office_bot/issues{/number}","pulls_url":"https://api.github.com/repos/samsao/slack_office_bot/pulls{/number}","milestones_url":"https://api.github.com/repos/samsao/slack_office_bot/milestones{/number}","notifications_url":"https://api.github.com/repos/samsao/slack_office_bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samsao/slack_office_bot/labels{/name}","releases_url":"https://api.github.com/repos/samsao/slack_office_bot/releases{/id}","deployments_url":"https://api.github.com/repos/samsao/slack_office_bot/deployments","created_at":"2016-11-17T22:04:10Z","updated_at":"2016-11-17T22:12:39Z","pushed_at":"2016-12-02T08:43:30Z","git_url":"git://github.com/samsao/slack_office_bot.git","ssh_url":"git@github.com:samsao/slack_office_bot.git","clone_url":"https://github.com/samsao/slack_office_bot.git","svn_url":"https://github.com/samsao/slack_office_bot","homepage":null,"size":74,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/samsao/slack_office_bot/pulls/20"},"html":{"href":"https://github.com/samsao/slack_office_bot/pull/20"},"issue":{"href":"https://api.github.com/repos/samsao/slack_office_bot/issues/20"},"comments":{"href":"https://api.github.com/repos/samsao/slack_office_bot/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/samsao/slack_office_bot/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/samsao/slack_office_bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/samsao/slack_office_bot/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/samsao/slack_office_bot/statuses/3b79dab2e1759271625ea27e4e31fd6fc6b723fe"}}}}
{"actor":{"display_login":"GlisboaDev"}}