-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Clear order promotions in Omnes event #5754
Clear order promotions in Omnes event #5754
Conversation
deb6741
to
3b3877e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5754 +/- ##
=======================================
Coverage 88.87% 88.88%
=======================================
Files 708 709 +1
Lines 16825 16835 +10
=======================================
+ Hits 14953 14963 +10
Misses 1872 1872 ☔ View full report in Codecov by Sentry. |
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 pattern, that we should use more often
This adds a subscriber that removes all connected order promotions upon emptying the order. A future commit will emit the event instead of directly removing the join table records.
This is where it belongs.
3b3877e
to
914d1aa
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.
That's the way to go! Thanks again Martin!
Summary
This moves clearing the connected order promotions upon emptying an order into an
Omnes::Subscriber
. This saves us from having to overrideSpree::Order#empty!
in thesolidus_legacy_promotions
gem.Checklist
The following are mandatory for all PRs: