-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Mark non-applicable promotion adjustments for destruction #6382
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
base: main
Are you sure you want to change the base?
Mark non-applicable promotion adjustments for destruction #6382
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6382 +/- ##
=======================================
Coverage 89.45% 89.45%
=======================================
Files 974 974
Lines 20322 20324 +2
=======================================
+ Hits 18179 18181 +2
Misses 2143 2143 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@mamhoff We started extracting some of the promotion related in-memory changes here. Please take a look and let us know if you think we're missing something. |
jarednorman
left a comment
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, but one wording suggestion.
promotions/app/models/solidus_promotions/order_adjuster/persist_discounted_order.rb
Outdated
Show resolved
Hide resolved
53cbf58 to
ce4745e
Compare
Instead of destroying. See code comments and spec changes. This is similar to how we handled this in the legacy promotion system. Co-authored-by: Adam Mueller <[email protected]> Co-authored-by: Alistair Norman <[email protected]> Co-authored-by: An Stewart <[email protected]> Co-authored-by: benjamin wil <[email protected]> Co-authored-by: Harmony Evangelina <[email protected]> Co-authored-by: Jared Norman <[email protected]> Co-authored-by: Nick Van Doorn <[email protected]> Co-authored-by: Senem Soy <[email protected]> Co-authored-by: Sofia Besenski <[email protected]>
When computing item totals after a line item benefit is removed, we need to ensure we aren't using the marked for destruction items. We also needed to make a change to the legacy promotion order updater patch because it is incorrectly being used in our tests even when using the new promotion system. It also did not have logic to ensure adjustments that were marked for destruction were ignored in the adjustment totals calculation. Co-authored-by: Jared Norman <[email protected]> Co-authored-by: Noah Silvera <[email protected]> Co-authored-by: Alistair Norman <[email protected]>
ce4745e to
3cb3bdf
Compare
Summary
This change attempts to extract some refactoring around marking records for
destruction instead of destroying them in order to reduce the number of round
trips to the database.
This was extracted from #5872.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: