-
-
Notifications
You must be signed in to change notification settings - Fork 725
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 Orders: Calculate wholesale price for imported retail variants #13033
Conversation
Variant pricing looks good for me. 👍🏻 |
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 👍
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.
Great to see refactoring as you go, nice work!
There's one assumption I wasn't sure about, but I trust that you are ;)
|
||
wholesale_variant_price = transformation.offer.price | ||
|
||
return unless wholesale_variant_price |
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.
unless price is present? a number? positive?
I guess for all intents and purposes it doesn't matter, if it's truthy, we can assume in this context that it's valid? I'm not familiar with the price data structure so I can only assume.
But if we're going to do a division on it later, it might we worth checking it a bit more thoroughly.
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.
Yes, I was aware of that assumption. Thanks for checking though. It's either a number or nil.
Reviews and testing done, ready to merge! |
ℹ️ Funded Feature. Please track ALL ASSOCIATED WORK under the associated tracking code #11678 DFC Orders
What? Why?
In OFN, enterprises add fees on top of producer prices to cover their expenses. But when a DFC product is imported with its recommended retail price then the resulting price in the OFN shop is too high. In the current implementation, retail variants are not ordered in individually, they are ordered as bulk items with a cheaper wholesale price. Considering this backordering logic, we need to set the price of an imported retail variant to the wholesale cost price, calculated from the wholesale variant.
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