Background
Solidus 3.0 collapsed firstname/lastname on Spree::Address into a single name column (#3234). That remains the right default, but some stores (notably in EU markets, see #6110) need a separate given name for e-invoicing and for third-party services that require split names. Some stores use solidus_address_name or your their own customizations to extract names from addresses.
#6159 attempted to bring split names back into core, and the discussion there produced a design the core team agreed on. That PR has gone stale, so this issue captures the agreed design so a fresh PR can be written against it.
Agreed upon design
- Reintroduce
first_name only. The existing name column stays and doubles as the last name when the feature is enabled. We do not reintroduce lastname.
- Control the feature with a
Spree::Config preference that defaults to the current unified approach. Stores that continue to use a single name field must see no change in behaviour at all.
first_name is optional by default. Stores can add a validation to require if need be, but let's all remember the Falsehoods Programmers Believe About Names.
- If a store enables the flag, existing
name values are left untouched and first_name is simply empty until filled in.
- Backwards compatible for existing stores. The
firstname column still exists in the schema. Whether we reuse it (and un-ignore it) or add a new first_name column can be decided in the PR, but any change must not require action from stores that leave the flag off.
Out of scope
- Any data migration between single and split names. Stores that switch modes are responsible for their own data.
Related
Background
Solidus 3.0 collapsed
firstname/lastnameonSpree::Addressinto a singlenamecolumn (#3234). That remains the right default, but some stores (notably in EU markets, see #6110) need a separate given name for e-invoicing and for third-party services that require split names. Some stores use solidus_address_name or your their own customizations to extract names from addresses.#6159 attempted to bring split names back into core, and the discussion there produced a design the core team agreed on. That PR has gone stale, so this issue captures the agreed design so a fresh PR can be written against it.
Agreed upon design
first_nameonly. The existingnamecolumn stays and doubles as the last name when the feature is enabled. We do not reintroducelastname.Spree::Configpreference that defaults to the current unified approach. Stores that continue to use a single name field must see no change in behaviour at all.first_nameis optional by default. Stores can add a validation to require if need be, but let's all remember the Falsehoods Programmers Believe About Names.namevalues are left untouched andfirst_nameis simply empty until filled in.firstnamecolumn still exists in the schema. Whether we reuse it (and un-ignore it) or add a newfirst_namecolumn can be decided in the PR, but any change must not require action from stores that leave the flag off.Out of scope
Related
firstname/lastname)