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

Add name to Spree::Address #30

Closed
filippoliverani opened this issue Nov 22, 2019 · 6 comments
Closed

Add name to Spree::Address #30

filippoliverani opened this issue Nov 22, 2019 · 6 comments
Assignees

Comments

@filippoliverani
Copy link
Member

filippoliverani commented Nov 22, 2019

solidusio#3458

@filippoliverani filippoliverani self-assigned this Nov 22, 2019
@filippoliverani filippoliverani changed the title Remove firstname and lastname from adresses Add name to Spree::Address and deprecate firstname and lastname Nov 22, 2019
@filippoliverani
Copy link
Member Author

filippoliverani commented Nov 25, 2019

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

@filippoliverani
Copy link
Member Author

filippoliverani commented Nov 27, 2019

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

@filippoliverani
Copy link
Member Author

filippoliverani commented Nov 28, 2019

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.

@filippoliverani
Copy link
Member Author

filippoliverani commented Nov 29, 2019

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.

@filippoliverani
Copy link
Member Author

filippoliverani commented Dec 2, 2019

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.

@filippoliverani
Copy link
Member Author

I updated api docs to OpenAPI Specification 3 to be able to mark properties as deprecated in responses and inputs schemas.

@filippoliverani filippoliverani changed the title Add name to Spree::Address and deprecate firstname and lastname Add name to Spree::Address Jan 10, 2020
@elia elia closed this as completed Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants