Skip to main content

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​

The appointment, with everything it now holds.