Skip to content

Commit

Permalink
Adds country transform (#12801)
Browse files Browse the repository at this point in the history
  • Loading branch information
stiehlrod authored May 31, 2023
1 parent 80f5e1b commit 7c0e173
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def chg_addr_attributes
@pdf_data[:data][:attributes][:changeOfAddress] =
@auto_claim&.dig('changeOfAddress')&.deep_symbolize_keys

country = @pdf_data[:data][:attributes][:changeOfAddress][:country]
abbr_country = country == 'USA' ? 'US' : country
@pdf_data[:data][:attributes][:changeOfAddress][:country] = abbr_country

chg_addr_zip

@pdf_data
Expand All @@ -90,6 +94,11 @@ def veteran_info
@pdf_data[:data][:attributes].merge!(
identificationInformation: @auto_claim&.dig('veteranIdentification')&.deep_symbolize_keys
)

country = @pdf_data[:data][:attributes][:identificationInformation][:mailingAddress][:country]
abbr_country = country == 'USA' ? 'US' : country
@pdf_data[:data][:attributes][:identificationInformation][:mailingAddress][:country] = abbr_country

zip

@pdf_data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
expect(number_and_street).to eq('1234 Couch Street')
expect(apartment_or_unit_number).to eq('22')
expect(city).to eq('Portland')
expect(country).to eq('USA')
expect(country).to eq('US')
expect(zip).to eq('417261234')
expect(state).to eq('OR')
end
Expand Down Expand Up @@ -127,7 +127,7 @@
expect(number_and_street).to eq('10 Peach St')
expect(apartment_or_unit_number).to eq('Apt 1')
expect(city).to eq('Atlanta')
expect(country).to eq('USA')
expect(country).to eq('US')
expect(zip).to eq('422209897')
expect(state).to eq('GA')
end
Expand Down

0 comments on commit 7c0e173

Please sign in to comment.