- Docs
- Specs
- Reservations
- Reservation deadline
Reservation Deadline¶
This page specifies the optional Trip reservation deadline enforced by Slice 4.
1. Rule¶
trips.reservation_deadline_atis optional (nullable).- When set, a booking request or approval at or before the deadline is allowed;
now == reservation_deadline_atis allowed. - When set, a booking request or approval after the deadline is rejected with
422anderrors.reservation_deadline_at. - When null, no deadline check applies.
- Managers have no override endpoint in Slice 4.
- Bookings carry no charge; deadline enforcement never creates a payment/refund path.
2. Validation and storage¶
- Managers may set/clear the deadline during Trip create or full update.
- A non-null deadline must be at or before
departure_at; otherwise create/update returns422 errors.reservation_deadline_at. - API request/response datetimes are ISO-8601 and responses are normalized to UTC.
- The check uses the server clock. Tests freeze the clock at the boundary.
3. Booking behavior¶
flowchart TD
B[Passenger requests or Manager approves] --> T{Trip has reservation_deadline_at?}
T -->|No| V[Continue booking validation]
T -->|Yes| C{Now <= reservation_deadline_at?}
C -->|Yes| V
C -->|No| R[422 reservation_deadline_at]
V --> A{Other booking rules pass?}
A -->|Yes| OK[Continue]
A -->|No| X[Rule-specific error]
A deadline edit does not silently approve or reject existing Bookings. Pending Bookings remain pending, but approval re-checks the current deadline. Starting a Trip rejects pending Bookings; cancelling a Trip cancels active Bookings.
4. Manager behavior and notifications¶
- The deadline is managed only through Trip create/update in Slice 4.
- No dedicated reminder or cutoff notification is implemented.
- Moving a deadline earlier can prevent approval of existing pending Bookings; affected-Passenger notification is not specified.
5. Open questions (future slices)¶
- Notifications: Reminder/cutoff/change notifications and their delivery catalog.
- Client display: Local timezone/display behavior beyond the API's UTC contract.
- Duplication: Whether duplication copies, clears, or reschedules the deadline.