Preview emergency insert + cascade reschedule
previewEmergencyReschedulePreview the cascade of inserting an emergency job onto a technician, showing the emergency location and every job pushed back grouped by day. Read-only; supports overtime, next-day, and reassign modes.
Instructions
Preview emergency insert + cascade reschedule
Computes (WITHOUT writing) the cascade of inserting an emergency job onto a technician at a chosen time: where the emergency lands + every job pushed back, grouped per business-local day. displacement_mode=reassign instead hands each displaced job to another feasible technician at its ORIGINAL window (same-day promise) — jobs with no alternate capacity fall back to reschedule and stay in days. mode=overtime keeps everyone same-day (tech works late); mode=next_day rolls overflow to the next working day(s). Read-only — safe to call repeatedly; commit is a separate endpoint. Isolated feature (see EMERGENCY_RESCHEDULE_DESIGN.md).
409 NEXT STEPS: EMERGENCY_RESCHEDULE_SLOT_OCCUPIED — the landing window is blocked by a job the cascade may NOT move (another P0, a crew or multi-day job): choose another technician (walk the /candidates ranking) or another time; displacement never touches P0/crew/multi-day anchors. EMERGENCY_RESCHEDULE_NOT_ELIGIBLE / CREW_UNSUPPORTED / MULTIDAY_UNSUPPORTED / NO_WORKING_DAY / IN_PAST — same remedies as /candidates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Cascade mode: overtime = displaced jobs stay same-day (tech works late); next_day = overflow rolls to the next working day. | |
| start_at | Yes | Desired start — business-local naive datetime, no offset. Must be in the future. | |
| technician_id | Yes | Target technician (must belong to the business). | |
| idempotency_key | No | Optional idempotency key (forwarded as the Idempotency-Key header). Reuse the same value when retrying so the operation runs at most once. | |
| emergency_job_id | Yes | ID of the P0 job to insert. | |
| displacement_mode | No | Fate of displaced jobs: reschedule (default — pushed to later windows) or reassign (handed to another feasible technician at their ORIGINAL time; no-capacity jobs fall back to reschedule). |