Module: Pricing
- Defined in:
- app/subscribers/pricing/discount_level_changed_handler.rb
Overview
Subscribes to Events::DiscountLevelChanged. Replaces the legacy
Customer#propagate_discount_level after_update callback by collecting
every open quote/order belonging to the customer and dispatching
ItemizableDiscountResetWorker per item.
Runs asynchronously via ActiveJob (prepends RailsEventStore::AsyncHandler)
so the HTTP request that triggered the pricing change is not blocked by
potentially expensive repricing of many open itemizables.
Wired in config/initializers/event_store.rb. Also callable directly via
call_for by Merger::CustomerMerger after merging duplicates.
Defined Under Namespace
Classes: DiscountLevelChangedHandler