feat(api): a guest's own bookings on both doors

GET /api/v1/bookings/mine (LNbits account auth; identity = the account's
Nostr pubkey, the same value the booking request carried) and RPC twin
chatelet_booking_list_mine (scoped by the signed sender_pubkey). Rows come
back newest check-in first via the m003 guest index, as guest_booking_dict:
the guest's own contact and counts, minus the Lightning/Nostr plumbing.
Declared ahead of /bookings/{booking_id} so 'mine' is not read as an id.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-09-16 12:17:39 +02:00
commit 8b816d83b0
8 changed files with 140 additions and 2 deletions

View file

@ -259,6 +259,16 @@ def public_booking_dict(booking: "Booking") -> dict:
return d
def guest_booking_dict(booking: "Booking") -> dict:
"""A Booking for the guest who owns it (authenticated by pubkey on either
door): everything public_booking_dict shows plus their own contact and
guest count; the Lightning/Nostr plumbing stays internal."""
d = json.loads(booking.json())
for k in ("payment_hash", "request_event_id", "reservation_event_id"):
d.pop(k, None)
return d
class AvailabilityQuery(BaseModel):
room_id: str
check_in: str # YYYY-MM-DD inclusive