Add structured data fields to Spree stores
Summary
This Commit provides the possibility to store legal information in the store resource. Given the wide array of different information required by country, the information stored here provides a baseline for most countries, but might need to be augmented in some jurisdictions. This commit is not meant as legal advisory. Inform yourself about eventual requirements in your country of operation.
Some additional information that might be needed:
- Legal Representative,
- Share Capital of the company,
- Contacts for privacy.
Schema.org has a schema to markup organizations that has been widely adopted by various search engines:
| https://schema.org/Organization Support / Docs | |
|---|---|
| Bing | https://www.bing.com/webmasters/help/?topicid=cc507c09 |
| https://developers.google.com/search/docs/appearance/structured-data/organization | |
| Yandex | https://yandex.com/support/webmaster/schema-org/what-is-schema-org.html |
This update allows to return all organization data on frontend via jsonb if implemented according to schema documentation on a per store basis and edit the data via API and Backend (Old / New).
The implemented fields are:
- legal_name,
- contact_email,
- contact_phone,
- vat_id,
- tax_id,
- address1,
- address2,
- Zip code and city,
- state_name,
- country_id,
- and state_id.
Some additional notes regarding the size of the commit: While this commit seems massive in size, no functionality has been added apart from storing the values, no logical changes have been made, hence the commit while bigger in size is simple to analyse. Apart from testing routines, this commit does not contain functional code. Where possible the structure of current address forms has been adopted.
Fixes https://github.com/solidusio/solidus/issues/6173
Screenshot
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
- [ ] I agree that my PR will be published under the same license as Solidus.
- [ ] I have written a thorough PR description.
- [ ] I have kept my commits small and atomic.
- [ ] I have used clear, explanatory commit messages.
The following are not always needed:
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.86%. Comparing base (
7d8a10d) to head (fc8e744).
Additional details and impacted files
@@ Coverage Diff @@
## main #6113 +/- ##
==========================================
+ Coverage 86.64% 88.86% +2.21%
==========================================
Files 514 838 +324
Lines 11894 18234 +6340
==========================================
+ Hits 10306 16203 +5897
- Misses 1588 2031 +443
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
- Please restructure the form order as in attached image
- contact email is missing on forms
- Save button should be at right top and right bottom as in figma (https://www.figma.com/design/h7eZRxh8KhPakTMr7c9NlB/Solidus-%E2%80%94-Admin-Dashboard?node-id=419-7816&p=f&t=u5VE4L1wTTlfzrkw-0)
- Make separate cards according to mock up for old backend
- Add context info to VAT-ID field: vat-id-hint for en.yml "Enter your VAT-ID without the Country Prefix (eg IT for Italy or DE for Germany) but solely the identification string."
@rahulsingh321 in future PRs I kindly ask you to follow @tvdeyen more on the commit structure. Commit 1: Add Columns Commit 2: Add API and API Description Commit 3: Add tests Commit 4: Add Admin UI Admin Backend Commit 4: Add Admin UI New Admin Backend
@tvdeyen @kennyadsl looks good to me I know it looks like a huge commit but it's only a couple of columns on stores without any logic other than altering the content. We also found a little bug in the formfields during the work that @chaimann had the courtesy to fix. I am making a change request against schema.org tonight hoping to alter it to reflect all legally required data across all jurisdictions but that depends on them to accept it.
@kennyadsl can we review this, it should be good to go.
@fthobe please stop framing PRs and issues "your way" in the PR title. Thanks.
@fthobe please stop framing PRs and issues "your way" in the PR title. Thanks.
@tvdeyen could you suggest a better name to get a hang of it? The resource is stores and the fields we add are the structured data fields. Please advise, not being condescending, trying to learn.
We should use the existing address form component, instead of introducing a second one. Also the PR adds a general new admin form for managing stores, which is very much appreciated, but this should at least be a dedicated commit the extra builds on top of and should no be combined into one commit, otherwise it is hard to see what the actual change (from your PR title) is.
We can separate the new admin from the rest.
@tvdeyen replied to your comments
@fthobe please stop framing PRs and issues "your way" in the PR title. Thanks.
@tvdeyen could you suggest a better name to get a hang of it? The resource is stores and the fields we add are the structured data fields. Please advise, not being condescending, trying to learn.
The name is ok, the "[Tag]"-Part is unnecessary
@tvdeyen I worked with the guys of schema to adjust the Organization tags a little and complete them for European entities as well and if no objections are raised that passes next week.
Was there anything else to complain about other than the address form?
Given the previous discussions the address list for me is a dead cow and I would like to store this in simple columns. Is that ok for you?
@tvdeyen do I close this or leave it open? It provides full imprint / impressum via the store resource. I extended the structured data model on schema as well.