From b8025533992f6a78ef70a121726143ea79df1f9a Mon Sep 17 00:00:00 2001 From: Bryan Alexander Date: Mon, 22 Apr 2024 15:39:42 -0400 Subject: [PATCH 1/6] 80367: Add form profile for 10-7959F-1 --- app/models/form_profile.rb | 6 +++-- app/models/form_profiles/va_107959f1.rb | 13 +++++++++ config/form_profile_mappings/10-7959F-1.yml | 22 +++++++++++++++ config/settings.yml | 3 +++ spec/models/form_profile_spec.rb | 30 +++++++++++++++++++++ 5 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 app/models/form_profiles/va_107959f1.rb create mode 100644 config/form_profile_mappings/10-7959F-1.yml diff --git a/app/models/form_profile.rb b/app/models/form_profile.rb index bfd47678896..08c88a7bd76 100644 --- a/app/models/form_profile.rb +++ b/app/models/form_profile.rb @@ -101,7 +101,8 @@ class FormProfile vre_readiness: ['28-1900'], coe: ['26-1880'], adapted_housing: ['26-4555'], - intent_to_file: ['21-0966'] + intent_to_file: ['21-0966'], + ivc_champva: ['10-7959F-1'] }.freeze FORM_ID_TO_CLASS = { @@ -138,7 +139,8 @@ class FormProfile '22-1990EZ' => ::FormProfiles::VA1990ez, '26-1880' => ::FormProfiles::VA261880, '26-4555' => ::FormProfiles::VA264555, - '21-0966' => ::FormProfiles::VA210966 + '21-0966' => ::FormProfiles::VA210966, + '10-7959F-1' => ::FormProfiles::VA107959f1 }.freeze APT_REGEX = /\S\s+((apt|apartment|unit|ste|suite).+)/i diff --git a/app/models/form_profiles/va_107959f1.rb b/app/models/form_profiles/va_107959f1.rb new file mode 100644 index 00000000000..407f42714c6 --- /dev/null +++ b/app/models/form_profiles/va_107959f1.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class FormProfiles::VA107959f1 < FormProfile + FORM_ID = '10-7959F-1' + + def metadata + { + version: 0, + prefill: true, + returnUrl: '/review-and-submit' + } + end +end diff --git a/config/form_profile_mappings/10-7959F-1.yml b/config/form_profile_mappings/10-7959F-1.yml new file mode 100644 index 00000000000..f9846dcb65e --- /dev/null +++ b/config/form_profile_mappings/10-7959F-1.yml @@ -0,0 +1,22 @@ + +veteran: + date_of_birth: [identity_information, date_of_birth] + full_name: [identity_information, full_name] + first: [identity_information, first] + middle: [identity_information, middle] + last: [identity_information, last] +physical_address: + country: [contact_information, country] + street: [contact_information, street] + city: [contact_information, city] + state: [contact_information, state] + postal_code: [contact_information, postal_code] +mailing_address: + country: [contact_information, country] + street: [contact_information, street] + city: [contact_information, city] + state: [contact_information, state] + postal_code: [contact_information, postal_code] +ssn: [identity_information, ssn] +phone_number: [contact_information, us_phone] +email_address: [contact_information, email] \ No newline at end of file diff --git a/config/settings.yml b/config/settings.yml index b069fd69ac7..c1cd8bdb74f 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -404,6 +404,9 @@ adapted_housing: intent_to_file: prefill: true +ivc_champva: + prefill: true + # Settings for Expiry Scanner expiry_scanner: slack: diff --git a/spec/models/form_profile_spec.rb b/spec/models/form_profile_spec.rb index f6c9d2ddac8..551afe4a70e 100644 --- a/spec/models/form_profile_spec.rb +++ b/spec/models/form_profile_spec.rb @@ -893,6 +893,35 @@ } end + let(:v10_7959f_1_expected) do + { + 'veteran' => { + 'date_of_birth' => user.birth_date, + 'full_name' => { + 'first' => user.first_name&.capitalize, + 'middle' => user.middle_name&.capitalize, + 'last' => user.last_name&.capitalize + }, + 'physical_address' => { + 'country' => user.address[:country], + 'street' => user.address[:street], + 'city' => user.address[:city], + 'state' => user.address[:state], + 'postal_code' => user.address[:postal_code] + }, + 'mailing_address' => { + 'country' => user.address[:country], + 'street' => user.address[:street], + 'city' => user.address[:city], + 'state' => user.address[:state], + 'postal_code' => user.address[:postal_code] + }, + 'phone_number' => us_phone, + 'email_address' => user.pciu_email + } + } + end + let(:initialize_va_profile_prefill_military_information_expected) do expected_service_episodes_by_date = [ { @@ -1560,6 +1589,7 @@ def expect_prefilled(form_id) 28-1900 26-1880 26-4555 + 10-7959F-1 ].each do |form_id| it "returns prefilled #{form_id}" do VCR.use_cassette('va_profile/military_personnel/service_history_200_many_episodes', From 107e5e100e872eb8d444cc4bc144758170b31649 Mon Sep 17 00:00:00 2001 From: Bryan Alexander Date: Mon, 22 Apr 2024 15:48:56 -0400 Subject: [PATCH 2/6] 80367: Remove vets-json-schema test --- spec/models/form_profile_spec.rb | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/spec/models/form_profile_spec.rb b/spec/models/form_profile_spec.rb index 551afe4a70e..f6c9d2ddac8 100644 --- a/spec/models/form_profile_spec.rb +++ b/spec/models/form_profile_spec.rb @@ -893,35 +893,6 @@ } end - let(:v10_7959f_1_expected) do - { - 'veteran' => { - 'date_of_birth' => user.birth_date, - 'full_name' => { - 'first' => user.first_name&.capitalize, - 'middle' => user.middle_name&.capitalize, - 'last' => user.last_name&.capitalize - }, - 'physical_address' => { - 'country' => user.address[:country], - 'street' => user.address[:street], - 'city' => user.address[:city], - 'state' => user.address[:state], - 'postal_code' => user.address[:postal_code] - }, - 'mailing_address' => { - 'country' => user.address[:country], - 'street' => user.address[:street], - 'city' => user.address[:city], - 'state' => user.address[:state], - 'postal_code' => user.address[:postal_code] - }, - 'phone_number' => us_phone, - 'email_address' => user.pciu_email - } - } - end - let(:initialize_va_profile_prefill_military_information_expected) do expected_service_episodes_by_date = [ { @@ -1589,7 +1560,6 @@ def expect_prefilled(form_id) 28-1900 26-1880 26-4555 - 10-7959F-1 ].each do |form_id| it "returns prefilled #{form_id}" do VCR.use_cassette('va_profile/military_personnel/service_history_200_many_episodes', From 55df548624508f019e9e97e8c73235bf09d5b313 Mon Sep 17 00:00:00 2001 From: Bryan Alexander Date: Mon, 22 Apr 2024 15:57:46 -0400 Subject: [PATCH 3/6] 80367: Add codeowner --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0f84418b13b..2443bc3051b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -662,6 +662,7 @@ config/form_profile_mappings/0873.yml @department-of-veterans-affairs/vfs-virtua config/form_profile_mappings/1010ez.yml @department-of-veterans-affairs/vfs-10-10 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group config/form_profile_mappings/10-10EZR.yml @department-of-veterans-affairs/vfs-10-10 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group config/form_profile_mappings/10182.yml @department-of-veterans-affairs/Benefits-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group +config/form_profile_mappings/10-7959F-1.yml @department-of-veterans-affairs/champva-engineering @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group config/form_profile_mappings/20-0995.yml @department-of-veterans-affairs/Benefits-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group config/form_profile_mappings/20-0996.yml @department-of-veterans-affairs/Benefits-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group config/form_profile_mappings/21-526EZ.yml @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group From 2c5754cfdbc6a3b18b83dd9f5782ee1033897e0c Mon Sep 17 00:00:00 2001 From: Bryan Alexander Date: Thu, 25 Apr 2024 13:16:37 -0400 Subject: [PATCH 4/6] 80367: Adjust form mapping --- config/form_profile_mappings/10-7959F-1.yml | 29 +++++++++------------ 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/config/form_profile_mappings/10-7959F-1.yml b/config/form_profile_mappings/10-7959F-1.yml index f9846dcb65e..87a0c386480 100644 --- a/config/form_profile_mappings/10-7959F-1.yml +++ b/config/form_profile_mappings/10-7959F-1.yml @@ -1,22 +1,17 @@ veteran: - date_of_birth: [identity_information, date_of_birth] - full_name: [identity_information, full_name] + dateOfBirth: [identity_information, date_of_birth] + fullName: [identity_information, full_name] first: [identity_information, first] middle: [identity_information, middle] last: [identity_information, last] -physical_address: - country: [contact_information, country] - street: [contact_information, street] - city: [contact_information, city] - state: [contact_information, state] - postal_code: [contact_information, postal_code] -mailing_address: - country: [contact_information, country] - street: [contact_information, street] - city: [contact_information, city] - state: [contact_information, state] - postal_code: [contact_information, postal_code] -ssn: [identity_information, ssn] -phone_number: [contact_information, us_phone] -email_address: [contact_information, email] \ No newline at end of file +physicalAddress: + street: [contact_information, address, street] + street2: [contact_information, address, street2] + city: [contact_information, address, city] + state: [contact_information, address, state] + country: [contact_information, address, country] + postalCode: [contact_information, address, postal_code] +veteranSocialSecurityNumber: [identity_information, ssn] +phoneNumber: [contact_information, us_phone] +emailAddress: [contact_information, email] \ No newline at end of file From 413a6e46704d83c8da4fa2d494b65b60b4fdb96f Mon Sep 17 00:00:00 2001 From: Bryan Alexander Date: Thu, 25 Apr 2024 14:11:08 -0400 Subject: [PATCH 5/6] 80367: Remove some values that shouldn't be there --- config/form_profile_mappings/10-7959F-1.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/form_profile_mappings/10-7959F-1.yml b/config/form_profile_mappings/10-7959F-1.yml index 87a0c386480..b10f4db1fe1 100644 --- a/config/form_profile_mappings/10-7959F-1.yml +++ b/config/form_profile_mappings/10-7959F-1.yml @@ -2,9 +2,6 @@ veteran: dateOfBirth: [identity_information, date_of_birth] fullName: [identity_information, full_name] - first: [identity_information, first] - middle: [identity_information, middle] - last: [identity_information, last] physicalAddress: street: [contact_information, address, street] street2: [contact_information, address, street2] From a538c426e50df9bb14d170d28577f4b3cc9a5d4a Mon Sep 17 00:00:00 2001 From: Bryan Alexander Date: Wed, 1 May 2024 12:35:57 -0400 Subject: [PATCH 6/6] 80367: Add spec for form profile --- config/form_profile_mappings/10-7959F-1.yml | 17 +++++------------ spec/models/form_profile_spec.rb | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/config/form_profile_mappings/10-7959F-1.yml b/config/form_profile_mappings/10-7959F-1.yml index b10f4db1fe1..25c47a31be4 100644 --- a/config/form_profile_mappings/10-7959F-1.yml +++ b/config/form_profile_mappings/10-7959F-1.yml @@ -1,14 +1,7 @@ -veteran: - dateOfBirth: [identity_information, date_of_birth] - fullName: [identity_information, full_name] -physicalAddress: - street: [contact_information, address, street] - street2: [contact_information, address, street2] - city: [contact_information, address, city] - state: [contact_information, address, state] - country: [contact_information, address, country] - postalCode: [contact_information, address, postal_code] +veteranFullName: [identity_information, full_name] +veteranAddress: [contact_information, address] +veteranDateOfBirth: [identity_information, date_of_birth] veteranSocialSecurityNumber: [identity_information, ssn] -phoneNumber: [contact_information, us_phone] -emailAddress: [contact_information, email] \ No newline at end of file +veteranPhoneNumber: [contact_information, us_phone] +veteranEmailAddress: [contact_information, email] \ No newline at end of file diff --git a/spec/models/form_profile_spec.rb b/spec/models/form_profile_spec.rb index f6c9d2ddac8..c7e16b972eb 100644 --- a/spec/models/form_profile_spec.rb +++ b/spec/models/form_profile_spec.rb @@ -1815,5 +1815,20 @@ def expect_prefilled(form_id) instance2.prefill end end + + context '10-7959F-1 form profile instances' do + let(:instance) { FormProfile.new(form_id: '10-7959F-1', user:) } + + it 'loads the yaml file only once' do + expect(YAML).to receive(:load_file).once.and_return( + 'veteran_full_name' => %w[identity_information full_name], + 'veteran_address' => %w[contact_information address], + 'veteranSocialSecurityNumber' => %w[identity_information ssn], + 'phoneNumber' => %w[contact_information us_phone], + 'emailAddress' => %w[contact_information email] + ) + instance.prefill + end + end end end