-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Deprecate promotion "level" #6357
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6357 +/- ##
==========================================
- Coverage 89.35% 89.35% -0.01%
==========================================
Files 961 961
Lines 20173 20182 +9
==========================================
+ Hits 18026 18034 +8
- Misses 2147 2148 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4189a32 to
9a10920
Compare
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.
Thanks. Can you adjust the commit message of the removal commit?
promotions/app/models/solidus_promotions/order_adjuster/discount_order.rb
Show resolved
Hide resolved
9a10920 to
1528db6
Compare
The `LineItemLevelCondition`, `OrderLevelCondition`, and `ShipmentLevelCondition` concerns are awkwardly named, and there's no adequate thing for conditions that target shipments and shipping rates with this system (let alone something for prices). With the previous commit in place and solidusio#6357, we can fully deprecate these modules for Solidus 5. What this does is: If a condition includes any of the modules and defines the `eligible?` method, we emit a deprecation warning telling the implementer to stop including the module and rename their method. That way the `respond_to?` logic from the base class kicks in, and we can remove the awkward API.
The `LineItemLevelCondition`, `OrderLevelCondition`, and `ShipmentLevelCondition` concerns are awkwardly named, and there's no adequate thing for conditions that target shipments and shipping rates with this system (let alone something for prices). With the previous commit in place and solidusio#6357, we can fully deprecate these modules for Solidus 5. What this does is: If a condition includes any of the modules and defines the `eligible?` method, we emit a deprecation warning telling the implementer to stop including the module and rename their method. That way the `respond_to?` logic from the base class kicks in, and we can remove the awkward API.
The `LineItemLevelCondition`, `OrderLevelCondition`, and `ShipmentLevelCondition` concerns are awkwardly named, and there's no adequate thing for conditions that target shipments and shipping rates with this system (let alone something for prices). With the previous commit in place and solidusio#6357, we can fully deprecate these modules for Solidus 5. What this does is: If a condition includes any of the modules and defines the `eligible?` method, we emit a deprecation warning telling the implementer to stop including the module and rename their method. That way the `respond_to?` logic from the base class kicks in, and we can remove the awkward API.
The `LineItemLevelCondition`, `OrderLevelCondition`, and `ShipmentLevelCondition` concerns are awkwardly named, and there's no adequate thing for conditions that target shipments and shipping rates with this system (let alone something for prices). With the previous commit in place and solidusio#6357, we can fully deprecate these modules for Solidus 5. What this does is: If a condition includes any of the modules and defines the `eligible?` method, we emit a deprecation warning telling the implementer to stop including the module and rename their method. That way the `respond_to?` logic from the base class kicks in, and we can remove the awkward API.
This method is part of the interface, but not actually used anywhere. Let's remove it before it starts getting used.
We can find out if a benefit can `:perform` itself by asking exactly that. The adjusting benefits - `AdjustLineItem` and `AdjustShipment` - respond to `:discount`. The only benefit that can `:perform` is the `CreateLineItem` benefit.
This just adds to the complexity of the benefit interface, and does not provide anything to the codebase. Let's remove before it starts being used.
1528db6 to
b304ce1
Compare
Summary
The concept of a promotion condition "level" is useful as a concept, but it's not useful in code (as evidenced by the ability to just remove it with one minor change in the codebase).
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: