Skip to content

Commit

Permalink
Rename argument in get_supplemental_claim_upload
Browse files Browse the repository at this point in the history
- was :uuid, now :guid
- to match get_notice_of_disagreement_upload for easier code sharing and shared testing
  • Loading branch information
kayline committed Nov 15, 2024
1 parent 95afe01 commit ce2c782
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def get_evidence_uploads_statuses(saved_claim)
attachment_ids = saved_claim.appeal_submission&.appeal_submission_uploads
&.pluck(:lighthouse_upload_id) || []

attachment_ids.each do |uuid|
response = decision_review_service.get_supplemental_claim_upload(uuid:).body
attachment_ids.each do |guid|
response = decision_review_service.get_supplemental_claim_upload(guid:).body
attributes = response.dig('data', 'attributes').slice(*ATTRIBUTES_TO_STORE)
result << attributes.merge('id' => uuid)
result << attributes.merge('id' => guid)
end

result
Expand Down
6 changes: 3 additions & 3 deletions lib/decision_review_v1/appeals/supplemental_claim_services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ def put_supplemental_claim_upload(upload_url:, file_upload:, metadata_string:, u
##
# Returns all of the data associated with a specific Supplemental Claim Evidence Submission.
#
# @param uuid [uuid] supplemental Claim UUID Evidence Submission
# @param guid [guid] supplemental Claim UUID Evidence Submission
# @return [Faraday::Response]
#
def get_supplemental_claim_upload(uuid:)
def get_supplemental_claim_upload(guid:)
with_monitoring_and_error_handling do
perform :get, "supplemental_claims/evidence_submissions/#{uuid}", nil
perform :get, "supplemental_claims/evidence_submissions/#{guid}", nil
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/lib/decision_review_v1/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,10 @@ def personal_information_logs

describe '#get_supplemental_claim_upload' do
subject do
described_class.new.get_supplemental_claim_upload(uuid:)
described_class.new.get_supplemental_claim_upload(guid:)
end

let(:uuid) { '59cdb98f-f94b-4aaa-8952-4d1e59b6e40a' }
let(:guid) { '59cdb98f-f94b-4aaa-8952-4d1e59b6e40a' }

context '200 response' do
it 'returns a properly formatted 200 response' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@
end

it 'only sets delete_date for SavedClaim::SupplementalClaim with all attachments in vbms status' do
expect(service).to receive(:get_supplemental_claim_upload).with(uuid: upload_id)
expect(service).to receive(:get_supplemental_claim_upload).with(guid: upload_id)
.and_return(upload_response_vbms)
expect(service).to receive(:get_supplemental_claim_upload).with(uuid: upload_id2)
expect(service).to receive(:get_supplemental_claim_upload).with(guid: upload_id2)
.and_return(upload_response_processing)
expect(service).to receive(:get_supplemental_claim_upload).with(uuid: upload_id3)
expect(service).to receive(:get_supplemental_claim_upload).with(guid: upload_id3)
.and_return(upload_response_vbms)
expect(service).to receive(:get_supplemental_claim_upload).with(uuid: upload_id4)
expect(service).to receive(:get_supplemental_claim_upload).with(guid: upload_id4)
.and_return(upload_response_processing)

expect(service).to receive(:get_supplemental_claim).with(guid1).and_return(response_complete)
Expand Down Expand Up @@ -427,11 +427,11 @@

expect(service).to receive(:get_supplemental_claim).with(guid1).and_return(response_pending)
expect(service).to receive(:get_supplemental_claim).with(guid2).and_return(response_error)
expect(service).to receive(:get_supplemental_claim_upload).with(uuid: upload_id)
expect(service).to receive(:get_supplemental_claim_upload).with(guid: upload_id)
.and_return(upload_response_error)
expect(service).to receive(:get_supplemental_claim_upload).with(uuid: upload_id2)
expect(service).to receive(:get_supplemental_claim_upload).with(guid: upload_id2)
.and_return(upload_response_error)
expect(service).to receive(:get_supplemental_claim_upload).with(uuid: upload_id3)
expect(service).to receive(:get_supplemental_claim_upload).with(guid: upload_id3)
.and_return(upload_response_processing)

subject.new.perform
Expand Down

0 comments on commit ce2c782

Please sign in to comment.