API-26710-pdf-mapping-country-code #12801
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Discovery: BRD returns "USA" in the countries list for the US. With that being said, the gem lists it as "United States of America" so it would never locate the United States and be able to provide an alpha2 value. We also see 36 of the 213 retrieved countries fail during lookup using the gem, so it seems that trying to utilize the gem for this scenario is unfortunately not an effective approach.
"Solution": Hardcode the translation for US to be from "USA" to "US" and provide that. If not, send the entire string provided in the request (as long as it aligns with a valid country from BRD).
Reasoning: If the PDF service detects a 2 char code, it will apply it to the Country Code, if it senses anything more, it will apply the entirety of the name to the overflow page.
Related issue(s)
Testing done
What areas of the site does it impact?
Acceptance criteria