-
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 43135 poa updated notification dependent #19972
base: master
Are you sure you want to change the base?
Changes from all commits
0a9a5e2
671a71b
57a5031
7251cdd
f32c804
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -114,7 +114,7 @@ def set_auth_headers | |||||
if allow_dependent_claimant? | ||||||
add_dependent_to_auth_headers(headers) | ||||||
else | ||||||
auth_headers | ||||||
headers | ||||||
end | ||||||
end | ||||||
|
||||||
|
@@ -228,11 +228,11 @@ def user_profile | |||||
end | ||||||
|
||||||
def icn_for_vanotify | ||||||
params[:veteranId] | ||||||
dependent_claimant_icn = claimant_icn | ||||||
dependent_claimant_icn || params[:veteranId] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: we could make our intent clearer with presence.
Suggested change
|
||||||
end | ||||||
|
||||||
def fetch_claimant | ||||||
claimant_icn = form_attributes.dig('claimant', 'claimantId') | ||||||
if claimant_icn.present? | ||||||
mpi_profile = mpi_service.find_profile_by_identifier(identifier: claimant_icn, | ||||||
identifier_type: MPI::Constants::ICN) | ||||||
|
@@ -241,6 +241,10 @@ def fetch_claimant | |||||
mpi_profile | ||||||
end | ||||||
|
||||||
def claimant_icn | ||||||
@claimant_icn ||= form_attributes.dig('claimant', 'claimantId') | ||||||
end | ||||||
|
||||||
def disable_jobs? | ||||||
Settings.claims_api&.poa_v2&.disable_jobs | ||||||
end | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ module ClaimsApi | |
class PoaAssignDependentClaimantJob < ClaimsApi::ServiceBase | ||
LOG_TAG = 'poa_assign_dependent_claimant_job' | ||
|
||
def perform(poa_id) | ||
def perform(poa_id, rep) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of passing the rep object, should we plumb the rep ID and query the database again in VANotifyAcceptedJob? Have been burned before passing objects between sidekiq jobs. |
||
poa = ClaimsApi::PowerOfAttorney.find(poa_id) | ||
|
||
service = dependent_claimant_poa_assignment_service( | ||
|
@@ -29,6 +29,8 @@ def perform(poa_id) | |
poa.id, | ||
'POA assigned for dependent' | ||
) | ||
|
||
ClaimsApi::VANotifyAcceptedJob.perform_async(poa.id, rep) if vanotify?(poa.auth_headers, rep) | ||
end | ||
|
||
private | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -227,6 +227,14 @@ def extract_poa_code(poa_form_data) | |||||||||||||||
end | ||||||||||||||||
end | ||||||||||||||||
|
||||||||||||||||
def vanotify?(auth_headers, rep) | ||||||||||||||||
if Flipper.enabled?(:lighthouse_claims_api_v2_poa_va_notify) | ||||||||||||||||
auth_headers.key?(ClaimsApi::V2::Veterans::PowerOfAttorney::BaseController::VA_NOTIFY_KEY) && rep.present? | ||||||||||||||||
else | ||||||||||||||||
false | ||||||||||||||||
end | ||||||||||||||||
Comment on lines
+231
to
+235
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit
Suggested change
|
||||||||||||||||
end | ||||||||||||||||
|
||||||||||||||||
def evss_mapper_service(auto_claim) | ||||||||||||||||
ClaimsApi::V2::DisabilityCompensationEvssMapper.new(auto_claim) | ||||||||||||||||
end | ||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -173,7 +173,12 @@ def build_address(line1, line2, line3) | |||||||||||||||
end | ||||||||||||||||
|
||||||||||||||||
def claimant_first_name(poa) | ||||||||||||||||
poa.auth_headers['va_eauth_firstName'] | ||||||||||||||||
claimant = poa.form_data['claimant'].present? | ||||||||||||||||
if claimant | ||||||||||||||||
poa.form_data['claimant']['firstName'] | ||||||||||||||||
else | ||||||||||||||||
poa.auth_headers['va_eauth_firstName'] | ||||||||||||||||
end | ||||||||||||||||
Comment on lines
+176
to
+181
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit
Suggested change
|
||||||||||||||||
end | ||||||||||||||||
|
||||||||||||||||
def organization_filing?(form_data) | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,7 @@ | |
end | ||
end | ||
|
||
context 'when the flipper is on' do | ||
context 'when the flipper is off' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
it 'does not send the vanotify job' do | ||
allow(Flipper).to receive(:enabled?).with(:lighthouse_claims_api_v2_poa_va_notify).and_return false | ||
Flipper.disable(:lighthouse_claims_api_v2_poa_va_notify) | ||
|
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: I missed this subtlety earlier, but we shouldnʼt need the intermediate
headers
variable since Ruby modifies hashes in-place. We could simplify these two methods as: