solidusio / solidusio/solidus

Rework country/state handling around ISO 3166-2 subdivisions

Open
#3,842 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

changelog:solidus_core
Dominant language
Ruby
Stars
5.3k
Forks
1.4k
Avg merge
1d 22h
Merged PRs (30d)
62

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked issues and pull requests, then compare Solidus's current country/state data generation with Carmen and the ISO 3166-2 references cited in the issue. Done means there is an agreed path for subdivision data, field requirements, and any generic column or table migration.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.