Skip to content

Commit

Permalink
[DD] Initial prefill for digital dispute (#19545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Pongo authored Dec 11, 2024
1 parent 1b1b3f0 commit e558321
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,7 @@ spec/support/vcr_cassettes/veteran @department-of-veterans-affairs/lighthouse-da
spec/support/vcr_cassettes/veteran_readiness_employment @department-of-veterans-affairs/benefits-non-disability @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/vetext @department-of-veterans-affairs/mobile-api-team
spec/support/vcr_cassettes/vha/sharepoint/upload_pdf_400_response.yml @department-of-veterans-affairs/vsa-debt-resolution @department-of-veterans-affairs/backend-review-group
config/form_profile_mappings/DISPUTE-DEBT.yml @department-of-veterans-affairs/vsa-debt-resolution @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/virtual_agent @department-of-veterans-affairs/vfs-virtual-agent-chatbot @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/virtual_regional_office @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/chip @department-of-veterans-affairs/vsa-healthcare-health-quest-1-backend @department-of-veterans-affairs/patient-check-in @department-of-veterans-affairs/backend-review-group
Expand Down
6 changes: 4 additions & 2 deletions app/models/form_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ class FormProfile
ivc_champva: ['10-7959C'],
form_upload_flow: ['FORM-UPLOAD-FLOW'],
acc_rep_management: %w[21-22 21-22A],
form_mock_ae_design_patterns: ['FORM-MOCK-AE-DESIGN-PATTERNS']
form_mock_ae_design_patterns: ['FORM-MOCK-AE-DESIGN-PATTERNS'],
dispute_debt: ['DISPUTE-DEBT']
}.freeze

FORM_ID_TO_CLASS = {
Expand Down Expand Up @@ -147,7 +148,8 @@ class FormProfile
'FORM-UPLOAD-FLOW' => ::FormProfiles::FormUploadFlow,
'21-22' => ::FormProfiles::VA2122,
'21-22A' => ::FormProfiles::VA2122a,
'FORM-MOCK-AE-DESIGN-PATTERNS' => ::FormProfiles::FormMockAeDesignPatterns
'FORM-MOCK-AE-DESIGN-PATTERNS' => ::FormProfiles::FormMockAeDesignPatterns,
'DISPUTE-DEBT' => ::FormProfiles::DisputeDebt
}.freeze

APT_REGEX = /\S\s+((apt|apartment|unit|ste|suite).+)/i
Expand Down
27 changes: 27 additions & 0 deletions app/models/form_profiles/dispute_debt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

class FormProfiles::DisputeDebt < FormProfile
def metadata
{
version: 0,
prefill: true,
returnUrl: '/personal-information'
}
end

private

def va_file_number_last_four
return unless user.authorize :debt, :access?

file_number =
begin
response = BGS::People::Request.new.find_person_by_participant_id(user:)
response.file_number.presence || user.ssn
rescue
user.ssn
end

file_number&.last(4)
end
end
7 changes: 7 additions & 0 deletions config/form_profile_mappings/DISPUTE-DEBT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
veteran:
fullName: [identity_information, full_name]
ssn: [identity_information, ssn_last_four]
dateOfBirth: [identity_information, date_of_birth]
homePhone: [contact_information, home_phone]
email: [contact_information, email]
fileNumber: [va_file_number_last_four]
3 changes: 3 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ mcp:
fsr:
prefill: true

dispute_debt:
prefill: true

review_instance_slug: ~

sidekiq_admin_panel: false
Expand Down
29 changes: 29 additions & 0 deletions spec/models/form_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,23 @@
}
end

let(:vdispute_debt_expected) do
{
'veteran' => {
'fullName' => {
'first' => user.first_name&.capitalize,
'last' => user.last_name&.capitalize,
'suffix' => user.suffix
},
'ssn' => '1863',
'dateOfBirth' => '1809-02-12',
'homePhone' => '14445551212',
'email' => user.pciu_email,
'fileNumber' => '3735'
}
}
end

let(:initialize_va_profile_prefill_military_information_expected) do
expected_service_episodes_by_date = [
{
Expand Down Expand Up @@ -1410,6 +1427,18 @@ def expect_prefilled(form_id)
end
end

context 'with a user that can prefill DisputeDebt' do
before do
allow_any_instance_of(BGS::People::Service).to(
receive(:find_person_by_participant_id).and_return(BGS::People::Response.new({ file_nbr: '796043735' }))
)
end

it 'returns a prefilled DisputeDebt form' do
expect_prefilled('DISPUTE-DEBT')
end
end

context 'with a user that can prefill financial status report' do
let(:comp_and_pen_payments) do
[
Expand Down

0 comments on commit e558321

Please sign in to comment.