{"action":"created","comment":{"url":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/comments/236053229","pull_request_review_id":178061623,"id":236053229,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjA1MzIyOQ==","diff_hunk":"@@ -61,4 +71,50 @@ public void delete(String id) {\n                     return landRegistryData;\n                 }).collect(Collectors.toList());\n     }\n+    \n+\tpublic int updateAveragePrice(HashMap<String, Long> averagePrices) throws IOException, UnirestException {\n+\t\tint updatedRecords = 0;\n+\t\tEntityManager em = getEntityManager();\n+\n+\t\tfor (Entry<String, Long> averagePrice : averagePrices.entrySet()) {\n+\t\t\tPostCodeCoordinates coordsToUpdate = em.find(PostCodeCoordinates.class, averagePrice.getKey());\n+\n+\t\t\tif (!coordsToUpdate.getAverageprice().equals(averagePrice.getValue())) {\n+\n+\t\t\t\t// update local values\n+\t\t\t\tem.getTransaction().begin();\n+\t\t\t\tcoordsToUpdate.setAverageprice(averagePrice.getValue());\n+\t\t\t\tem.merge(coordsToUpdate);\n+\n+\t\t\t\t// write update to database\n+\t\t\t\tem.getTransaction().commit();\n+\t\t\t\tupdatedRecords++;\n+\t\t\t}\n+\t\t}\n+\n+\t\tem.close();\n+\n+\t\treturn updatedRecords;\n+    }\n+\n+\t@SuppressWarnings(\"unchecked\")\n+\tpublic HashMap<String, List<String>> getAllPostcodes(String regex, boolean restrictToUnset, int groupCharSize) {\n+\t\tList<String> postcodes = (List<String>) getEntityManager()\n+\t\t\t\t.createNativeQuery(\"SELECT postcode FROM \" + TABLE_NAME + \"\\n\" + \"WHERE postcode LIKE :outcode\" + (restrictToUnset ? \" AND averageprice = 0\" : \"\"))\n+\t\t\t\t.setParameter(\"outcode\", regex + \"%\").getResultList().stream().map(r -> String.valueOf(r)).collect(Collectors.toList());","path":"backend/src/main/java/asegroup1/api/daos/landregistry/LandRegistryDaoImpl.java","position":69,"original_position":69,"commit_id":"4c48218387f7ca9b4a29a2cdc8faced1c34dc975","original_commit_id":"4c48218387f7ca9b4a29a2cdc8faced1c34dc975","user":{"login":"Gregam3","id":14945621,"node_id":"MDQ6VXNlcjE0OTQ1NjIx","avatar_url":"https://avatars2.githubusercontent.com/u/14945621?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregam3","html_url":"https://github.com/Gregam3","followers_url":"https://api.github.com/users/Gregam3/followers","following_url":"https://api.github.com/users/Gregam3/following{/other_user}","gists_url":"https://api.github.com/users/Gregam3/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregam3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregam3/subscriptions","organizations_url":"https://api.github.com/users/Gregam3/orgs","repos_url":"https://api.github.com/users/Gregam3/repos","events_url":"https://api.github.com/users/Gregam3/events{/privacy}","received_events_url":"https://api.github.com/users/Gregam3/received_events","type":"User","site_admin":false},"body":"Can be cleaned up to `.getResultList().stream().map(String::valueOf).collect(Collectors.toList());`","created_at":"2018-11-24T20:42:03Z","updated_at":"2018-11-24T20:49:57Z","html_url":"https://github.com/Gregam3/ASEGroup1/pull/171#discussion_r236053229","pull_request_url":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/171","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/comments/236053229"},"html":{"href":"https://github.com/Gregam3/ASEGroup1/pull/171#discussion_r236053229"},"pull_request":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/171"}}},"pull_request":{"url":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/171","id":233338226,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMzM4MjI2","html_url":"https://github.com/Gregam3/ASEGroup1/pull/171","diff_url":"https://github.com/Gregam3/ASEGroup1/pull/171.diff","patch_url":"https://github.com/Gregam3/ASEGroup1/pull/171.patch","issue_url":"https://api.github.com/repos/Gregam3/ASEGroup1/issues/171","number":171,"state":"open","locked":false,"title":"Rp 162 update average postcode","user":{"login":"richousrick","id":5024935,"node_id":"MDQ6VXNlcjUwMjQ5MzU=","avatar_url":"https://avatars0.githubusercontent.com/u/5024935?v=4","gravatar_id":"","url":"https://api.github.com/users/richousrick","html_url":"https://github.com/richousrick","followers_url":"https://api.github.com/users/richousrick/followers","following_url":"https://api.github.com/users/richousrick/following{/other_user}","gists_url":"https://api.github.com/users/richousrick/gists{/gist_id}","starred_url":"https://api.github.com/users/richousrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richousrick/subscriptions","organizations_url":"https://api.github.com/users/richousrick/orgs","repos_url":"https://api.github.com/users/richousrick/repos","events_url":"https://api.github.com/users/richousrick/events{/privacy}","received_events_url":"https://api.github.com/users/richousrick/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-24T20:21:05Z","updated_at":"2018-11-24T20:49:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71483adbc1f239ef5b2555166fdeda1f69f87a43","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/171/commits","review_comments_url":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/171/comments","review_comment_url":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Gregam3/ASEGroup1/issues/171/comments","statuses_url":"https://api.github.com/repos/Gregam3/ASEGroup1/statuses/4c48218387f7ca9b4a29a2cdc8faced1c34dc975","head":{"label":"Gregam3:rp-162-UpdateAveragePostcode","ref":"rp-162-UpdateAveragePostcode","sha":"4c48218387f7ca9b4a29a2cdc8faced1c34dc975","user":{"login":"Gregam3","id":14945621,"node_id":"MDQ6VXNlcjE0OTQ1NjIx","avatar_url":"https://avatars2.githubusercontent.com/u/14945621?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregam3","html_url":"https://github.com/Gregam3","followers_url":"https://api.github.com/users/Gregam3/followers","following_url":"https://api.github.com/users/Gregam3/following{/other_user}","gists_url":"https://api.github.com/users/Gregam3/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregam3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregam3/subscriptions","organizations_url":"https://api.github.com/users/Gregam3/orgs","repos_url":"https://api.github.com/users/Gregam3/repos","events_url":"https://api.github.com/users/Gregam3/events{/privacy}","received_events_url":"https://api.github.com/users/Gregam3/received_events","type":"User","site_admin":false},"repo":{"id":152620500,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI2MjA1MDA=","name":"ASEGroup1","full_name":"Gregam3/ASEGroup1","private":false,"owner":{"login":"Gregam3","id":14945621,"node_id":"MDQ6VXNlcjE0OTQ1NjIx","avatar_url":"https://avatars2.githubusercontent.com/u/14945621?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregam3","html_url":"https://github.com/Gregam3","followers_url":"https://api.github.com/users/Gregam3/followers","following_url":"https://api.github.com/users/Gregam3/following{/other_user}","gists_url":"https://api.github.com/users/Gregam3/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregam3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregam3/subscriptions","organizations_url":"https://api.github.com/users/Gregam3/orgs","repos_url":"https://api.github.com/users/Gregam3/repos","events_url":"https://api.github.com/users/Gregam3/events{/privacy}","received_events_url":"https://api.github.com/users/Gregam3/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Gregam3/ASEGroup1","description":"The repository for group 1 for the module Advanced Software Engineering/ESRS Project. ","fork":false,"url":"https://api.github.com/repos/Gregam3/ASEGroup1","forks_url":"https://api.github.com/repos/Gregam3/ASEGroup1/forks","keys_url":"https://api.github.com/repos/Gregam3/ASEGroup1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gregam3/ASEGroup1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gregam3/ASEGroup1/teams","hooks_url":"https://api.github.com/repos/Gregam3/ASEGroup1/hooks","issue_events_url":"https://api.github.com/repos/Gregam3/ASEGroup1/issues/events{/number}","events_url":"https://api.github.com/repos/Gregam3/ASEGroup1/events","assignees_url":"https://api.github.com/repos/Gregam3/ASEGroup1/assignees{/user}","branches_url":"https://api.github.com/repos/Gregam3/ASEGroup1/branches{/branch}","tags_url":"https://api.github.com/repos/Gregam3/ASEGroup1/tags","blobs_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gregam3/ASEGroup1/statuses/{sha}","languages_url":"https://api.github.com/repos/Gregam3/ASEGroup1/languages","stargazers_url":"https://api.github.com/repos/Gregam3/ASEGroup1/stargazers","contributors_url":"https://api.github.com/repos/Gregam3/ASEGroup1/contributors","subscribers_url":"https://api.github.com/repos/Gregam3/ASEGroup1/subscribers","subscription_url":"https://api.github.com/repos/Gregam3/ASEGroup1/subscription","commits_url":"https://api.github.com/repos/Gregam3/ASEGroup1/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gregam3/ASEGroup1/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gregam3/ASEGroup1/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gregam3/ASEGroup1/contents/{+path}","compare_url":"https://api.github.com/repos/Gregam3/ASEGroup1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gregam3/ASEGroup1/merges","archive_url":"https://api.github.com/repos/Gregam3/ASEGroup1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gregam3/ASEGroup1/downloads","issues_url":"https://api.github.com/repos/Gregam3/ASEGroup1/issues{/number}","pulls_url":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls{/number}","milestones_url":"https://api.github.com/repos/Gregam3/ASEGroup1/milestones{/number}","notifications_url":"https://api.github.com/repos/Gregam3/ASEGroup1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gregam3/ASEGroup1/labels{/name}","releases_url":"https://api.github.com/repos/Gregam3/ASEGroup1/releases{/id}","deployments_url":"https://api.github.com/repos/Gregam3/ASEGroup1/deployments","created_at":"2018-10-11T16:12:51Z","updated_at":"2018-11-17T16:13:35Z","pushed_at":"2018-11-24T20:22:26Z","git_url":"git://github.com/Gregam3/ASEGroup1.git","ssh_url":"git@github.com:Gregam3/ASEGroup1.git","clone_url":"https://github.com/Gregam3/ASEGroup1.git","svn_url":"https://github.com/Gregam3/ASEGroup1","homepage":"","size":583,"stargazers_count":0,"watchers_count":0,"language":"Java","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":58,"license":null,"forks":1,"open_issues":58,"watchers":0,"default_branch":"master"}},"base":{"label":"Gregam3:development","ref":"development","sha":"2b712bc0cbb11fc3abc7190e9eab27b31b737bbf","user":{"login":"Gregam3","id":14945621,"node_id":"MDQ6VXNlcjE0OTQ1NjIx","avatar_url":"https://avatars2.githubusercontent.com/u/14945621?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregam3","html_url":"https://github.com/Gregam3","followers_url":"https://api.github.com/users/Gregam3/followers","following_url":"https://api.github.com/users/Gregam3/following{/other_user}","gists_url":"https://api.github.com/users/Gregam3/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregam3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregam3/subscriptions","organizations_url":"https://api.github.com/users/Gregam3/orgs","repos_url":"https://api.github.com/users/Gregam3/repos","events_url":"https://api.github.com/users/Gregam3/events{/privacy}","received_events_url":"https://api.github.com/users/Gregam3/received_events","type":"User","site_admin":false},"repo":{"id":152620500,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI2MjA1MDA=","name":"ASEGroup1","full_name":"Gregam3/ASEGroup1","private":false,"owner":{"login":"Gregam3","id":14945621,"node_id":"MDQ6VXNlcjE0OTQ1NjIx","avatar_url":"https://avatars2.githubusercontent.com/u/14945621?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregam3","html_url":"https://github.com/Gregam3","followers_url":"https://api.github.com/users/Gregam3/followers","following_url":"https://api.github.com/users/Gregam3/following{/other_user}","gists_url":"https://api.github.com/users/Gregam3/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregam3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregam3/subscriptions","organizations_url":"https://api.github.com/users/Gregam3/orgs","repos_url":"https://api.github.com/users/Gregam3/repos","events_url":"https://api.github.com/users/Gregam3/events{/privacy}","received_events_url":"https://api.github.com/users/Gregam3/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Gregam3/ASEGroup1","description":"The repository for group 1 for the module Advanced Software Engineering/ESRS Project. ","fork":false,"url":"https://api.github.com/repos/Gregam3/ASEGroup1","forks_url":"https://api.github.com/repos/Gregam3/ASEGroup1/forks","keys_url":"https://api.github.com/repos/Gregam3/ASEGroup1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gregam3/ASEGroup1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gregam3/ASEGroup1/teams","hooks_url":"https://api.github.com/repos/Gregam3/ASEGroup1/hooks","issue_events_url":"https://api.github.com/repos/Gregam3/ASEGroup1/issues/events{/number}","events_url":"https://api.github.com/repos/Gregam3/ASEGroup1/events","assignees_url":"https://api.github.com/repos/Gregam3/ASEGroup1/assignees{/user}","branches_url":"https://api.github.com/repos/Gregam3/ASEGroup1/branches{/branch}","tags_url":"https://api.github.com/repos/Gregam3/ASEGroup1/tags","blobs_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gregam3/ASEGroup1/statuses/{sha}","languages_url":"https://api.github.com/repos/Gregam3/ASEGroup1/languages","stargazers_url":"https://api.github.com/repos/Gregam3/ASEGroup1/stargazers","contributors_url":"https://api.github.com/repos/Gregam3/ASEGroup1/contributors","subscribers_url":"https://api.github.com/repos/Gregam3/ASEGroup1/subscribers","subscription_url":"https://api.github.com/repos/Gregam3/ASEGroup1/subscription","commits_url":"https://api.github.com/repos/Gregam3/ASEGroup1/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gregam3/ASEGroup1/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gregam3/ASEGroup1/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gregam3/ASEGroup1/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gregam3/ASEGroup1/contents/{+path}","compare_url":"https://api.github.com/repos/Gregam3/ASEGroup1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gregam3/ASEGroup1/merges","archive_url":"https://api.github.com/repos/Gregam3/ASEGroup1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gregam3/ASEGroup1/downloads","issues_url":"https://api.github.com/repos/Gregam3/ASEGroup1/issues{/number}","pulls_url":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls{/number}","milestones_url":"https://api.github.com/repos/Gregam3/ASEGroup1/milestones{/number}","notifications_url":"https://api.github.com/repos/Gregam3/ASEGroup1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gregam3/ASEGroup1/labels{/name}","releases_url":"https://api.github.com/repos/Gregam3/ASEGroup1/releases{/id}","deployments_url":"https://api.github.com/repos/Gregam3/ASEGroup1/deployments","created_at":"2018-10-11T16:12:51Z","updated_at":"2018-11-17T16:13:35Z","pushed_at":"2018-11-24T20:22:26Z","git_url":"git://github.com/Gregam3/ASEGroup1.git","ssh_url":"git@github.com:Gregam3/ASEGroup1.git","clone_url":"https://github.com/Gregam3/ASEGroup1.git","svn_url":"https://github.com/Gregam3/ASEGroup1","homepage":"","size":583,"stargazers_count":0,"watchers_count":0,"language":"Java","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":58,"license":null,"forks":1,"open_issues":58,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/171"},"html":{"href":"https://github.com/Gregam3/ASEGroup1/pull/171"},"issue":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/issues/171"},"comments":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/issues/171/comments"},"review_comments":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/171/comments"},"review_comment":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/pulls/171/commits"},"statuses":{"href":"https://api.github.com/repos/Gregam3/ASEGroup1/statuses/4c48218387f7ca9b4a29a2cdc8faced1c34dc975"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Gregam3"}}