{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/comments/143982166","pull_request_review_id":68571968,"id":143982166,"diff_hunk":"@@ -0,0 +1,36 @@\n+const config = require('../../../config')\n+const knexConfig = require('../../../knexfile').app\n+const knex = require('knex')(knexConfig)\n+\n+module.exports = function (omKey, teamCode) {\n+  var whereObject = {\n+    'assessment_staff_key': omKey,\n+    'assessmentent_team_key': teamCode // typo in extract\n+  }\n+\n+  return knex.count('sentence_type as count').select('sentence_type')\n+          .from(`${config.DB_STG_SCHEMA}.arms`)\n+          .where(whereObject) // .andWhere(disposal_or_release_date is no more than 6 weeks ago)\n+          .groupBy('sentence_type')\n+  .then(function (results) {\n+    var armsTotals = {\n+      community: 0,\n+      license: 0\n+    }\n+\n+    results.forEach(function (row) {\n+      switch (row.sentence_type) {\n+        case 'Community':","path":"app/services/data/get-arms-totals.js","position":23,"original_position":23,"commit_id":"e6aaf8477ef18e3c383ac733e0ac786b21f91458","original_commit_id":"e6aaf8477ef18e3c383ac733e0ac786b21f91458","user":{"login":"andrew-js-wright","id":2773538,"avatar_url":"https://avatars1.githubusercontent.com/u/2773538?v=4","gravatar_id":"","url":"https://api.github.com/users/andrew-js-wright","html_url":"https://github.com/andrew-js-wright","followers_url":"https://api.github.com/users/andrew-js-wright/followers","following_url":"https://api.github.com/users/andrew-js-wright/following{/other_user}","gists_url":"https://api.github.com/users/andrew-js-wright/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew-js-wright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew-js-wright/subscriptions","organizations_url":"https://api.github.com/users/andrew-js-wright/orgs","repos_url":"https://api.github.com/users/andrew-js-wright/repos","events_url":"https://api.github.com/users/andrew-js-wright/events{/privacy}","received_events_url":"https://api.github.com/users/andrew-js-wright/received_events","type":"User","site_admin":false},"body":"It was in the sample extract that Kristy sent to Tom. I'll move these to `const` so if they're different when the file lands we can easily change them.","created_at":"2017-10-11T11:29:21Z","updated_at":"2017-10-11T11:29:21Z","html_url":"https://github.com/ministryofjustice/wmt-worker/pull/118#discussion_r143982166","pull_request_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/118","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/comments/143982166"},"html":{"href":"https://github.com/ministryofjustice/wmt-worker/pull/118#discussion_r143982166"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/118"}},"in_reply_to_id":143973253},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/118","id":144944835,"html_url":"https://github.com/ministryofjustice/wmt-worker/pull/118","diff_url":"https://github.com/ministryofjustice/wmt-worker/pull/118.diff","patch_url":"https://github.com/ministryofjustice/wmt-worker/pull/118.patch","issue_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues/118","number":118,"state":"open","locked":false,"title":"Feature/wmt 414/display arms assessments","user":{"login":"andrew-js-wright","id":2773538,"avatar_url":"https://avatars1.githubusercontent.com/u/2773538?v=4","gravatar_id":"","url":"https://api.github.com/users/andrew-js-wright","html_url":"https://github.com/andrew-js-wright","followers_url":"https://api.github.com/users/andrew-js-wright/followers","following_url":"https://api.github.com/users/andrew-js-wright/following{/other_user}","gists_url":"https://api.github.com/users/andrew-js-wright/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew-js-wright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew-js-wright/subscriptions","organizations_url":"https://api.github.com/users/andrew-js-wright/orgs","repos_url":"https://api.github.com/users/andrew-js-wright/repos","events_url":"https://api.github.com/users/andrew-js-wright/events{/privacy}","received_events_url":"https://api.github.com/users/andrew-js-wright/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-05T15:13:41Z","updated_at":"2017-10-11T11:29:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df0279ed425142c15799372fd1af76d772e869d7","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/118/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/118/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues/118/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/statuses/e6aaf8477ef18e3c383ac733e0ac786b21f91458","head":{"label":"ministryofjustice:feature/wmt-414/display-arms-assessments","ref":"feature/wmt-414/display-arms-assessments","sha":"e6aaf8477ef18e3c383ac733e0ac786b21f91458","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":86353532,"name":"wmt-worker","full_name":"ministryofjustice/wmt-worker","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/wmt-worker","description":null,"fork":false,"url":"https://api.github.com/repos/ministryofjustice/wmt-worker","forks_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/forks","keys_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/events","assignees_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/merges","archive_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/deployments","created_at":"2017-03-27T15:39:47Z","updated_at":"2017-04-05T09:03:13Z","pushed_at":"2017-10-11T10:11:45Z","git_url":"git://github.com/ministryofjustice/wmt-worker.git","ssh_url":"git@github.com:ministryofjustice/wmt-worker.git","clone_url":"https://github.com/ministryofjustice/wmt-worker.git","svn_url":"https://github.com/ministryofjustice/wmt-worker","homepage":null,"size":598,"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":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"261c2e17daf6d2e07cd461beb8d5d0c8b18f659f","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":86353532,"name":"wmt-worker","full_name":"ministryofjustice/wmt-worker","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/wmt-worker","description":null,"fork":false,"url":"https://api.github.com/repos/ministryofjustice/wmt-worker","forks_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/forks","keys_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/events","assignees_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/merges","archive_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/wmt-worker/deployments","created_at":"2017-03-27T15:39:47Z","updated_at":"2017-04-05T09:03:13Z","pushed_at":"2017-10-11T10:11:45Z","git_url":"git://github.com/ministryofjustice/wmt-worker.git","ssh_url":"git@github.com:ministryofjustice/wmt-worker.git","clone_url":"https://github.com/ministryofjustice/wmt-worker.git","svn_url":"https://github.com/ministryofjustice/wmt-worker","homepage":null,"size":598,"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":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/118"},"html":{"href":"https://github.com/ministryofjustice/wmt-worker/pull/118"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues/118"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/wmt-worker/statuses/e6aaf8477ef18e3c383ac733e0ac786b21f91458"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"andrew-js-wright"}}