{"action":"created","comment":{"url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/comments/223002794","pull_request_review_id":162030476,"id":223002794,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzAwMjc5NA==","diff_hunk":"@@ -0,0 +1,67 @@\n+package uk.gov.hmcts.reform.coh.controller;\n+\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.http.HttpStatus;\n+import org.springframework.http.MediaType;\n+import org.springframework.http.ResponseEntity;\n+import org.springframework.web.bind.annotation.GetMapping;\n+import org.springframework.web.bind.annotation.PathVariable;\n+import org.springframework.web.bind.annotation.PostMapping;\n+import org.springframework.web.bind.annotation.RequestBody;\n+import org.springframework.web.bind.annotation.RequestMapping;\n+import org.springframework.web.bind.annotation.RestController;\n+import uk.gov.hmcts.reform.coh.controller.onlinehearing.Relisting;\n+import uk.gov.hmcts.reform.coh.domain.OnlineHearing;\n+import uk.gov.hmcts.reform.coh.domain.RelistingState;\n+import uk.gov.hmcts.reform.coh.service.OnlineHearingService;\n+\n+import java.util.Optional;\n+import java.util.UUID;\n+import javax.validation.Valid;\n+\n+@RestController\n+@RequestMapping(\n+    value = \"/continuous-online-hearings/{onlineHearingId}/relist\",\n+    produces = MediaType.APPLICATION_JSON_VALUE\n+)\n+public class RelistingController {\n+\n+    @Autowired\n+    private OnlineHearingService onlineHearingService;\n+\n+    @GetMapping\n+    public ResponseEntity retrieveRelisting(@PathVariable UUID onlineHearingId) {\n+        Optional<OnlineHearing> optionalOnlineHearing = onlineHearingService.retrieveOnlineHearing(onlineHearingId);\n+        if (!optionalOnlineHearing.isPresent()) {\n+            return ResponseEntity.status(HttpStatus.NOT_FOUND).body(\"Not found\");\n+        }\n+        OnlineHearing onlineHearing = optionalOnlineHearing.get();\n+        String reason = onlineHearing.getRelistReason();\n+        RelistingState state = onlineHearing.getRelistState();\n+        Relisting relisting = new Relisting(reason, state);\n+        return ResponseEntity.ok(relisting);\n+    }\n+\n+    @PostMapping\n+    public ResponseEntity createDraft(\n+        @PathVariable UUID onlineHearingId,\n+        @RequestBody @Valid Relisting body\n+    ) {\n+        Optional<OnlineHearing> optionalOnlineHearing = onlineHearingService.retrieveOnlineHearing(onlineHearingId);\n+        if (!optionalOnlineHearing.isPresent()) {\n+            return ResponseEntity.status(HttpStatus.NOT_FOUND).body(\"Not found\");\n+        }\n+\n+        OnlineHearing onlineHearing = optionalOnlineHearing.get();\n+\n+        if (onlineHearing.getRelistState() == RelistingState.ISSUED) {\n+            return ResponseEntity.status(HttpStatus.CONFLICT).body(\"Already issued\");\n+        }\n+","path":"src/main/java/uk/gov/hmcts/reform/coh/controller/RelistingController.java","position":116,"original_position":60,"commit_id":"a88162157ae9d27e307187ea02c989906df7037d","original_commit_id":"1b753491b384f1601cc78ad95f09797c3dd94265","user":{"login":"KarolJastrzebski","id":5228657,"node_id":"MDQ6VXNlcjUyMjg2NTc=","avatar_url":"https://avatars2.githubusercontent.com/u/5228657?v=4","gravatar_id":"","url":"https://api.github.com/users/KarolJastrzebski","html_url":"https://github.com/KarolJastrzebski","followers_url":"https://api.github.com/users/KarolJastrzebski/followers","following_url":"https://api.github.com/users/KarolJastrzebski/following{/other_user}","gists_url":"https://api.github.com/users/KarolJastrzebski/gists{/gist_id}","starred_url":"https://api.github.com/users/KarolJastrzebski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarolJastrzebski/subscriptions","organizations_url":"https://api.github.com/users/KarolJastrzebski/orgs","repos_url":"https://api.github.com/users/KarolJastrzebski/repos","events_url":"https://api.github.com/users/KarolJastrzebski/events{/privacy}","received_events_url":"https://api.github.com/users/KarolJastrzebski/received_events","type":"User","site_admin":false},"body":"- `ISSUE_PENDING` state has been implemented so that re-listing will be issued only after successful delivery of the notification.\r\n- Setting directly online hearing as re-listed when updating is now removed.\r\n- Both fields `created` and `updated` are added.","created_at":"2018-10-05T13:20:30Z","updated_at":"2018-10-05T13:20:30Z","html_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution/pull/220#discussion_r223002794","pull_request_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/220","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/comments/223002794"},"html":{"href":"https://github.com/hmcts/rpa-coh-continuous-online-resolution/pull/220#discussion_r223002794"},"pull_request":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/220"}},"in_reply_to_id":221647372},"pull_request":{"url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/220","id":219405463,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5NDA1NDYz","html_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution/pull/220","diff_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution/pull/220.diff","patch_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution/pull/220.patch","issue_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues/220","number":220,"state":"open","locked":false,"title":"Coh 155 draft relisting","user":{"login":"johnhosolirius","id":38843249,"node_id":"MDQ6VXNlcjM4ODQzMjQ5","avatar_url":"https://avatars0.githubusercontent.com/u/38843249?v=4","gravatar_id":"","url":"https://api.github.com/users/johnhosolirius","html_url":"https://github.com/johnhosolirius","followers_url":"https://api.github.com/users/johnhosolirius/followers","following_url":"https://api.github.com/users/johnhosolirius/following{/other_user}","gists_url":"https://api.github.com/users/johnhosolirius/gists{/gist_id}","starred_url":"https://api.github.com/users/johnhosolirius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnhosolirius/subscriptions","organizations_url":"https://api.github.com/users/johnhosolirius/orgs","repos_url":"https://api.github.com/users/johnhosolirius/repos","events_url":"https://api.github.com/users/johnhosolirius/events{/privacy}","received_events_url":"https://api.github.com/users/johnhosolirius/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-01T14:52:30Z","updated_at":"2018-10-05T13:20:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f77e7be135a4f44243cb0b4ba0ad3b074439748","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/220/commits","review_comments_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/220/comments","review_comment_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues/220/comments","statuses_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/statuses/a88162157ae9d27e307187ea02c989906df7037d","head":{"label":"hmcts:COH-155-draft-relisting","ref":"COH-155-draft-relisting","sha":"a88162157ae9d27e307187ea02c989906df7037d","user":{"login":"hmcts","id":22817111,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyODE3MTEx","avatar_url":"https://avatars1.githubusercontent.com/u/22817111?v=4","gravatar_id":"","url":"https://api.github.com/users/hmcts","html_url":"https://github.com/hmcts","followers_url":"https://api.github.com/users/hmcts/followers","following_url":"https://api.github.com/users/hmcts/following{/other_user}","gists_url":"https://api.github.com/users/hmcts/gists{/gist_id}","starred_url":"https://api.github.com/users/hmcts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmcts/subscriptions","organizations_url":"https://api.github.com/users/hmcts/orgs","repos_url":"https://api.github.com/users/hmcts/repos","events_url":"https://api.github.com/users/hmcts/events{/privacy}","received_events_url":"https://api.github.com/users/hmcts/received_events","type":"Organization","site_admin":false},"repo":{"id":133522662,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM1MjI2NjI=","name":"rpa-coh-continuous-online-resolution","full_name":"hmcts/rpa-coh-continuous-online-resolution","private":false,"owner":{"login":"hmcts","id":22817111,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyODE3MTEx","avatar_url":"https://avatars1.githubusercontent.com/u/22817111?v=4","gravatar_id":"","url":"https://api.github.com/users/hmcts","html_url":"https://github.com/hmcts","followers_url":"https://api.github.com/users/hmcts/followers","following_url":"https://api.github.com/users/hmcts/following{/other_user}","gists_url":"https://api.github.com/users/hmcts/gists{/gist_id}","starred_url":"https://api.github.com/users/hmcts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmcts/subscriptions","organizations_url":"https://api.github.com/users/hmcts/orgs","repos_url":"https://api.github.com/users/hmcts/repos","events_url":"https://api.github.com/users/hmcts/events{/privacy}","received_events_url":"https://api.github.com/users/hmcts/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution","description":null,"fork":false,"url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution","forks_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/forks","keys_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/teams","hooks_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/hooks","issue_events_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/events","assignees_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/tags","blobs_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/languages","stargazers_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/stargazers","contributors_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/contributors","subscribers_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/subscribers","subscription_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/subscription","commits_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/merges","archive_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/downloads","issues_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/deployments","created_at":"2018-05-15T13:46:31Z","updated_at":"2018-10-04T11:34:13Z","pushed_at":"2018-10-05T13:16:56Z","git_url":"git://github.com/hmcts/rpa-coh-continuous-online-resolution.git","ssh_url":"git@github.com:hmcts/rpa-coh-continuous-online-resolution.git","clone_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution.git","svn_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution","homepage":null,"size":2528,"stargazers_count":2,"watchers_count":2,"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":2,"license":null,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"hmcts:master","ref":"master","sha":"0cdcbc293543b83f60f4d16ac0dbba578152d34b","user":{"login":"hmcts","id":22817111,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyODE3MTEx","avatar_url":"https://avatars1.githubusercontent.com/u/22817111?v=4","gravatar_id":"","url":"https://api.github.com/users/hmcts","html_url":"https://github.com/hmcts","followers_url":"https://api.github.com/users/hmcts/followers","following_url":"https://api.github.com/users/hmcts/following{/other_user}","gists_url":"https://api.github.com/users/hmcts/gists{/gist_id}","starred_url":"https://api.github.com/users/hmcts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmcts/subscriptions","organizations_url":"https://api.github.com/users/hmcts/orgs","repos_url":"https://api.github.com/users/hmcts/repos","events_url":"https://api.github.com/users/hmcts/events{/privacy}","received_events_url":"https://api.github.com/users/hmcts/received_events","type":"Organization","site_admin":false},"repo":{"id":133522662,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM1MjI2NjI=","name":"rpa-coh-continuous-online-resolution","full_name":"hmcts/rpa-coh-continuous-online-resolution","private":false,"owner":{"login":"hmcts","id":22817111,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyODE3MTEx","avatar_url":"https://avatars1.githubusercontent.com/u/22817111?v=4","gravatar_id":"","url":"https://api.github.com/users/hmcts","html_url":"https://github.com/hmcts","followers_url":"https://api.github.com/users/hmcts/followers","following_url":"https://api.github.com/users/hmcts/following{/other_user}","gists_url":"https://api.github.com/users/hmcts/gists{/gist_id}","starred_url":"https://api.github.com/users/hmcts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmcts/subscriptions","organizations_url":"https://api.github.com/users/hmcts/orgs","repos_url":"https://api.github.com/users/hmcts/repos","events_url":"https://api.github.com/users/hmcts/events{/privacy}","received_events_url":"https://api.github.com/users/hmcts/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution","description":null,"fork":false,"url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution","forks_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/forks","keys_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/teams","hooks_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/hooks","issue_events_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/events","assignees_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/tags","blobs_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/languages","stargazers_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/stargazers","contributors_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/contributors","subscribers_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/subscribers","subscription_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/subscription","commits_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/merges","archive_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/downloads","issues_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/deployments","created_at":"2018-05-15T13:46:31Z","updated_at":"2018-10-04T11:34:13Z","pushed_at":"2018-10-05T13:16:56Z","git_url":"git://github.com/hmcts/rpa-coh-continuous-online-resolution.git","ssh_url":"git@github.com:hmcts/rpa-coh-continuous-online-resolution.git","clone_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution.git","svn_url":"https://github.com/hmcts/rpa-coh-continuous-online-resolution","homepage":null,"size":2528,"stargazers_count":2,"watchers_count":2,"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":2,"license":null,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/220"},"html":{"href":"https://github.com/hmcts/rpa-coh-continuous-online-resolution/pull/220"},"issue":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues/220"},"comments":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/issues/220/comments"},"review_comments":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/220/comments"},"review_comment":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/pulls/220/commits"},"statuses":{"href":"https://api.github.com/repos/hmcts/rpa-coh-continuous-online-resolution/statuses/a88162157ae9d27e307187ea02c989906df7037d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"KarolJastrzebski"}}