Inventory Reservation System
Purchase flow
1. Customer clicks Buy
The service checks whether the requested quantity is available.
2. Stock is reserved
If available, an order becomes RESERVED. Its units are held for 2 minutes by default while the customer pays.
3. Reservation ends
Payment succeeds →
Reserved stock moves to sold.CONFIRMEDCancel / payment fails →
Reserved stock returns to available.CANCELLED / PAYMENT_FAILEDUnpaid at the deadline →
The expiry worker returns stock to available.EXPIREDBackend activity
No recordingRun a scenario to record backend activity.