-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
[DFC API] add image to product #11756
[DFC API] add image to product #11756
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I would try to keep the docs reproducible but otherwise it's all good.
@@ -14,6 +14,7 @@ def self.supplied_product(variant) | |||
productType: product_type, | |||
quantity: QuantitativeValueBuilder.quantity(variant), | |||
spree_product_id: variant.product.id, | |||
image_url: variant.product&.image&.url(:product) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On production, this will directly link to AWS S3. And in order to do that for variants, it will process the image first. That shouldn't be a problem because all images should be processed already. Just flagging it here in case there's some performance issue later.
swagger/dfc.yaml
Outdated
@@ -343,11 +343,12 @@ paths: | |||
dfc-b:usageOrStorageCondition: '' | |||
dfc-b:totalTheoreticalStock: 0.0 | |||
ofn:spree_product_id: 90000 | |||
ofn:image: http://test.host/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZzBCIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cec5b9e04720cada9134f6757e3dd8156aeccbf0/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MWm05eWJXRjBTU0lJY0c1bkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFId2FRSHciLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--a8632e6a563a139dfae774530b275266f6aef5f5/logo-white.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value may change every time we generate the documentation. In other specs, I replaced variable values with a fixed value so that we don't see random changes.
dfc-b:stockLimitation: 0 | ||
dfc-b:stockLimitation: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's due to the different factory used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thought it seems worth checking if the FileHelper commit can be removed as per Maikel's comment.
That should be easy to try. Trying...
Temporary solution as we wait for the DFC connector to be updated to support "dfc_b:image" for SuppliedProduct
94aae11
to
f76bdf0
Compare
ℹ️ This is a funded feature :
11242 Discovery Endpoints
- including testing, code review etc11242 Task within Macdoch Regen Discovery
What? Why?
As explained on the issue, we don't think DFC can make image available on supplied product in a timely manner. So we work around that by adding a ofn specific identifier "ofn:image". It will eventually be replace by "dfc_b:image" in the DFC connector.
This is read only, we don't support adding a product with an image
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