Take what this appointment used off the shelf
POST/api/bookings/:booking/consume
The loop the variants opened, closed: the resolver says what the work used — decided by WHO did it — and this writes the movements.
Idempotent because the database refuses the second write, not because the caller remembered. A double-click, a retry after a timeout and two open tabs all look the same from here. The answer reports how many rows were actually written, so a screen can say "already recorded" instead of a second success that reads like a second consumption.
Request
Responses
- 200
- 409
What was written.
no_stock_location — nowhere to take it from yet.