{"action":"created","comment":{"url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/comments/228224484","pull_request_review_id":168448046,"id":228224484,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODIyNDQ4NA==","diff_hunk":"@@ -0,0 +1,51 @@\n+package uk.gov.hmcts.reform.bulkscan.orchestrator.services.ccd;\n+\n+import io.vavr.Value;\n+import io.vavr.control.Validation;\n+import org.jetbrains.annotations.NotNull;\n+import org.springframework.stereotype.Service;\n+import uk.gov.hmcts.reform.ccd.client.model.CaseDetails;\n+\n+import java.util.List;\n+\n+import static io.vavr.control.Validation.invalid;\n+import static io.vavr.control.Validation.valid;\n+import static java.lang.String.format;\n+import static java.util.Collections.emptyList;\n+import static uk.gov.hmcts.reform.ccd.client.model.CallbackTypes.ABOUT_TO_SUBMIT;\n+\n+@Service\n+public class CallbackProcessorImpl implements CallbackProcessor {\n+\n+    @Override\n+    public List<String> process(String type, String eventId, CaseDetails caseDetails) {\n+        return Validation\n+            .combine(\n+                isAttachEvent(type),\n+                isAboutToStart(eventId)\n+            )\n+            .ap((aType, anEventId) -> attach(caseDetails))\n+            .getOrElseGet(Value::toJavaList);\n+    }\n+\n+    private List<String> attach(CaseDetails caseDetails) {\n+        return emptyList();\n+    }\n+\n+    private Validation<String, String> isAboutToStart(String eventId) {\n+        return ABOUT_TO_SUBMIT.equals(eventId)","path":"src/main/java/uk/gov/hmcts/reform/bulkscan/orchestrator/services/ccd/CallbackProcessorImpl.java","position":36,"original_position":36,"commit_id":"bfa98f35ed9cf7fa06426edede2450dedf61876a","original_commit_id":"db497ca3f1f0148f7c4bb2caf18e341078ada78f","user":{"login":"KevinJCross","id":7290403,"node_id":"MDQ6VXNlcjcyOTA0MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/7290403?v=4","gravatar_id":"","url":"https://api.github.com/users/KevinJCross","html_url":"https://github.com/KevinJCross","followers_url":"https://api.github.com/users/KevinJCross/followers","following_url":"https://api.github.com/users/KevinJCross/following{/other_user}","gists_url":"https://api.github.com/users/KevinJCross/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinJCross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinJCross/subscriptions","organizations_url":"https://api.github.com/users/KevinJCross/orgs","repos_url":"https://api.github.com/users/KevinJCross/repos","events_url":"https://api.github.com/users/KevinJCross/events{/privacy}","received_events_url":"https://api.github.com/users/KevinJCross/received_events","type":"User","site_admin":false},"body":"about to submit ... this is the sync bit ... at least thats what was in the spike code.","created_at":"2018-10-25T15:33:14Z","updated_at":"2018-10-25T15:33:14Z","html_url":"https://github.com/hmcts/bulk-scan-orchestrator/pull/109#discussion_r228224484","pull_request_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/109","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/comments/228224484"},"html":{"href":"https://github.com/hmcts/bulk-scan-orchestrator/pull/109#discussion_r228224484"},"pull_request":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/109"}},"in_reply_to_id":228218782},"pull_request":{"url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/109","id":225799408,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1Nzk5NDA4","html_url":"https://github.com/hmcts/bulk-scan-orchestrator/pull/109","diff_url":"https://github.com/hmcts/bulk-scan-orchestrator/pull/109.diff","patch_url":"https://github.com/hmcts/bulk-scan-orchestrator/pull/109.patch","issue_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues/109","number":109,"state":"open","locked":false,"title":"REP-670#4 Introduction of vavr Validation ","user":{"login":"KevinJCross","id":7290403,"node_id":"MDQ6VXNlcjcyOTA0MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/7290403?v=4","gravatar_id":"","url":"https://api.github.com/users/KevinJCross","html_url":"https://github.com/KevinJCross","followers_url":"https://api.github.com/users/KevinJCross/followers","following_url":"https://api.github.com/users/KevinJCross/following{/other_user}","gists_url":"https://api.github.com/users/KevinJCross/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinJCross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinJCross/subscriptions","organizations_url":"https://api.github.com/users/KevinJCross/orgs","repos_url":"https://api.github.com/users/KevinJCross/repos","events_url":"https://api.github.com/users/KevinJCross/events{/privacy}","received_events_url":"https://api.github.com/users/KevinJCross/received_events","type":"User","site_admin":false},"body":"### JIRA link (if applicable) ###\r\nRPE-670\r\n\r\n### Change description ###\r\n*Discussion point*\r\nIs this ok ... ?\r\nIntroducing vavr validator to simply add more strings to the error list.\r\n","created_at":"2018-10-25T15:12:40Z","updated_at":"2018-10-25T15:33:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5ee4fd65b8eeaae549d6af72b4681185afff043","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/109/commits","review_comments_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/109/comments","review_comment_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues/109/comments","statuses_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/statuses/bfa98f35ed9cf7fa06426edede2450dedf61876a","head":{"label":"hmcts:feature/RPE-670#4_introduction_vavr","ref":"feature/RPE-670#4_introduction_vavr","sha":"bfa98f35ed9cf7fa06426edede2450dedf61876a","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":145695191,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU2OTUxOTE=","name":"bulk-scan-orchestrator","full_name":"hmcts/bulk-scan-orchestrator","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/bulk-scan-orchestrator","description":null,"fork":false,"url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator","forks_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/forks","keys_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/teams","hooks_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/hooks","issue_events_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/events","assignees_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/tags","blobs_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/languages","stargazers_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/stargazers","contributors_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/contributors","subscribers_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/subscribers","subscription_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/subscription","commits_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/merges","archive_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/downloads","issues_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/deployments","created_at":"2018-08-22T10:43:53Z","updated_at":"2018-10-25T13:43:54Z","pushed_at":"2018-10-25T15:28:14Z","git_url":"git://github.com/hmcts/bulk-scan-orchestrator.git","ssh_url":"git@github.com:hmcts/bulk-scan-orchestrator.git","clone_url":"https://github.com/hmcts/bulk-scan-orchestrator.git","svn_url":"https://github.com/hmcts/bulk-scan-orchestrator","homepage":null,"size":1343,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"hmcts:master","ref":"master","sha":"ae396fce83f06b286e4c496e121ae1b269c7a4e8","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":145695191,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU2OTUxOTE=","name":"bulk-scan-orchestrator","full_name":"hmcts/bulk-scan-orchestrator","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/bulk-scan-orchestrator","description":null,"fork":false,"url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator","forks_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/forks","keys_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/teams","hooks_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/hooks","issue_events_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/events","assignees_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/tags","blobs_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/languages","stargazers_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/stargazers","contributors_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/contributors","subscribers_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/subscribers","subscription_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/subscription","commits_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/merges","archive_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/downloads","issues_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/deployments","created_at":"2018-08-22T10:43:53Z","updated_at":"2018-10-25T13:43:54Z","pushed_at":"2018-10-25T15:28:14Z","git_url":"git://github.com/hmcts/bulk-scan-orchestrator.git","ssh_url":"git@github.com:hmcts/bulk-scan-orchestrator.git","clone_url":"https://github.com/hmcts/bulk-scan-orchestrator.git","svn_url":"https://github.com/hmcts/bulk-scan-orchestrator","homepage":null,"size":1343,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/109"},"html":{"href":"https://github.com/hmcts/bulk-scan-orchestrator/pull/109"},"issue":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues/109"},"comments":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/hmcts/bulk-scan-orchestrator/statuses/bfa98f35ed9cf7fa06426edede2450dedf61876a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"KevinJCross"}}