Skip to content
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

In-memory order updater #5872

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d9914f2
Set tax adjustment amount without persistance
harmonymjb Jan 3, 2025
1d501dd
Mark adjustments for removal in OrderTaxation
Noah-Silvera Jan 10, 2025
001c16c
Ignore order adjustments marked for destruction
adammathys Jan 31, 2025
e590083
Add `db-query-matchers` gem
benjaminwil Oct 11, 2024
d1a3687
Copy existing `OrderUpdater` implementation
benjaminwil Oct 11, 2024
fe6839b
Add `persist` flag to `#recalculate`
benjaminwil Oct 11, 2024
e0ed371
Add describe block to Shipment#update_amounts test
Noah-Silvera Oct 25, 2024
a32dc65
Conditionally persist Shipment#update_amounts changes
Noah-Silvera Oct 25, 2024
bc61d6f
Preventing InMemoryOrderUpdater#update_shipment_amounts from making d…
Noah-Silvera Oct 25, 2024
66cb920
Rename method that recalculates shipment state
forkata Nov 8, 2024
0d335d2
Rename method that recalculates payment state
forkata Nov 8, 2024
e3d9cfb
Rename update_ private methods
AlistairNorman Nov 22, 2024
5a22afd
Rename recalculate_adjustments
AlistairNorman Nov 22, 2024
51765f8
Remove describe block for private method
AlistairNorman Nov 22, 2024
15f3a0f
Reorder private methods
AlistairNorman Nov 22, 2024
05bc3bf
Test that changes to item totals are respected
adammathys Jan 30, 2025
261aa22
Pass persist flag to legacy promotion recalculator
adammathys Jan 31, 2025
8fd0eb6
Pass persist to promotion.order_adjuster_class
sofiabesenski4 Dec 6, 2024
532a142
Support conditional persist in promotion chooser
AlistairNorman Feb 7, 2025
7abc583
[TODO] Add TODO so we know what to do
forkata Nov 8, 2024
b52d390
Rename order adjuster subject
Noah-Silvera Feb 14, 2025
5bbf0bd
Add missing Promotions::OrderAdjuster spec
Noah-Silvera Feb 14, 2025
c985cff
WIP: Improving the dry run functionality before implementing persist
Noah-Silvera Feb 14, 2025
7f7e255
WIP dealing with additional persistent in order_adjuster related classes
Noah-Silvera Feb 14, 2025
313454e
Set required line item attributes earlier
senemsoy Feb 28, 2025
07add2a
Don't persist line item on promotion application
senemsoy Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[TODO] Add TODO so we know what to do
  • Loading branch information
forkata authored and stewart committed Mar 7, 2025
commit 7abc58358b5c766d00be7bcf38dd8ce2b458ea2b
23 changes: 23 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
In-Memory Order Updater TODO
===

- [x] Add additional cases to item_total_updater_spec (doesn't currently account for included adjustments)
- [x] Consider Sofia's recommendation to break this class into POROs to simplify testing
- [x] Add test coverage for `recalculate_item_total` when line item totals change
- [x] Scope handling of tax adjustments in `InMemoryOrderUpdater` to *not* marked for destruction
- [x] Scope handling of tax adjustments in `OrderUpdater` to *not* marked for destruction
- [x] Ensure order-level tax adjustments (like Colorado delivery) are scoped out of tax total and adjustment total calculations
- [x] Handle persistence in `update_taxes`
- [x] ~Write the `InMemoryOrderAdjuster` (also, should we rename this to `InMemoryOrderPromotionAdjuster`)~
- [In Progress] Handle persistence in all implementations of `promotions.order_adjuster_class`
- Follow up on any failing test relating to change in promotion chooser
- Continue on with new promotion system similar change
- [ ] Investigate if any promotion actions write to the database when calling `compute_amount`
- Create quantity adjustments, this action persists when compute_amount is called
- [ ] Test coverage to ensure state changes aren't persisted (if someone changes current implementation)
- [ ] We should be able to blow up if something tries to persist
- https://github.com/sds/db-query-matchers/blob/0deaaac360f43e6cc15c03a7fca8425cf65dd703/lib/db_query_matchers/make_database_queries.rb#L74-L82
- https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html#method-c-subscribed
- "By calling this in memory order updater, we are making a contract with the user that it will be in memory"
- "This is really something which theoretically should be covered in tests"