Files

15 lines
812 B
Plaintext

Happy path, one user at a time (show SH-1, 60 seats, hold TTL 5 minutes)
========================================================================
A1 at the start: AVAILABLE v0
startBooking(asha, A1+A2): BK-0001 PENDING_PAYMENT, Rs 440
A1 after the hold: HELD by BK-0001 until T+05:00 v1
A3 untouched: AVAILABLE v0
startBooking(ravi, A2+A3): refused (seats not available for show SH-1: [A2, A3])
A3 after ravi's refusal: AVAILABLE v0
pay(BK-0001): CONFIRMED, booking is CONFIRMED
A1 after payment: BOOKED by BK-0001 v2
seat summary: {AVAILABLE=58, BOOKED=2, HELD=0}
Same log produced by NaiveInventory, PessimisticInventory and OptimisticInventory: true