Mark non-applicable promotion adjustments for destruction#6382
Merged
tvdeyen merged 2 commits intosolidusio:mainfrom Nov 27, 2025
Merged
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:
|
Contributor
Author
|
@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. |
mamhoff
approved these changes
Nov 21, 2025
jarednorman
approved these changes
Nov 24, 2025
Member
jarednorman
left a comment
There was a problem hiding this comment.
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 <adam@super.gd> Co-authored-by: Alistair Norman <alistair@super.gd> Co-authored-by: An Stewart <andrew@super.gd> Co-authored-by: benjamin wil <benjamin@super.gd> Co-authored-by: Harmony Evangelina <harmony@super.gd> Co-authored-by: Jared Norman <jared@super.gd> Co-authored-by: Nick Van Doorn <nick@super.gd> Co-authored-by: Senem Soy <senem@super.gd> Co-authored-by: Sofia Besenski <sofia@super.gd>
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 <jared@super.gd> Co-authored-by: Noah Silvera <noah@super.gd> Co-authored-by: Alistair Norman <alistair@super.gd>
ce4745e to
3cb3bdf
Compare
5 tasks
This file contains hidden or 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
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.
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: