What this appointment holds
PUT/api/bookings/:booking/resources
An appointment holds several things at once — the room, the device, the chair — and each is refused independently by a database exclusion constraint. A resource guarded only in application code is a room two people can be sent to: both requests read "free", both write.
Containers are added by the server, not asked for. Using the laser in
room 2 fills the room even though nobody chose it; the answer records
via_resource_id so a screen can show "Oda 2 (lazer aldı)" rather than
implying somebody picked it. A chair on an open floor adds nothing — the
resource itself says which it is.
Replaces the whole set: an appointment is re-allocated as a whole, and leaving yesterday's room held would block an hour nobody is using.
A container whose capacity was expanded into units cannot be held
directly (resource_has_units) — otherwise one booking takes the whole
room while three others sit in its chairs.
Request
Responses
- 200
- 409
- 422
The appointment, with everything it now holds.
resource_unavailable — already held. Names WHICH one (resource_id, resource_name), because only one leg of an intersection failed and the operator can usually change that leg rather than the hour.
resource_has_units — hold one of its units instead.