{"action":"created","comment":{"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments/169747742","pull_request_review_id":98324960,"id":169747742,"diff_hunk":"@@ -61,52 +55,50 @@ def self.reassign_case_to_judge(decass_hash)\n       true\n     end\n   end\n-  # :nocov:\n \n-  # :nocov:\n-  def self.find_decass_record(vacols_id, css_id)\n-    VACOLS::Decass.find_by_vacols_id_and_css_id(vacols_id, css_id)\n+  def self.decass_by_vacols_id_and_date_assigned(vacols_id, date_assigned)\n+    VACOLS::Decass.find_by(defolder: vacols_id, deassign: date_assigned)\n   end\n-  # :nocov:\n \n-  # :nocov:\n   def self.update_location(case_record, css_id)\n     stafkey = VACOLS::Staff.find_by(sdomainid: css_id)\n     case_record.update_vacols_location!(stafkey)\n   end\n-  # :nocov:\n \n-  # :nocov:\n   def self.update_decass_record(decass_record, decass_hash)\n     info = QueueMapper.case_decision_fields_to_vacols_codes(decass_hash)\n     # Validate presence of the required fields after the mapper to ensure correctness\n     VacolsHelper.validate_presence(info, [:work_product, :document_id, :reassigned_at])\n     decass_record.update_decass_record!(info)\n   end\n-  # :nocov:\n \n-  # :nocov:\n   def self.tasks_query(css_id)\n     records = VACOLS::CaseAssignment.tasks_for_user(css_id)\n     filter_duplicate_tasks(records)\n   end\n-  # :nocov:\n \n-  def self.filter_duplicate_tasks(records)\n-    # Keep the latest assignment if there are duplicate records\n-    records.group_by(&:vacols_id).each_with_object([]) { |(_k, v), result| result << v.sort_by(&:date_assigned).last }\n-  end\n-\n-  # :nocov:\n   def self.appeal_info_query(vacols_ids)\n     VACOLS::Case.includes(:folder, :correspondent, :representative)\n       .find(vacols_ids)\n   end\n-  # :nocov:\n \n-  # :nocov:\n   def self.aod_query(vacols_ids)\n     VACOLS::Case.aod(vacols_ids)\n   end\n   # :nocov:\n+\n+  def self.find_decass_record(task_id)\n+    # Task ID is a concatantion of the vacols ID and the date assigned\n+    result = task_id.split(\"-\", 2)\n+    fail ReassignCaseToJudgeError if result.size != 2\n+    record = decass_by_vacols_id_and_date_assigned(result.first, result.second.to_date)\n+    # TODO: check permission that the user can update the record\n+    fail ReassignCaseToJudgeError unless record\n+    record\n+  end\n+\n+  def self.filter_duplicate_tasks(records)","path":"app/repositories/queue_repository.rb","position":91,"original_position":91,"commit_id":"fa7bb232547f8a1781bd0bc99a42dfa3921800f9","original_commit_id":"fa7bb232547f8a1781bd0bc99a42dfa3921800f9","user":{"login":"aroltsch","id":3811786,"avatar_url":"https://avatars0.githubusercontent.com/u/3811786?v=4","gravatar_id":"","url":"https://api.github.com/users/aroltsch","html_url":"https://github.com/aroltsch","followers_url":"https://api.github.com/users/aroltsch/followers","following_url":"https://api.github.com/users/aroltsch/following{/other_user}","gists_url":"https://api.github.com/users/aroltsch/gists{/gist_id}","starred_url":"https://api.github.com/users/aroltsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aroltsch/subscriptions","organizations_url":"https://api.github.com/users/aroltsch/orgs","repos_url":"https://api.github.com/users/aroltsch/repos","events_url":"https://api.github.com/users/aroltsch/events{/privacy}","received_events_url":"https://api.github.com/users/aroltsch/received_events","type":"User","site_admin":false},"body":"This code already existed, just moved it here. ","created_at":"2018-02-21T19:17:01Z","updated_at":"2018-02-21T19:17:01Z","html_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/4696#discussion_r169747742","pull_request_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/4696","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments/169747742"},"html":{"href":"https://github.com/department-of-veterans-affairs/caseflow/pull/4696#discussion_r169747742"},"pull_request":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/4696"}}},"pull_request":{"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/4696","id":170562291,"html_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/4696","diff_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/4696.diff","patch_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/4696.patch","issue_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/4696","number":4696,"state":"open","locked":false,"title":"Use decass uniq ID instead of vacols ID and css ID","user":{"login":"aroltsch","id":3811786,"avatar_url":"https://avatars0.githubusercontent.com/u/3811786?v=4","gravatar_id":"","url":"https://api.github.com/users/aroltsch","html_url":"https://github.com/aroltsch","followers_url":"https://api.github.com/users/aroltsch/followers","following_url":"https://api.github.com/users/aroltsch/following{/other_user}","gists_url":"https://api.github.com/users/aroltsch/gists{/gist_id}","starred_url":"https://api.github.com/users/aroltsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aroltsch/subscriptions","organizations_url":"https://api.github.com/users/aroltsch/orgs","repos_url":"https://api.github.com/users/aroltsch/repos","events_url":"https://api.github.com/users/aroltsch/events{/privacy}","received_events_url":"https://api.github.com/users/aroltsch/received_events","type":"User","site_admin":false},"body":"PART 1 connects #4679 ","created_at":"2018-02-21T19:15:19Z","updated_at":"2018-02-21T19:17:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7a0193f1577579df5a63027f4f7937587a10627","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":360259487,"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/labels/In-Progress","name":"In-Progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/4696/commits","review_comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/4696/comments","review_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/4696/comments","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/fa7bb232547f8a1781bd0bc99a42dfa3921800f9","head":{"label":"department-of-veterans-affairs:anya/4679_uniq_task_id","ref":"anya/4679_uniq_task_id","sha":"fa7bb232547f8a1781bd0bc99a42dfa3921800f9","user":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars1.githubusercontent.com/u/5421563?v=4","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"repo":{"id":51449239,"name":"caseflow","full_name":"department-of-veterans-affairs/caseflow","owner":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars1.githubusercontent.com/u/5421563?v=4","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/department-of-veterans-affairs/caseflow","description":"Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans' Appeals.","fork":false,"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow","forks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/forks","keys_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/teams","hooks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/hooks","issue_events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/events{/number}","events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/events","assignees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/assignees{/user}","branches_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/branches{/branch}","tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/tags","blobs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/{sha}","languages_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/languages","stargazers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/stargazers","contributors_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contributors","subscribers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscribers","subscription_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscription","commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contents/{+path}","compare_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/merges","archive_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/downloads","issues_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues{/number}","pulls_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls{/number}","milestones_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/milestones{/number}","notifications_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/labels{/name}","releases_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/releases{/id}","deployments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/deployments","created_at":"2016-02-10T15:20:50Z","updated_at":"2018-02-14T21:27:37Z","pushed_at":"2018-02-21T19:15:20Z","git_url":"git://github.com/department-of-veterans-affairs/caseflow.git","ssh_url":"git@github.com:department-of-veterans-affairs/caseflow.git","clone_url":"https://github.com/department-of-veterans-affairs/caseflow.git","svn_url":"https://github.com/department-of-veterans-affairs/caseflow","homepage":"","size":48323,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":493,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":19,"open_issues":493,"watchers":33,"default_branch":"master"}},"base":{"label":"department-of-veterans-affairs:master","ref":"master","sha":"d4b624c113d7332164aefdf830e5d628df3187e0","user":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars1.githubusercontent.com/u/5421563?v=4","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"repo":{"id":51449239,"name":"caseflow","full_name":"department-of-veterans-affairs/caseflow","owner":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars1.githubusercontent.com/u/5421563?v=4","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/department-of-veterans-affairs/caseflow","description":"Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans' Appeals.","fork":false,"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow","forks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/forks","keys_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/teams","hooks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/hooks","issue_events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/events{/number}","events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/events","assignees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/assignees{/user}","branches_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/branches{/branch}","tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/tags","blobs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/{sha}","languages_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/languages","stargazers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/stargazers","contributors_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contributors","subscribers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscribers","subscription_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscription","commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contents/{+path}","compare_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/merges","archive_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/downloads","issues_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues{/number}","pulls_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls{/number}","milestones_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/milestones{/number}","notifications_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/labels{/name}","releases_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/releases{/id}","deployments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/deployments","created_at":"2016-02-10T15:20:50Z","updated_at":"2018-02-14T21:27:37Z","pushed_at":"2018-02-21T19:15:20Z","git_url":"git://github.com/department-of-veterans-affairs/caseflow.git","ssh_url":"git@github.com:department-of-veterans-affairs/caseflow.git","clone_url":"https://github.com/department-of-veterans-affairs/caseflow.git","svn_url":"https://github.com/department-of-veterans-affairs/caseflow","homepage":"","size":48323,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":493,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":19,"open_issues":493,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/4696"},"html":{"href":"https://github.com/department-of-veterans-affairs/caseflow/pull/4696"},"issue":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/4696"},"comments":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/4696/comments"},"review_comments":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/4696/comments"},"review_comment":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/4696/commits"},"statuses":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/fa7bb232547f8a1781bd0bc99a42dfa3921800f9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aroltsch"}}