Booking correctness under concurrency
Keeping stock and availability correct when several people book the same tickets or stays at once.
Context
An event platform selling stays, festival tickets and match-related experiences.
Problem
Bookings had to keep stock and availability correct across states (pending payment, paid, cancelled, refunded), especially when several users tried to book the same tickets or stays at the same time.
Approach
Validate before continuing
I added backend validation and stock-synchronisation logic that checks the current booking state and updates availability before the user continues.
Tell the user what changed
I updated the React frontend to give clear feedback when availability changed in the middle of a booking.
Outcome
A lower risk of incorrect stock, double bookings and outdated availability, making the platform more reliable for customers and for the business.
