-
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.
Ndbex 70721 map form fields (#15838)
* initial commit, add 530ez to repo * replace with new version * setup copies of 530 to prep for 530ez * setup tentative keys for veteran info * wip: updated fields for pages 1 and 2 * small changes, swapped forms * slight changes * renaming * prepare to toggle on form id * temporarily point at other branch * version 2 toggle * change to formV2 * update schema ref * experiment to get formV2 * update api to receive 21p-530v2, maintain form_id throughout process for burial and in progress forms * updated hash for temp branch * temporary update to schema ref * mapped a new pdf, small field updates * fix pdf telephone field. begin mapping values * relationship to veteran and final resting place * updates to pdf and methods filling in values * update schema ref * combine previous names and service * more pdf fill work * flipper for controller and model * fix lettering * update schema ref * small updates * fix overflow for both suffix fields and international phone number. add new test, tests still wip * unit tests * process option * rubocop * remove flipper check that interferes with other claim types * update with process option * better error handling for parse --------- Co-authored-by: Thomas Blackwell <[email protected]>
- Loading branch information
Showing
19 changed files
with
1,151 additions
and
11 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
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
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
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
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
Binary file not shown.
Oops, something went wrong.