Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Address V3 country_code_iso2 params #19861

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/va_profile/models/v3/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def self.build_from(body)
bad_address: body['bad_address'],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed configs found in the AddressValidation docs.

city: body['city_name'],
country_name: body.dig('country', 'country_name'),
country_code_iso2: body.dig('country', 'iso_2_code'),
country_code_iso2: body.dig('country', 'country_code_iso2'),
country_code_iso3: body.dig('country', 'country_code_iso3'),
fipsCode: body.dig('country', 'fips_code'),
fips_code: body.dig('country', 'country_code_fips'),
county_code: body.dig('county', 'county_code'),
county_name: body.dig('county', 'county_name'),
created_at: body['create_date'],
Expand Down
2 changes: 1 addition & 1 deletion lib/va_profile/models/v3/validation_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def address_validation_req
cityName: @city,
zipCode5: @zip_code,
zipCode4: @zip_code_suffix,
country: { countryCodeISO2: @country_code_iso2, countryCodeISO3: @country_code_iso3,
country: { countryCodeISO3: @country_code_iso3,
countryName: @country_name, countryCodeFIPS: @country_code_fips },
state: { stateCode: @state_code, stateName: @state_name },
province: { provinceName: @province_name, provinceCode: @province_code },
Expand Down
2 changes: 0 additions & 2 deletions spec/lib/va_profile/models/v3/validation_address_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
'country' => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

country_code_iso2 was removed because the AddressValidationController does not permit country_code_iso2

'country_name' => 'United States',
'country_code_fips' => 'US',
'country_code_iso2' => 'US',
'country_code_iso3' => 'USA'
},
'geocode' => {
Expand Down Expand Up @@ -90,7 +89,6 @@
'country' => {
'country_name' => 'Canada',
'country_code_fips' => 'CA',
'country_code_iso2' => 'CA',
'country_code_iso3' => 'CAN'
},
'geocode' => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added country_code_fips back to this spec

'country' => {
'country_name' => 'United States',
'country_code_fips' => 'US',
'country_code_iso2' => 'US',
'country_code_fips' => 'US',
'country_code_iso3' => 'USA'
},
'address_pou' => 'RESIDENCE',
Expand Down
Loading