From 297dc0012181137010ba5fcd9786de1761c4e651 Mon Sep 17 00:00:00 2001 From: lukaszreszke Date: Fri, 8 Sep 2023 13:13:34 +0200 Subject: [PATCH] Make reservation process synchronous Sometimes when an order is submit and the user is redirected to the /show view, the order state is Draft. This happens, because the order is not really submitted. First it is presubmitted, and then the reservation process checks whether there is enough stock. However, with how to UI is currently designed, the state of the order is not correct (it displays draft, as the process didn't manage to update it). --- ecommerce/processes/lib/processes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecommerce/processes/lib/processes.rb b/ecommerce/processes/lib/processes.rb index a3f8167b4..68d381c20 100644 --- a/ecommerce/processes/lib/processes.rb +++ b/ecommerce/processes/lib/processes.rb @@ -136,7 +136,7 @@ def enable_three_plus_one_free_process(event_store, command_bus) def enable_reservation_process(event_store, command_bus) event_store.subscribe( - ReservationProcess, + ReservationProcess.new, to: [ Ordering::OrderPreSubmitted, Ordering::OrderCancelled,