Loading...
End-to-End Reserve Journey: 1. Uあser searches → 2. System holds a spot (Status: PENDING) → 3. User pays → 4. Payment Gateway sends callback → 5. System confirms reservation (Status: CONFIRMED).
Payment Handoff & Callback: The system hands off to a 3rd-party (e.g., Stripe) with a unique SessionID. Once paid, Stripe hits our Webhook endpoint. This ensures we don't rely on the client-side redirect for critical state changes.
Define the system constraints to ensure stability and performance.
| Category | Method | Endpoint | Description |
| Discovery | GET | /v1/lots/{id}/capacity | Check real-time availability and capacity. |
GET | /v1/price-quote | Get a price estimate based on duration and vehicle type. | |
| Booking | POST | /v1/reservations/hold | Place a 10-min tentative hold on a spot. |
POST | /v1/reservations/confirm | Finalize the booking after payment confirmation. | |
| Operations | POST | /v1/entry/check-in | Triggered by Gate Device when vehicle arrives. |
POST | /v1/exit/check-out | Triggered by Gate Device when vehicle leaves. | |
| Internal | POST | /v1/payments/callback |
Webhook for External Payment Provider.
PENDING record and holds the spot in Redis (TTL: 10m).To prevent lost revenue and idle spots:
CONFIRMED reservations where vehicle_arrived is null after 30 minutes of start_time.NO_SHOW.capacity check and hold operations to ensure low latency for users.commit is always written to the SQL DB with ACID transactions. If the cache is stale, the SQL DB constraint will reject the transaction, ensuring zero double-bookings.lot_id to prevent DB connection exhaustion during peak surges.POST request carries an Idempotency-Key. The Reservation Service checks this against Redis before processing to ensure retries don't create duplicate bookings.