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:
parent
9ab52f2c69
commit
8b816d83b0
8 changed files with 140 additions and 2 deletions
|
|
@ -177,6 +177,13 @@ async def handle_booking_request(auth: None, request: NostrRpcRequest) -> dict:
|
|||
return _to_dict(quote)
|
||||
|
||||
|
||||
async def handle_booking_list_mine(auth: None, request: NostrRpcRequest) -> list[dict]:
|
||||
"""The caller's own bookings, scoped by the signed sender_pubkey."""
|
||||
if not request.sender_pubkey:
|
||||
raise PermissionError("chatelet: caller identity required")
|
||||
return await services.list_guest_bookings(request.sender_pubkey)
|
||||
|
||||
|
||||
async def handle_booking_get(auth: None, request: NostrRpcRequest) -> dict:
|
||||
booking = await crud.get_booking(_require_id(request))
|
||||
if not booking:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue