From 003a8b7d616c35f71a2509b7fdcc07afebdf2cf7 Mon Sep 17 00:00:00 2001 From: Tom Harrison Date: Wed, 6 Mar 2024 11:33:36 -0500 Subject: [PATCH 1/2] Add is_edu_claim_available flag which will be used to enable direct deposit for edu benefits --- app/swagger/swagger/requests/profile.rb | 4 +++- lib/lighthouse/direct_deposit/control_information.rb | 3 ++- .../disability_compensations_controller_spec.rb | 2 ++ .../lighthouse/direct_deposit/show/200_has_restrictions.yml | 2 +- .../lighthouse/direct_deposit/show/200_valid.yml | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/swagger/swagger/requests/profile.rb b/app/swagger/swagger/requests/profile.rb index 7534d23b28d..fbc4d845cdc 100644 --- a/app/swagger/swagger/requests/profile.rb +++ b/app/swagger/swagger/requests/profile.rb @@ -42,8 +42,9 @@ class Profile has_no_fiduciary_assigned is_not_deceased has_payment_address + is_edu_claim_available ] - property :can_update_direct_deposit, type: :boolean, example: true, description: 'Must be true to view payment account information' + property :can_update_direct_deposit, type: :boolean, example: true, description: 'Must be true to view C&P direct deposit information' property :is_corp_available, type: :boolean, example: true, description: '' property :is_corp_rec_found, type: :boolean, example: true, description: '' property :has_no_bdn_payments, type: :boolean, example: true, description: '' @@ -54,6 +55,7 @@ class Profile property :has_no_fiduciary_assigne, type: :boolean, example: true, description: '' property :is_not_decease, type: :boolean, example: true, description: '' property :has_payment_address, type: :boolean, example: true, description: '' + property :is_edu_claim_available, type: :boolean, example: true, description: 'Must be true to view EDU direct deposit information' end property :payment_account do diff --git a/lib/lighthouse/direct_deposit/control_information.rb b/lib/lighthouse/direct_deposit/control_information.rb index 96300594ebf..893938a41dc 100644 --- a/lib/lighthouse/direct_deposit/control_information.rb +++ b/lib/lighthouse/direct_deposit/control_information.rb @@ -15,7 +15,8 @@ class ControlInformation :has_mailing_address, :has_no_fiduciary_assigned, :is_not_deceased, - :has_payment_address + :has_payment_address, + :is_edu_claim_available end end end diff --git a/spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb b/spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb index 02da88fe8a6..c5c303bf72a 100644 --- a/spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb +++ b/spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb @@ -44,6 +44,7 @@ control_info = json['data']['attributes']['control_information'] expect(control_info['can_update_direct_deposit']).to be(true) + expect(control_info['is_edu_claim_available']).to be(true) end it 'does not return errors' do @@ -65,6 +66,7 @@ json = JSON.parse(response.body)['data']['attributes'] expect(json['control_information']['can_update_direct_deposit']).to be(false) expect(json['control_information']['has_payment_address']).to be(false) + expect(json['control_information']['is_edu_claim_available']).to be(false) end end diff --git a/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_has_restrictions.yml b/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_has_restrictions.yml index 44cec0895ac..b04255939d5 100644 --- a/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_has_restrictions.yml +++ b/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_has_restrictions.yml @@ -60,6 +60,6 @@ http_interactions: body: encoding: ASCII-8BIT string: '{"paymentAccount":{"accountType":"CHECKING","accountNumber":"1234567890","financialInstitutionRoutingNumber":"031000503","financialInstitutionName":"WELLS - FARGO BANK"},"controlInformation":{"canUpdateDirectDeposit":false,"isCorpAvailable":true,"isCorpRecFound":true,"hasNoBdnPayments":true,"hasIndentity":true,"hasIndex":true,"isCompetent":true,"hasMailingAddress":true,"hasNoFiduciaryAssigned":true,"isNotDeceased":true,"hasPaymentAddress":false}}' + FARGO BANK"},"controlInformation":{"canUpdateDirectDeposit":false,"isCorpAvailable":true,"isCorpRecFound":true,"hasNoBdnPayments":true,"hasIndentity":true,"hasIndex":true,"isCompetent":true,"hasMailingAddress":true,"hasNoFiduciaryAssigned":true,"isNotDeceased":true,"hasPaymentAddress":false,"isEduClaimAvailable":false}}' recorded_at: Thu, 23 Feb 2023 21:47:59 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_valid.yml b/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_valid.yml index be583879fc5..37c757fb325 100644 --- a/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_valid.yml +++ b/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_valid.yml @@ -60,6 +60,6 @@ http_interactions: body: encoding: ASCII-8BIT string: '{"paymentAccount":{"accountType":"CHECKING","accountNumber":"1234567890","financialInstitutionRoutingNumber":"031000503","financialInstitutionName":"WELLS - FARGO BANK"},"controlInformation":{"canUpdateDirectDeposit":true,"isCorpAvailable":true,"isCorpRecFound":true,"hasNoBdnPayments":true,"hasIndentity":true,"hasIndex":true,"isCompetent":true,"hasMailingAddress":true,"hasNoFiduciaryAssigned":true,"isNotDeceased":true,"hasPaymentAddress":true}}' + FARGO BANK"},"controlInformation":{"canUpdateDirectDeposit":true,"isCorpAvailable":true,"isCorpRecFound":true,"hasNoBdnPayments":true,"hasIndentity":true,"hasIndex":true,"isCompetent":true,"hasMailingAddress":true,"hasNoFiduciaryAssigned":true,"isNotDeceased":true,"hasPaymentAddress":true,"isEduClaimAvailable":true}}' recorded_at: Thu, 23 Feb 2023 21:47:59 GMT recorded_with: VCR 6.1.0 From 73e6b3333830bd31fe7d08fe688d43d31373968b Mon Sep 17 00:00:00 2001 From: Tom Harrison Date: Wed, 6 Mar 2024 11:59:34 -0500 Subject: [PATCH 2/2] Added a spec to test for missing education benefits flag --- ...isability_compensations_controller_spec.rb | 14 ++++ .../show/200_missing_edu_flag.yml | 65 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_missing_edu_flag.yml diff --git a/spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb b/spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb index c5c303bf72a..ffb81e4f7f9 100644 --- a/spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb +++ b/spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb @@ -57,6 +57,20 @@ end end + context 'when missing education benefits flag' do + it 'returns a status of 200' do + VCR.use_cassette('lighthouse/direct_deposit/show/200_missing_edu_flag') do + get(:show) + end + + expect(response).to have_http_status(:ok) + + json = JSON.parse(response.body) + control_info = json['data']['attributes']['control_information'] + expect(control_info['is_edu_claim_available']).to be_nil + end + end + context 'when has restrictions' do it 'control info has flags set to false' do VCR.use_cassette('lighthouse/direct_deposit/show/200_has_restrictions') do diff --git a/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_missing_edu_flag.yml b/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_missing_edu_flag.yml new file mode 100644 index 00000000000..be583879fc5 --- /dev/null +++ b/spec/support/vcr_cassettes/lighthouse/direct_deposit/show/200_missing_edu_flag.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://sandbox-api.va.gov/services/direct-deposit-management/v1/direct-deposit?icn=1012666073V986297 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Authorization: + - Bearer abcdefghijklmnop + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: '' + headers: + Date: + - Thu, 23 Feb 2023 21:47:59 GMT + Content-Type: + - application/json;charset=UTF-8 + Connection: + - keep-alive + X-Ratelimit-Limit-Minute: + - '60' + Ratelimit-Remaining: + - '58' + Ratelimit-Reset: + - '7' + Ratelimit-Limit: + - '60' + X-Ratelimit-Remaining-Minute: + - '58' + Content-Language: + - en-US + Pragma: + - no-cache + - no-cache + X-Kong-Upstream-Latency: + - '5345' + X-Kong-Proxy-Latency: + - '2' + Via: + - kong/3.0.2 + Access-Control-Allow-Origin: + - "*" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Cache-Control: + - no-cache, no-store + Transfer-Encoding: + - chunked + body: + encoding: ASCII-8BIT + string: '{"paymentAccount":{"accountType":"CHECKING","accountNumber":"1234567890","financialInstitutionRoutingNumber":"031000503","financialInstitutionName":"WELLS + FARGO BANK"},"controlInformation":{"canUpdateDirectDeposit":true,"isCorpAvailable":true,"isCorpRecFound":true,"hasNoBdnPayments":true,"hasIndentity":true,"hasIndex":true,"isCompetent":true,"hasMailingAddress":true,"hasNoFiduciaryAssigned":true,"isNotDeceased":true,"hasPaymentAddress":true}}' + recorded_at: Thu, 23 Feb 2023 21:47:59 GMT +recorded_with: VCR 6.1.0