Dayrate Booking
The dayrate domain is the Buildooor booking integration inside SPAPS. It coordinates availability, booking policies, free or allotment-backed booking paths, paid Stripe checkout, and webhook reconciliation so the frontend can treat dayrate booking as one coherent backend contract.
Mental Model
Primary Files
| File | Role |
|---|---|
domains/dayrate/router.py | Availability, booking, admin, and Stripe-backed route surface |
domains/dayrate/service.py | Booking policy, free/paid path selection, checkout orchestration, webhook dispatch |
domains/dayrate/repository.py | Persistence for bookings, policies, allotments, and related state |
domains/dayrate/models.py | DayRateBooking, BookingPolicy, and supporting models |
domains/dayrate/schemas.py | Request/response schemas such as BookRequest |
Booking Paths
| Path | Meaning |
|---|---|
| Free booking | Policy or entitlement allows booking without Stripe checkout |
| Allotment booking | Existing allowance is consumed instead of charging |
| Paid booking | SPAPS creates a Stripe checkout and reconciles completion through webhook handling |
Common Mistakes
Do not mark a paid booking complete from the browser redirect alone. Use Stripe webhook reconciliation so payment state comes from the trusted server-side event path.
- Treating booking policy as frontend-only logic.
- Forgetting to test paid, free, and allotment paths separately.
- Updating dayrate routes without checking the Buildooor proxy path in the downstream app.