feat: wire FX + deposit invoice into the booking hold (#3)

Booking requests now complete end-to-end over HTTP:

- _to_sats() converts fiat->sats via fiat_amount_as_satoshis (sat/sats
  pass through). This is the single conversion point; the result is the
  canonical amount_sat and is not recomputed downstream.
- api_request_booking creates a sats-denominated deposit invoice (locked
  amount, immune to FX drift before payment), tagged {tag:chatelet,
  booking_id} so tasks.on_invoice_paid matches the settle. On InvoiceError
  the hold is released (status=declined) so dead holds don't block dates.
- New BookingQuote response returns the held booking + bolt11 + hash.

Settlement (tasks.on_invoice_paid: awaiting_payment -> confirmed, dates
hard-blocked, reservation republished) was already in place and now fires
on real payments. Testable on FakeWallet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VUQCfdqiLSsFS2jcGnaFD
This commit is contained in:
Padreug 2026-07-19 00:26:14 +02:00
commit 4df137190f
2 changed files with 50 additions and 13 deletions

View file

@ -206,3 +206,14 @@ class AvailabilityResult(BaseModel):
quote_sat: int | None = None
quote_fiat: float | None = None
currency: str | None = None
class BookingQuote(BaseModel):
"""Response to a booking request: the held booking plus the bolt11 the
guest must pay to confirm it. payment_request covers deposit_sat (the
canonical amount already stored on the booking) the guest never re-
computes what they owe."""
booking: Booking
payment_request: str
payment_hash: str