-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API-40053-store-id-from-vnp-requests #20103
API-40053-store-id-from-vnp-requests #20103
Conversation
* Gets the responses from the related calls in order to aquire the IDs returned * Adds those IDs into the metadata if they are present and saves them on the PowerOfAttorneyRequest record when saved modified: modules/claims_api/app/controllers/claims_api/v2/veterans/power_of_attorney/request_controller.rb modified: modules/claims_api/app/services/claims_api/power_of_attorney_request_service/create_request.rb modified: modules/claims_api/spec/services/power_of_attorney_request_service/create_request_spec.rb modified: modules/claims_api/spec/services/power_of_attorney_request_service/orchestrator_spec.rb
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, but I was unable to test due to the BGS errors discussed elsewhere.
@@ -97,7 +97,8 @@ def create # rubocop:disable Metrics/MethodLength | |||
claimant_icn = form_attributes.dig('claimant', 'claimantId') | |||
poa_request = ClaimsApi::PowerOfAttorneyRequest.create!(proc_id: res['procId'], | |||
veteran_icn: params[:veteranId], | |||
claimant_icn:, poa_code:) | |||
claimant_icn:, poa_code:, | |||
metadata: res['meta'] || nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: || nil is redundant here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -72,22 +72,25 @@ def create_vonapp_data(person, vnp_ptcpnt_id, trace_digest) # rubocop:disable Me | |||
|
|||
promises << Concurrent::Promise.execute do | |||
Datadog::Tracing.continue_trace!(trace_digest) do | |||
create_vnp_mailing_address(person[:address], vnp_ptcpnt_id) | |||
res = create_vnp_mailing_address(person[:address], vnp_ptcpnt_id) | |||
@vnp_res_object['meta'][type.to_s]['vnp_mail_id'] = res[:vnp_ptcpnt_addrs_id] if res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why type.to_s here and below but not on line 65? Arenʼt we only passing strings 'veteran' or 'claimant' as the type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a Rubocop change, I just had the variable in there
def add_meta_ids(vet_obj) | ||
return vet_obj if @vnp_res_object['meta'].empty? | ||
|
||
vet_obj['meta'] ||= {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this line if we have the guard above?
@@ -320,6 +328,22 @@ def limitation?(condition) | |||
def format_phone(phone) | |||
"#{phone[:areaCode]}#{phone[:phoneNumber]}" | |||
end | |||
|
|||
def add_meta_ids(vet_obj) | |||
return vet_obj if @vnp_res_object['meta'].empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would .blank? be safer here in case @vnp_res_object['meta'] is nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally, good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Related issue(s)
API-43737
Testing done
Testing Notes
services/claims/v2/veterans/1012829932V238054/power-of-attorney-request
(or whatever ICN) and then look the record up in your DB. You should seemetadata
have some ID values inside the saved record (this is of course dependent on those IDs being present, I always saw them but not sure if any test users would no)rec = ClaimsApi::PowerOfAttorneyRequest.find(YOUR_RECORD_ID)
Screenshots
Note: Optional
What areas of the site does it impact?
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?