{"action":"created","comment":{"url":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/comments/201213710","pull_request_review_id":135669960,"id":201213710,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTIxMzcxMA==","diff_hunk":"@@ -0,0 +1,50 @@\n+package uk.gov.hmcts.reform.bulkscanprocessor.tasks.processor;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.stereotype.Component;\n+import org.springframework.transaction.annotation.Transactional;\n+import uk.gov.hmcts.reform.bulkscanprocessor.entity.ScannableItem;\n+import uk.gov.hmcts.reform.bulkscanprocessor.entity.ScannableItemRepository;\n+import uk.gov.hmcts.reform.bulkscanprocessor.exceptions.DocumentNotFoundException;\n+import uk.gov.hmcts.reform.bulkscanprocessor.services.document.DocumentManagementService;\n+import uk.gov.hmcts.reform.bulkscanprocessor.services.document.output.Pdf;\n+\n+import java.util.List;\n+import java.util.Map;\n+\n+@Component\n+public class DocumentProcessor {\n+\n+    private final DocumentManagementService documentManagementService;\n+    private final ScannableItemRepository scannableItemRepository;\n+\n+    private static final Logger log = LoggerFactory.getLogger(DocumentProcessor.class);\n+\n+    public DocumentProcessor(\n+        DocumentManagementService documentManagementService,\n+        ScannableItemRepository scannableItemRepository\n+    ) {\n+        this.documentManagementService = documentManagementService;\n+        this.scannableItemRepository = scannableItemRepository;\n+    }\n+\n+    @Transactional\n+    public void processPdfFiles(List<Pdf> pdfs, List<ScannableItem> scannedItems) {\n+        // TODO check scannedItems.size == pdfFiles.size\n+\n+        Map<String, String> response = documentManagementService.uploadDocuments(pdfs);\n+\n+        log.info(\"Document service response with file name and doc url {}\", response);","path":"src/main/java/uk/gov/hmcts/reform/bulkscanprocessor/tasks/processor/DocumentProcessor.java","position":38,"original_position":38,"commit_id":"bcf5ff9b7dfa80b1475439f1614320918b7d0150","original_commit_id":"bcf5ff9b7dfa80b1475439f1614320918b7d0150","user":{"login":"nitinprabhu","id":13840402,"node_id":"MDQ6VXNlcjEzODQwNDAy","avatar_url":"https://avatars1.githubusercontent.com/u/13840402?v=4","gravatar_id":"","url":"https://api.github.com/users/nitinprabhu","html_url":"https://github.com/nitinprabhu","followers_url":"https://api.github.com/users/nitinprabhu/followers","following_url":"https://api.github.com/users/nitinprabhu/following{/other_user}","gists_url":"https://api.github.com/users/nitinprabhu/gists{/gist_id}","starred_url":"https://api.github.com/users/nitinprabhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitinprabhu/subscriptions","organizations_url":"https://api.github.com/users/nitinprabhu/orgs","repos_url":"https://api.github.com/users/nitinprabhu/repos","events_url":"https://api.github.com/users/nitinprabhu/events{/privacy}","received_events_url":"https://api.github.com/users/nitinprabhu/received_events","type":"User","site_admin":false},"body":"It won't be logged into app insights if we change it to debug.","created_at":"2018-07-10T04:23:10Z","updated_at":"2018-07-10T04:23:10Z","html_url":"https://github.com/hmcts/bulk-scan-processor/pull/36#discussion_r201213710","pull_request_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/36","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/comments/201213710"},"html":{"href":"https://github.com/hmcts/bulk-scan-processor/pull/36#discussion_r201213710"},"pull_request":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/36"}},"in_reply_to_id":201155059},"pull_request":{"url":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/36","id":200115058,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMTE1MDU4","html_url":"https://github.com/hmcts/bulk-scan-processor/pull/36","diff_url":"https://github.com/hmcts/bulk-scan-processor/pull/36.diff","patch_url":"https://github.com/hmcts/bulk-scan-processor/pull/36.patch","issue_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues/36","number":36,"state":"open","locked":false,"title":"Bug fix and refactoring","user":{"login":"nitinprabhu","id":13840402,"node_id":"MDQ6VXNlcjEzODQwNDAy","avatar_url":"https://avatars1.githubusercontent.com/u/13840402?v=4","gravatar_id":"","url":"https://api.github.com/users/nitinprabhu","html_url":"https://github.com/nitinprabhu","followers_url":"https://api.github.com/users/nitinprabhu/followers","following_url":"https://api.github.com/users/nitinprabhu/following{/other_user}","gists_url":"https://api.github.com/users/nitinprabhu/gists{/gist_id}","starred_url":"https://api.github.com/users/nitinprabhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitinprabhu/subscriptions","organizations_url":"https://api.github.com/users/nitinprabhu/orgs","repos_url":"https://api.github.com/users/nitinprabhu/repos","events_url":"https://api.github.com/users/nitinprabhu/events{/privacy}","received_events_url":"https://api.github.com/users/nitinprabhu/received_events","type":"User","site_admin":false},"body":"### JIRA link (if applicable) ###\r\n\r\nhttps://tools.hmcts.net/jira/browse/RPE-574\r\n\r\n### Change description ###\r\n\r\n- Fix document parsing issue.\r\n\r\n- Extracted document processing to a different class.\r\n\r\n- Updated integration test cases.\r\n\r\n- Added Enable Scheduling annotation.\r\n\r\n\r\n**Does this PR introduce a breaking change?** (check one with \"x\")\r\n\r\n```\r\n[ ] Yes\r\n[ x] No\r\n```","created_at":"2018-07-09T14:19:47Z","updated_at":"2018-07-10T04:23:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e66b7431f2ebfd432985459d742e93067e219aa4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/36/commits","review_comments_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/36/comments","review_comment_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues/36/comments","statuses_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/statuses/bcf5ff9b7dfa80b1475439f1614320918b7d0150","head":{"label":"hmcts:BUG-FIX-AND-REFACTORING","ref":"BUG-FIX-AND-REFACTORING","sha":"bcf5ff9b7dfa80b1475439f1614320918b7d0150","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":133028120,"node_id":"MDEwOlJlcG9zaXRvcnkxMzMwMjgxMjA=","name":"bulk-scan-processor","full_name":"hmcts/bulk-scan-processor","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},"private":false,"html_url":"https://github.com/hmcts/bulk-scan-processor","description":null,"fork":false,"url":"https://api.github.com/repos/hmcts/bulk-scan-processor","forks_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/forks","keys_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/teams","hooks_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/hooks","issue_events_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/events","assignees_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/tags","blobs_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/languages","stargazers_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/stargazers","contributors_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/contributors","subscribers_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/subscribers","subscription_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/subscription","commits_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/merges","archive_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/downloads","issues_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/deployments","created_at":"2018-05-11T10:51:58Z","updated_at":"2018-07-09T14:41:33Z","pushed_at":"2018-07-09T20:25:23Z","git_url":"git://github.com/hmcts/bulk-scan-processor.git","ssh_url":"git@github.com:hmcts/bulk-scan-processor.git","clone_url":"https://github.com/hmcts/bulk-scan-processor.git","svn_url":"https://github.com/hmcts/bulk-scan-processor","homepage":null,"size":1175,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"hmcts:master","ref":"master","sha":"6b4fd7317fabea0581697414d09f6c37baaf5b05","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":133028120,"node_id":"MDEwOlJlcG9zaXRvcnkxMzMwMjgxMjA=","name":"bulk-scan-processor","full_name":"hmcts/bulk-scan-processor","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},"private":false,"html_url":"https://github.com/hmcts/bulk-scan-processor","description":null,"fork":false,"url":"https://api.github.com/repos/hmcts/bulk-scan-processor","forks_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/forks","keys_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/teams","hooks_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/hooks","issue_events_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/events","assignees_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/tags","blobs_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/languages","stargazers_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/stargazers","contributors_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/contributors","subscribers_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/subscribers","subscription_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/subscription","commits_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/merges","archive_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/downloads","issues_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/bulk-scan-processor/deployments","created_at":"2018-05-11T10:51:58Z","updated_at":"2018-07-09T14:41:33Z","pushed_at":"2018-07-09T20:25:23Z","git_url":"git://github.com/hmcts/bulk-scan-processor.git","ssh_url":"git@github.com:hmcts/bulk-scan-processor.git","clone_url":"https://github.com/hmcts/bulk-scan-processor.git","svn_url":"https://github.com/hmcts/bulk-scan-processor","homepage":null,"size":1175,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/36"},"html":{"href":"https://github.com/hmcts/bulk-scan-processor/pull/36"},"issue":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues/36"},"comments":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/hmcts/bulk-scan-processor/statuses/bcf5ff9b7dfa80b1475439f1614320918b7d0150"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nitinprabhu"}}