Skip to content

Commit

Permalink
Make reservation process synchronous
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
lukaszreszke committed Sep 8, 2023
1 parent 453988c commit 297dc00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ecommerce/processes/lib/processes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 297dc00

Please sign in to comment.