From fde92924d1b9e73bcfee5367e01d664a65fb7e45 Mon Sep 17 00:00:00 2001 From: Thomas Blackwell Date: Mon, 25 Mar 2024 14:58:19 -0400 Subject: [PATCH] Pulling Form Profile Changes from branch ndbex-70721-map-form-fields --- app/models/form_profile.rb | 3 ++- app/models/form_profiles/va_21p530v2.rb | 33 +++++++++++++++++++++++++ config/features.yml | 9 +++---- lib/statsd_middleware.rb | 1 + 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 app/models/form_profiles/va_21p530v2.rb diff --git a/app/models/form_profile.rb b/app/models/form_profile.rb index 6cc8209e578..bfd47678896 100644 --- a/app/models/form_profile.rb +++ b/app/models/form_profile.rb @@ -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'], @@ -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, diff --git a/app/models/form_profiles/va_21p530v2.rb b/app/models/form_profiles/va_21p530v2.rb new file mode 100644 index 00000000000..4cdbdfe237e --- /dev/null +++ b/app/models/form_profiles/va_21p530v2.rb @@ -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 diff --git a/config/features.yml b/config/features.yml index 2b7e258d616..a29c648d723 100644 --- a/config/features.yml +++ b/config/features.yml @@ -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. @@ -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 @@ -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 \ No newline at end of file diff --git a/lib/statsd_middleware.rb b/lib/statsd_middleware.rb index 9b1f97c3be0..7d54281a381 100644 --- a/lib/statsd_middleware.rb +++ b/lib/statsd_middleware.rb @@ -61,6 +61,7 @@ class StatsdMiddleware avs burial-poc-v6 burials + burials-v2 check-in claims-status coe