{"action":"created","comment":{"url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/comments/213343780","pull_request_review_id":150159564,"id":213343780,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzM0Mzc4MA==","diff_hunk":"@@ -180,15 +183,36 @@ class AssuranceCollectionsController @Inject()(@Named(\"auth.stride.enrolment\") s\n         AssuranceCollectionsController.cdForm.bindFromRequest().fold(\n           _ => Future.failed(throw new BadRequestException(\"Invalid delete submission\"))\n           , form => {\n-            agentAssuranceConnector.deleteAgentDetails(verifiedCollectionName, form.utr).map {_ =>\n+            agentAssuranceConnector.deleteAgentDetails(verifiedCollectionName, form.utr).map { _ =>\n               auditService.sendAgentAssurancePropertyDeletedEvent(form.utr, verifiedCollectionName, form.businessName)\n-              Ok(deleted_agent(form.utr.value, form.businessName, verifiedCollectionName)) }\n+              Ok(deleted_agent(form.utr.value, form.businessName, verifiedCollectionName))\n+            }\n           }\n         )\n       }\n     }\n   }\n \n+  def searchForUtr(collectionName: String) = Action.async { implicit request =>\n+    withCollectionName(collectionName) { verifiedCollectionName =>\n+      authorisedWithStrideEnrolment(strideIdentifier) { implicit strideUser =>\n+        AssuranceCollectionsController.utrForm.bindFromRequest().fold(\n+          formWithErrors => Future successful Ok(view_collection(formWithErrors, Map.empty[Utr, String], verifiedCollectionName, None, None))\n+          , form =>\n+\n+            for {\n+              ifExistsAndWhere <- existsInCollection(form.utr)","path":"app/uk/gov/hmrc/agentassurancefrontend/controllers/AssuranceCollectionsController.scala","position":98,"original_position":98,"commit_id":"e0db6dae318429166153fab8c0729c8e24bb1862","original_commit_id":"e0db6dae318429166153fab8c0729c8e24bb1862","user":{"login":"johnrevill","id":9166352,"node_id":"MDQ6VXNlcjkxNjYzNTI=","avatar_url":"https://avatars3.githubusercontent.com/u/9166352?v=4","gravatar_id":"","url":"https://api.github.com/users/johnrevill","html_url":"https://github.com/johnrevill","followers_url":"https://api.github.com/users/johnrevill/followers","following_url":"https://api.github.com/users/johnrevill/following{/other_user}","gists_url":"https://api.github.com/users/johnrevill/gists{/gist_id}","starred_url":"https://api.github.com/users/johnrevill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnrevill/subscriptions","organizations_url":"https://api.github.com/users/johnrevill/orgs","repos_url":"https://api.github.com/users/johnrevill/repos","events_url":"https://api.github.com/users/johnrevill/events{/privacy}","received_events_url":"https://api.github.com/users/johnrevill/received_events","type":"User","site_admin":false},"body":"Could consider using something like:\r\n```(isUtrFound, foundInCollectionNameOpt) <- existsInCollection(form.utr)```\r\n(but with better names).\r\nThis would lend some names to the tuples' `._1` and `._2` used later.","created_at":"2018-08-28T14:44:25Z","updated_at":"2018-08-28T14:44:25Z","html_url":"https://github.com/hmrc/agent-assurance-frontend/pull/33#discussion_r213343780","pull_request_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/33","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/comments/213343780"},"html":{"href":"https://github.com/hmrc/agent-assurance-frontend/pull/33#discussion_r213343780"},"pull_request":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/33","id":211429442,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNDI5NDQy","html_url":"https://github.com/hmrc/agent-assurance-frontend/pull/33","diff_url":"https://github.com/hmrc/agent-assurance-frontend/pull/33.diff","patch_url":"https://github.com/hmrc/agent-assurance-frontend/pull/33.patch","issue_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues/33","number":33,"state":"open","locked":false,"title":"[ASA-45][AK] searchBox for exists in manually-assured collection","user":{"login":"arkowalski","id":31273784,"node_id":"MDQ6VXNlcjMxMjczNzg0","avatar_url":"https://avatars0.githubusercontent.com/u/31273784?v=4","gravatar_id":"","url":"https://api.github.com/users/arkowalski","html_url":"https://github.com/arkowalski","followers_url":"https://api.github.com/users/arkowalski/followers","following_url":"https://api.github.com/users/arkowalski/following{/other_user}","gists_url":"https://api.github.com/users/arkowalski/gists{/gist_id}","starred_url":"https://api.github.com/users/arkowalski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkowalski/subscriptions","organizations_url":"https://api.github.com/users/arkowalski/orgs","repos_url":"https://api.github.com/users/arkowalski/repos","events_url":"https://api.github.com/users/arkowalski/events{/privacy}","received_events_url":"https://api.github.com/users/arkowalski/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-28T13:48:33Z","updated_at":"2018-08-28T14:44:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f26c8ac8756bda2255a951a3f4187ba9c61cb8fe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/33/commits","review_comments_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/33/comments","review_comment_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues/33/comments","statuses_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/statuses/e0db6dae318429166153fab8c0729c8e24bb1862","head":{"label":"hmrc:ASA-45","ref":"ASA-45","sha":"e0db6dae318429166153fab8c0729c8e24bb1862","user":{"login":"hmrc","id":5755339,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3NTUzMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5755339?v=4","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"repo":{"id":130338808,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAzMzg4MDg=","name":"agent-assurance-frontend","full_name":"hmrc/agent-assurance-frontend","owner":{"login":"hmrc","id":5755339,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3NTUzMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5755339?v=4","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmrc/agent-assurance-frontend","description":null,"fork":false,"url":"https://api.github.com/repos/hmrc/agent-assurance-frontend","forks_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/forks","keys_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/teams","hooks_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/hooks","issue_events_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/events","assignees_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/tags","blobs_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/languages","stargazers_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/stargazers","contributors_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/contributors","subscribers_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/subscribers","subscription_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/subscription","commits_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/merges","archive_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/downloads","issues_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/labels{/name}","releases_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/deployments","created_at":"2018-04-20T09:13:16Z","updated_at":"2018-08-23T15:31:44Z","pushed_at":"2018-08-28T13:48:34Z","git_url":"git://github.com/hmrc/agent-assurance-frontend.git","ssh_url":"git@github.com:hmrc/agent-assurance-frontend.git","clone_url":"https://github.com/hmrc/agent-assurance-frontend.git","svn_url":"https://github.com/hmrc/agent-assurance-frontend","homepage":"","size":109,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hmrc:master","ref":"master","sha":"077a29b08b95d6924d0a17f33192237497f2d4ce","user":{"login":"hmrc","id":5755339,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3NTUzMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5755339?v=4","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"repo":{"id":130338808,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAzMzg4MDg=","name":"agent-assurance-frontend","full_name":"hmrc/agent-assurance-frontend","owner":{"login":"hmrc","id":5755339,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3NTUzMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5755339?v=4","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmrc/agent-assurance-frontend","description":null,"fork":false,"url":"https://api.github.com/repos/hmrc/agent-assurance-frontend","forks_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/forks","keys_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/teams","hooks_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/hooks","issue_events_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/events","assignees_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/tags","blobs_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/languages","stargazers_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/stargazers","contributors_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/contributors","subscribers_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/subscribers","subscription_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/subscription","commits_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/merges","archive_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/downloads","issues_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/labels{/name}","releases_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/hmrc/agent-assurance-frontend/deployments","created_at":"2018-04-20T09:13:16Z","updated_at":"2018-08-23T15:31:44Z","pushed_at":"2018-08-28T13:48:34Z","git_url":"git://github.com/hmrc/agent-assurance-frontend.git","ssh_url":"git@github.com:hmrc/agent-assurance-frontend.git","clone_url":"https://github.com/hmrc/agent-assurance-frontend.git","svn_url":"https://github.com/hmrc/agent-assurance-frontend","homepage":"","size":109,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/33"},"html":{"href":"https://github.com/hmrc/agent-assurance-frontend/pull/33"},"issue":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues/33"},"comments":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/hmrc/agent-assurance-frontend/statuses/e0db6dae318429166153fab8c0729c8e24bb1862"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"johnrevill"}}