How a booking calendar avoids double reservations
When two people choose the same slot, the server has to decide which booking can be confirmed.
Show available slots using recent data and check availability again on confirmation. If there is a conflict, offer the nearest free slots and preserve the visitor’s form entries.
Test the same slot from two browsers. Only one booking should be confirmed, and the other visitor should see a clear message and an alternative.
Worked example
For appointments of different lengths, check the whole interval. A 10:00–11:00 booking should block a 10:30 request for the same resource.
How to test it
Submit two partially overlapping requests at the same time using separate test accounts.
Expected result
Only one is saved. The other visitor sees an available alternative and keeps their existing form entries.