diff --git a/ecommerce/processes/lib/processes/reservation_process.rb b/ecommerce/processes/lib/processes/reservation_process.rb index 946ed967..e13532c6 100644 --- a/ecommerce/processes/lib/processes/reservation_process.rb +++ b/ecommerce/processes/lib/processes/reservation_process.rb @@ -10,12 +10,12 @@ def initialize def call(event) state = build_state(event) - case event.event_type - when 'Ordering::OrderSubmitted' + case event + when Ordering::OrderSubmitted update_order_state(state) { reserve_stock(state) } - when 'Fulfillment::OrderCancelled' + when Fulfillment::OrderCancelled release_stock(state) - when 'Fulfillment::OrderConfirmed' + when Fulfillment::OrderConfirmed dispatch_stock(state) end end