{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/comments/355619517","pull_request_review_id":329138252,"id":355619517,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1NTYxOTUxNw==","diff_hunk":"@@ -342,6 +342,75 @@ const getHighestPreviousBand = async nominalId => {\n   return result.rows[0].highestBand\n }\n \n+const createNeedsPriorities = async (nominalId, needsForm, username) => {\n+  const result = await nonTransactionalClient.query({\n+    text: `insert into needs_priorities \n+           (nominal_id, needs_status, needs_form, started_time, last_updated_by)\n+           values ($1, 'CREATED', $2, now(), $3)","path":"server/data/pathfinderClient.js","position":8,"original_position":8,"commit_id":"2f5732b585f3ef8a40107ba2b60bdee6b9d93f5d","original_commit_id":"2f5732b585f3ef8a40107ba2b60bdee6b9d93f5d","user":{"login":"timharrison-moj","id":47779388,"node_id":"MDQ6VXNlcjQ3Nzc5Mzg4","avatar_url":"https://avatars2.githubusercontent.com/u/47779388?v=4","gravatar_id":"","url":"https://api.github.com/users/timharrison-moj","html_url":"https://github.com/timharrison-moj","followers_url":"https://api.github.com/users/timharrison-moj/followers","following_url":"https://api.github.com/users/timharrison-moj/following{/other_user}","gists_url":"https://api.github.com/users/timharrison-moj/gists{/gist_id}","starred_url":"https://api.github.com/users/timharrison-moj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timharrison-moj/subscriptions","organizations_url":"https://api.github.com/users/timharrison-moj/orgs","repos_url":"https://api.github.com/users/timharrison-moj/repos","events_url":"https://api.github.com/users/timharrison-moj/events{/privacy}","received_events_url":"https://api.github.com/users/timharrison-moj/received_events","type":"User","site_admin":false},"body":"done","created_at":"2019-12-09T18:47:16Z","updated_at":"2019-12-09T18:47:16Z","html_url":"https://github.com/ministryofjustice/pathfinder/pull/101#discussion_r355619517","pull_request_url":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/101","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/comments/355619517"},"html":{"href":"https://github.com/ministryofjustice/pathfinder/pull/101#discussion_r355619517"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/101"}},"in_reply_to_id":355546544},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/101","id":350780781,"node_id":"MDExOlB1bGxSZXF1ZXN0MzUwNzgwNzgx","html_url":"https://github.com/ministryofjustice/pathfinder/pull/101","diff_url":"https://github.com/ministryofjustice/pathfinder/pull/101.diff","patch_url":"https://github.com/ministryofjustice/pathfinder/pull/101.patch","issue_url":"https://api.github.com/repos/ministryofjustice/pathfinder/issues/101","number":101,"state":"open","locked":false,"title":"PAT-325: Full needs priority evaluation feature","user":{"login":"timharrison-moj","id":47779388,"node_id":"MDQ6VXNlcjQ3Nzc5Mzg4","avatar_url":"https://avatars2.githubusercontent.com/u/47779388?v=4","gravatar_id":"","url":"https://api.github.com/users/timharrison-moj","html_url":"https://github.com/timharrison-moj","followers_url":"https://api.github.com/users/timharrison-moj/followers","following_url":"https://api.github.com/users/timharrison-moj/following{/other_user}","gists_url":"https://api.github.com/users/timharrison-moj/gists{/gist_id}","starred_url":"https://api.github.com/users/timharrison-moj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timharrison-moj/subscriptions","organizations_url":"https://api.github.com/users/timharrison-moj/orgs","repos_url":"https://api.github.com/users/timharrison-moj/repos","events_url":"https://api.github.com/users/timharrison-moj/events{/privacy}","received_events_url":"https://api.github.com/users/timharrison-moj/received_events","type":"User","site_admin":false},"body":"This adds a new table, new routes and forms, new needs banding algorithm, and new question configuration file (similar to risk-banding).\r\nThis is a first-cut of the needs priority evaluation as there are some questions outstanding and work which I know needs to be added in : \r\n* Do we need to prevent access if a risk-banding has not been completed?\r\n* What should happen to the needs priority scores if a risk banding is subsequently changed?\r\n* We do not calculate the TAPS and BPS score yet as these rely on a completed risk banding\r\n* I need to add gender into the basic offender details - one of the needs scores requires it - defaulted to Male at present.\r\n* The user-guide wording needs some content input on the mental health and behaviours pages - just placeholder text for now.\r\n* Some of the form and route functions could be shared between needs and risk-banding - this is an additional task to take on once this PR is in.","created_at":"2019-12-09T15:37:45Z","updated_at":"2019-12-09T18:47:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7254f735527c02850295e2a9785e69c0556e636b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/101/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/101/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/pathfinder/issues/101/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/pathfinder/statuses/2f5732b585f3ef8a40107ba2b60bdee6b9d93f5d","head":{"label":"ministryofjustice:PAT-325_needs_priority_evaluation","ref":"PAT-325_needs_priority_evaluation","sha":"2f5732b585f3ef8a40107ba2b60bdee6b9d93f5d","user":{"login":"ministryofjustice","id":2203574,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NzQ=","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":201932521,"node_id":"MDEwOlJlcG9zaXRvcnkyMDE5MzI1MjE=","name":"pathfinder","full_name":"ministryofjustice/pathfinder","private":false,"owner":{"login":"ministryofjustice","id":2203574,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NzQ=","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},"html_url":"https://github.com/ministryofjustice/pathfinder","description":null,"fork":false,"url":"https://api.github.com/repos/ministryofjustice/pathfinder","forks_url":"https://api.github.com/repos/ministryofjustice/pathfinder/forks","keys_url":"https://api.github.com/repos/ministryofjustice/pathfinder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/pathfinder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/pathfinder/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/pathfinder/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/pathfinder/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/pathfinder/events","assignees_url":"https://api.github.com/repos/ministryofjustice/pathfinder/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/pathfinder/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/pathfinder/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/pathfinder/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/pathfinder/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/pathfinder/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/pathfinder/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/pathfinder/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/pathfinder/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/pathfinder/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/pathfinder/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/pathfinder/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/pathfinder/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/pathfinder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/pathfinder/merges","archive_url":"https://api.github.com/repos/ministryofjustice/pathfinder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/pathfinder/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/pathfinder/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/pathfinder/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/pathfinder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/pathfinder/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/pathfinder/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/pathfinder/deployments","created_at":"2019-08-12T13:08:41Z","updated_at":"2019-12-06T18:43:54Z","pushed_at":"2019-12-09T18:26:46Z","git_url":"git://github.com/ministryofjustice/pathfinder.git","ssh_url":"git@github.com:ministryofjustice/pathfinder.git","clone_url":"https://github.com/ministryofjustice/pathfinder.git","svn_url":"https://github.com/ministryofjustice/pathfinder","homepage":null,"size":12154,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"0c69179adc996d960f98b2b0755bcb659377cb53","user":{"login":"ministryofjustice","id":2203574,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NzQ=","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":201932521,"node_id":"MDEwOlJlcG9zaXRvcnkyMDE5MzI1MjE=","name":"pathfinder","full_name":"ministryofjustice/pathfinder","private":false,"owner":{"login":"ministryofjustice","id":2203574,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NzQ=","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},"html_url":"https://github.com/ministryofjustice/pathfinder","description":null,"fork":false,"url":"https://api.github.com/repos/ministryofjustice/pathfinder","forks_url":"https://api.github.com/repos/ministryofjustice/pathfinder/forks","keys_url":"https://api.github.com/repos/ministryofjustice/pathfinder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/pathfinder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/pathfinder/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/pathfinder/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/pathfinder/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/pathfinder/events","assignees_url":"https://api.github.com/repos/ministryofjustice/pathfinder/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/pathfinder/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/pathfinder/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/pathfinder/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/pathfinder/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/pathfinder/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/pathfinder/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/pathfinder/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/pathfinder/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/pathfinder/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/pathfinder/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/pathfinder/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/pathfinder/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/pathfinder/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/pathfinder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/pathfinder/merges","archive_url":"https://api.github.com/repos/ministryofjustice/pathfinder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/pathfinder/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/pathfinder/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/pathfinder/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/pathfinder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/pathfinder/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/pathfinder/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/pathfinder/deployments","created_at":"2019-08-12T13:08:41Z","updated_at":"2019-12-06T18:43:54Z","pushed_at":"2019-12-09T18:26:46Z","git_url":"git://github.com/ministryofjustice/pathfinder.git","ssh_url":"git@github.com:ministryofjustice/pathfinder.git","clone_url":"https://github.com/ministryofjustice/pathfinder.git","svn_url":"https://github.com/ministryofjustice/pathfinder","homepage":null,"size":12154,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/101"},"html":{"href":"https://github.com/ministryofjustice/pathfinder/pull/101"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/issues/101"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/pathfinder/statuses/2f5732b585f3ef8a40107ba2b60bdee6b9d93f5d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"timharrison-moj"}}