Skip to content

Commit

Permalink
80367: Add form profile for 10-7959F-1
Browse files Browse the repository at this point in the history
  • Loading branch information
balexandr committed Apr 22, 2024
1 parent bce3813 commit b802553
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/models/form_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions app/models/form_profiles/va_107959f1.rb
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions config/form_profile_mappings/10-7959F-1.yml
Original file line number Diff line number Diff line change
@@ -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]
3 changes: 3 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ adapted_housing:
intent_to_file:
prefill: true

ivc_champva:
prefill: true

# Settings for Expiry Scanner
expiry_scanner:
slack:
Expand Down
30 changes: 30 additions & 0 deletions spec/models/form_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit b802553

Please sign in to comment.