-
-
Notifications
You must be signed in to change notification settings - Fork 729
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 DFC product groups with variants #13148
Open
mkllnk
wants to merge
15
commits into
openfoodfoundation:master
Choose a base branch
from
mkllnk:dfc-variants
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+677
−904
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A while ago I was told that an absent stock limitation means unlimited stock. But that can't be distinguished from just not wanting to update the stock level. In the meantime, a new stock policy model was proposed. But for now we have a workaround, setting `-1` as value for unlimited stock. * datafoodconsortium/ontology#112
Our Spree::Product corresponds to a DFC SuppliedProduct with variants.
It just makes Rswag specs look more different to other request specs and I found that discouraging. It's good to know that the parameter is just specified with `let` and that it works exactly in the same way as `let` in other specs. The downside is maybe that it's not obvious that those `let` statements have to correspond with the parameters for the request but error messages will tell you if you got it wrong. And there's also the `parameter` declaration to make that clear.
When importing another catalog, it's probably referring to external product groups. Storing the external link allows us to group several variants and replicate the same structure within OFN.
And when we import a catalog, we don't try to import those product groups as Spree::Variant. We just see them as reference to Spree::Product.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What? Why?
Within OFN we have products and variants. Customers order variants. Several variants belong to a product so that they can be grouped in the shop front. Another name for a product stored as
Spree::Product
is a product group. And the variants stored asSpree::Variant
correspond generally to a DFC product. So the naming gets really confusing.The DFC now introduced a product-variant mapping as well and we use it to map our product-variant mapping.
Spree::Product
is a DFCSuppliedProduct
with thehasVariant
attribute.Spree::Variant
is a DFCSuppliedProduct
with theisVariantOf
attribute.With this new structure, we can get rid of our custom
ofn:spree_product_id
attribute.Now we are also able to set a name and description for Spree::Product independent of the variant's name.
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates