Skip to content
Full-Stack Developer

Notes/PostgreSQL

Holding a seat without confirming it

2026-07-12

A library seat is not a cart item. If two people can pay for the last place, the second payment is a refund conversation. SITZY keeps unpaid bookings in pending_payment for ten minutes so the capacity is actually held. Confirm-payment re-checks availability excluding that hold. If the range filled in the meantime, the booking expires instead of confirming. Weekly and monthly plans are worse: one full day in the range should fail the whole booking and return the conflict dates. Availability is computed per calendar day, not as a single boolean on the workspace. QR check-in has the same class of bug on two devices. Scan is preview-only. Confirm reloads the row with SELECT … FOR UPDATE, re-runs eligibility, then writes checked_in. The second request gets a conflict. If the database does not lock the row, the UI will look correct and the occupancy will still be wrong.