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

Fix the country/state handling #3842

Open
elia opened this issue Nov 13, 2020 · 1 comment
Open

Fix the country/state handling #3842

elia opened this issue Nov 13, 2020 · 1 comment
Labels
type:bug Error, flaw or fault

Comments

@elia
Copy link
Member

elia commented Nov 13, 2020

Is your feature request related to a problem? Please describe.

This is an umbrella issue on top of:

After some research seems that in ISO terms, what Solidus is trying to map is subdivisions as defined in ISO-3166-2 (https://en.wikipedia.org/wiki/ISO_3166-2, https://www.iso.org/iso-3166-country-codes.html#2012_iso3166-2).

As clearly noticed by some of the issues the term state is not right for most countries. In addition to that the way we're fetching data from Carmen might not match the correct subdivision level, or we might be requiring a "state" presence when we shouldn't.

Describe the solution you'd like

A path forward for this would be to fix the data generation basing it on the subdivisions as defined in ISO 3166-2 and maybe err on the side of not requiring the field presence unless we're 100% sure it's the right thing.

With time the database column should probably be migrated to a name that's more generic, like "subdivision" or "principal_subdivision".

A way of obtaining a list of all subdivisions should be found within Carmen (maybe contributing it back) or elsewhere. In the latter case the best candidate seems to be the iso-codes Debian package (https://salsa.debian.org/iso-codes-team/iso-codes/).

Describe alternatives you've considered

I had a look at existing gems referring to ISO-3166, none of them seem reassuringly maintained or with the data we need, best bet would be to add that into Carmen itself, given its popularity.

Additional context

On a similar topic would be great to have a pluggable system of address-validation with a storage that's enough generic to cover all the address variations of the world, possibly removing altogether the countries and states tables, delegating the whole thing outside of Solidus.

@elia
Copy link
Member Author

elia commented Nov 7, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error, flaw or fault
Projects
None yet
Development

No branches or pull requests

2 participants