feat(api): keyless unavailable-ranges feed for the guest calendar #21

Merged
padreug merged 1 commit from feat/unavailable-ranges into main 2026-09-21 09:05:34 +00:00
Owner

Keyless GET /api/v1/public/rooms/{id}/unavailable?start=&end= and its RPC twin chatelet_room_unavailable: the nights a guest cannot book over a window (default today to +365 days, capped at 400). Occupying bookings, live holds included so it always agrees with POST /availability, and manual blocks are clipped, sorted and coalesced into anonymous half-open spans. Adjacent spans merge on purpose so a guest cannot tell where one occupant's dates end and the next begin, nor a block from a stay.

Feeds the webapp's new stay calendar (aiolabs/webapp feat/chatelet-stay-calendar). is_available now uses the OCCUPYING_STATUSES constant it was inlining.

Stacked on #20 (the v0.4.1 hotfix); rebases to a single commit once that merges.

Keyless GET /api/v1/public/rooms/{id}/unavailable?start=&end= and its RPC twin chatelet_room_unavailable: the nights a guest cannot book over a window (default today to +365 days, capped at 400). Occupying bookings, live holds included so it always agrees with POST /availability, and manual blocks are clipped, sorted and coalesced into anonymous half-open spans. Adjacent spans merge on purpose so a guest cannot tell where one occupant's dates end and the next begin, nor a block from a stay. Feeds the webapp's new stay calendar (aiolabs/webapp feat/chatelet-stay-calendar). is_available now uses the OCCUPYING_STATUSES constant it was inlining. Stacked on #20 (the v0.4.1 hotfix); rebases to a single commit once that merges.
v0.4.0's merge of public_booking_dict landed inside AvailabilityQuery and
left the two date fields orphaned after the helper's return, so
POST /api/v1/availability raised AttributeError on q.check_in (500) on
every install of that version. The RPC door reads the raw body and was
unaffected, which is why nothing noticed.

Put the helper next to public_room_dict and add a regression test that
constructs the query model and drives the endpoint through the
services layer.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
GET /api/v1/public/rooms/{id}/unavailable?start=&end= and its RPC twin
chatelet_room_unavailable return the nights a guest cannot book over a
window (default today → +365 d, capped at 400 d): occupying bookings —
live holds included, so the feed always agrees with POST /availability —
and manual blocks, clipped, sorted and coalesced into anonymous half-open
spans. Adjacent spans merge on purpose so a guest cannot tell where one
occupant's dates end and the next begin, nor a block from a stay.

is_available now uses the OCCUPYING_STATUSES constant it was inlining.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
padreug deleted branch feat/unavailable-ranges 2026-09-21 09:05:34 +00:00
padreug referenced this pull request from a commit 2026-09-21 09:06:35 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/chatelet!21
No description provided.