department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
281 stars 202 forks source link

Add methods to tell if address is in USA to Simple Forms models #79708

Closed marywang2 closed 5 months ago

marywang2 commented 6 months ago

Summary This PR updates the Simple Forms form models so that they have a method, zip_code_is_us_based, which can tell the metadata validator if the address is based in the USA. Up until now, we've been operating under the assumption that all addresses are US-based but that isn't always going to be the case.

Related issue(s) https://app.zenhub.com/workspaces/vagov-product-team-forms-634853151f5c6000165942bc/issues/gh/department-of-veterans-affairs/va.gov-team/72916

https://github.com/department-of-veterans-affairs/vets-api/pull/16152

balexandr commented 5 months ago

This PR is up for team review currently. I didn't do exactly what SimpleForms did because it felt clunky passing along an arg that simple so I wrote it a bit differetly.

balexandr commented 5 months ago

This has been merged and can be closed.