{"action":"created","comment":{"url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/comments/224051417","pull_request_review_id":163323832,"id":224051417,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDA1MTQxNw==","diff_hunk":"@@ -100,6 +105,55 @@ public ResponseEntity create(@RequestBody @Valid CurrentPeriod currentPeriod,\n         return responseEntity;\n     }\n \n+    @PutMapping\n+    public ResponseEntity update(@RequestBody @Valid CurrentPeriod currentPeriod,\n+        BindingResult bindingResult, @PathVariable(\"companyAccountId\") String companyAccountId,\n+        HttpServletRequest request) {\n+\n+        SmallFull smallFull = (SmallFull) request.getAttribute(AttributeName.SMALLFULL.getValue());\n+        if (smallFull.getLinks().get(SmallFullLinkType.CURRENT_PERIOD.getLink()) == null) {\n+            return new ResponseEntity<>(HttpStatus.BAD_REQUEST);\n+        }\n+\n+        Errors errors = new Errors();\n+\n+        if (bindingResult.hasErrors()) {\n+            errors = errorMapper.mapBindingResultErrorsToErrorModel(bindingResult, errors);","path":"src/main/java/uk/gov/companieshouse/api/accounts/controller/CurrentPeriodController.java","position":35,"original_position":35,"commit_id":"92ca62620f335c7b81cc12f0f53905be3434fe50","original_commit_id":"92ca62620f335c7b81cc12f0f53905be3434fe50","user":{"login":"macreman","id":9932414,"node_id":"MDQ6VXNlcjk5MzI0MTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/9932414?v=4","gravatar_id":"","url":"https://api.github.com/users/macreman","html_url":"https://github.com/macreman","followers_url":"https://api.github.com/users/macreman/followers","following_url":"https://api.github.com/users/macreman/following{/other_user}","gists_url":"https://api.github.com/users/macreman/gists{/gist_id}","starred_url":"https://api.github.com/users/macreman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macreman/subscriptions","organizations_url":"https://api.github.com/users/macreman/orgs","repos_url":"https://api.github.com/users/macreman/repos","events_url":"https://api.github.com/users/macreman/events{/privacy}","received_events_url":"https://api.github.com/users/macreman/received_events","type":"User","site_admin":false},"body":"I thought we were going to return before doing the business rules type validation if binding result had errors? avoids us having to be extra careful with null checks etc in business logic\r\n\r\nI'm ok with that changing but just double checking that this change is on purpose and will be the same across all resources as we add update methods to them","created_at":"2018-10-10T12:19:17Z","updated_at":"2018-10-10T12:19:17Z","html_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/106#discussion_r224051417","pull_request_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/106","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/comments/224051417"},"html":{"href":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/106#discussion_r224051417"},"pull_request":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/106"}}},"pull_request":{"url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/106","id":221751452,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNzUxNDUy","html_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/106","diff_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/106.diff","patch_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/106.patch","issue_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/106","number":106,"state":"open","locked":false,"title":"Adding HttpStatus PUT endpoint for the current period.","user":{"login":"sroberts2","id":33425071,"node_id":"MDQ6VXNlcjMzNDI1MDcx","avatar_url":"https://avatars1.githubusercontent.com/u/33425071?v=4","gravatar_id":"","url":"https://api.github.com/users/sroberts2","html_url":"https://github.com/sroberts2","followers_url":"https://api.github.com/users/sroberts2/followers","following_url":"https://api.github.com/users/sroberts2/following{/other_user}","gists_url":"https://api.github.com/users/sroberts2/gists{/gist_id}","starred_url":"https://api.github.com/users/sroberts2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroberts2/subscriptions","organizations_url":"https://api.github.com/users/sroberts2/orgs","repos_url":"https://api.github.com/users/sroberts2/repos","events_url":"https://api.github.com/users/sroberts2/events{/privacy}","received_events_url":"https://api.github.com/users/sroberts2/received_events","type":"User","site_admin":false},"body":"Added the update method logic to the `CurrentPeriodService` .\r\nAdded the above method to the `ResourceService` interface class.\r\nAdded the PUT mapping for the Current Period controller.\r\nAdded the stubs for the other Service layer objects to allow the Java to compile.\r\nAdded the relevant unit tests.\r\n","created_at":"2018-10-10T11:21:15Z","updated_at":"2018-10-10T12:19:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b714cc07db36665986bd750bf2805cdfddd9250","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/106/commits","review_comments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/106/comments","review_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/106/comments","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/statuses/92ca62620f335c7b81cc12f0f53905be3434fe50","head":{"label":"companieshouse:feature/add-put-endpoint-for-current-period","ref":"feature/add-put-endpoint-for-current-period","sha":"92ca62620f335c7b81cc12f0f53905be3434fe50","user":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"repo":{"id":137176372,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxNzYzNzI=","name":"company-accounts.api.ch.gov.uk","full_name":"companieshouse/company-accounts.api.ch.gov.uk","private":false,"owner":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk","description":"The Companies House API for handling company accounts","fork":false,"url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk","forks_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/forks","keys_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/teams","hooks_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/hooks","issue_events_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/events{/number}","events_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/events","assignees_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/assignees{/user}","branches_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/branches{/branch}","tags_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/tags","blobs_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/refs{/sha}","trees_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/statuses/{sha}","languages_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/languages","stargazers_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/stargazers","contributors_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/contributors","subscribers_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/subscribers","subscription_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/subscription","commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/commits{/sha}","git_commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/commits{/sha}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/comments{/number}","issue_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/comments{/number}","contents_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/contents/{+path}","compare_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/merges","archive_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/downloads","issues_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues{/number}","pulls_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls{/number}","milestones_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/milestones{/number}","notifications_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/labels{/name}","releases_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/releases{/id}","deployments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/deployments","created_at":"2018-06-13T07:06:55Z","updated_at":"2018-10-10T10:56:27Z","pushed_at":"2018-10-10T12:15:53Z","git_url":"git://github.com/companieshouse/company-accounts.api.ch.gov.uk.git","ssh_url":"git@github.com:companieshouse/company-accounts.api.ch.gov.uk.git","clone_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk.git","svn_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk","homepage":null,"size":1010,"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":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":5,"watchers":0,"default_branch":"develop"}},"base":{"label":"companieshouse:develop","ref":"develop","sha":"2ca0136b832efb28a4563eb7927bb848c9a0deee","user":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"repo":{"id":137176372,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxNzYzNzI=","name":"company-accounts.api.ch.gov.uk","full_name":"companieshouse/company-accounts.api.ch.gov.uk","private":false,"owner":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk","description":"The Companies House API for handling company accounts","fork":false,"url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk","forks_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/forks","keys_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/teams","hooks_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/hooks","issue_events_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/events{/number}","events_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/events","assignees_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/assignees{/user}","branches_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/branches{/branch}","tags_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/tags","blobs_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/refs{/sha}","trees_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/statuses/{sha}","languages_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/languages","stargazers_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/stargazers","contributors_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/contributors","subscribers_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/subscribers","subscription_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/subscription","commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/commits{/sha}","git_commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/commits{/sha}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/comments{/number}","issue_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/comments{/number}","contents_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/contents/{+path}","compare_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/merges","archive_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/downloads","issues_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues{/number}","pulls_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls{/number}","milestones_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/milestones{/number}","notifications_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/labels{/name}","releases_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/releases{/id}","deployments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/deployments","created_at":"2018-06-13T07:06:55Z","updated_at":"2018-10-10T10:56:27Z","pushed_at":"2018-10-10T12:15:53Z","git_url":"git://github.com/companieshouse/company-accounts.api.ch.gov.uk.git","ssh_url":"git@github.com:companieshouse/company-accounts.api.ch.gov.uk.git","clone_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk.git","svn_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk","homepage":null,"size":1010,"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":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":5,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/106"},"html":{"href":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/106"},"issue":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/106"},"comments":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/106/comments"},"review_comments":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/106/comments"},"review_comment":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/106/commits"},"statuses":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/statuses/92ca62620f335c7b81cc12f0f53905be3434fe50"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"macreman"}}