Skip to content

Commit

Permalink
Pulling Form Profile Changes from branch ndbex-70721-map-form-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tblackwe committed Mar 25, 2024
1 parent 3a83f6c commit fde9292
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/models/form_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class FormProfile
22-5495 22-0993 22-0994 FEEDBACK-TOOL 22-10203 22-1990S 22-1990EZ],
evss: ['21-526EZ'],
hca: %w[1010ez 10-10EZR],
pension_burial: %w[21P-530 21P-527EZ],
pension_burial: %w[21P-530 21P-527EZ 21P-530V2],
dependents: ['686C-674'],
decision_review: %w[20-0995 20-0996 10182],
mdot: ['MDOT'],
Expand Down Expand Up @@ -121,6 +121,7 @@ class FormProfile
'22-5490E' => ::FormProfiles::VA5490e,
'22-5495' => ::FormProfiles::VA5495,
'21P-530' => ::FormProfiles::VA21p530,
'21P-530V2' => ::FormProfiles::VA21p530v2,
'21-686C' => ::FormProfiles::VA21686c,
'686C-674' => ::FormProfiles::VA686c674,
'40-10007' => ::FormProfiles::VA4010007,
Expand Down
33 changes: 33 additions & 0 deletions app/models/form_profiles/va_21p530v2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

require 'iso_country_codes'

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

def prefill
@identity_information = initialize_identity_information
@contact_information = initialize_contact_information
if @contact_information&.address&.country.present?
@contact_information.address.country = convert_to_iso2(@contact_information.address.country)
end
mappings = self.class.mappings_for_form(form_id)

form_data = generate_prefill(mappings) if FormProfile.prefill_enabled_forms.include?(form_id)

{ form_data:, metadata: }
end

private

def convert_to_iso2(country_code)
code = IsoCountryCodes.find(country_code)
code.alpha2
end
end
9 changes: 4 additions & 5 deletions config/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,9 @@ features:
va_view_dependents_access:
actor_type: user
description: Allows us to gate the View/ Modify dependents content in a progressive rollout
va_burial_v2:
actor_type: user
description: Allows us to toggle between 21-P530 and 21-P530V2
show_edu_benefits_1990EZ_Wizard:
actor_type: user
description: Navigates user to 1990EZ or 1990 depending on form questions.
Expand Down Expand Up @@ -1285,10 +1288,6 @@ features:
actor_type: user
description: NOD VANotify notification callbacks endpoint
enable_in_development: true
pension_ipf_callbacks_endpoint:
actor_type: user
description: Pension IPF VANotify notification callbacks endpoint
enable_in_development: true
hlr_browser_monitoring_enabled:
actor_type: user
description: HLR Datadog RUM monitoring
Expand Down Expand Up @@ -1349,4 +1348,4 @@ features:
Disabled - Requests are not handled. Server returns a 503 (Service Unavailable) until re-enabled.
yellow_ribbon_automated_date_on_school_search:
actor_type: user
description: Enable the automated date displayed in the Find a Yellow Ribbon school search results
description: Enable the automated date displayed in the Find a Yellow Ribbon school search results
1 change: 1 addition & 0 deletions lib/statsd_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class StatsdMiddleware
avs
burial-poc-v6
burials
burials-v2
check-in
claims-status
coe
Expand Down

0 comments on commit fde9292

Please sign in to comment.