-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pulling Form Profile Changes from branch ndbex-70721-map-form-fields
- Loading branch information
Showing
4 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ class StatsdMiddleware | |
avs | ||
burial-poc-v6 | ||
burials | ||
burials-v2 | ||
check-in | ||
claims-status | ||
coe | ||
|