Add name to Spree::Address
filippoliverani opened this issue · 6 comments
I created a migration to add name
with firstname
, space
and lastname
concatenation.
I addeed a rake task to backfill and index name
column to leave more control over data migration, it could be time consuming on large db.
filippoliverani@c2bb23b
To favor backward compatibility during deprecation period, writes on firstname
and lastname
update name
too. Writes on name
keeps firstname
and lastname
updated splitting on the first space to have a fallback during deprecation period.
Presence validation on firstname
and name
has been updated accordingly.
I updated Address to considered in lookup, merge and equality only non deprecated attributes. I added a Spree::Name
value object to handle name parsing during deprecation period. I replaced all deprecated attributes occurrences in core with name
.
I added the preference flagshow_deprecated_attributes
to leave the possibility of viewing deprecated attributes in API responses (and potentially anywhere else) and ease the way to the upgrade.
filippoliverani@1554586
I introduced deprecation warnings on firstname
, lastname
and full_name
and updated all specs to be more specific when checking expectaions on Spree::Deprecations
mocks to avoid overlapping warnings.
I replaced all deprecated attributes occurrences in api with name. APIs responses show firstname
and lastname
only if show_deprecated_attributes
is set to true
.
I replaced all deprecated attributes occurrences in frontend and backend with name. Deprecated fields are rendered in HTML views and APIs responses views instead of name
field only when show_deprecated_attributes
preference is set to true.
I updated api docs to OpenAPI Specification 3 to be able to mark properties as deprecated in responses and inputs schemas.