de
Buchungen›Notfall-Einschieben + Kaskaden-Umplanung vorab anzeigen

Notfall-Einschieben + Kaskaden-Umplanung vorab anzeigen

Berechnet (OHNE zu schreiben) die Kaskade, die entsteht, wenn ein Notfallauftrag zu einer gewählten Zeit bei einem Techniker eingeschoben wird: wo der Notfall landet + jeder nach hinten geschobene Auftrag, gruppiert pro unternehmenslokalem Tag. `displacement_mode=reassign` übergibt stattdessen jeden verdrängten Auftrag an einen anderen machbaren Techniker in seinem URSPRÜNGLICHEN Fenster (Zusage am selben Tag) — Aufträge ohne alternative Kapazität fallen auf reschedule zurück und verbleiben in `days`. `mode=overtime` hält alle am selben Tag (Techniker arbeitet länger); `mode=next_day` verschiebt den Überlauf auf den/die nächsten Arbeitstag(e). Schreibgeschützt — kann bedenkenlos wiederholt aufgerufen werden; der Commit ist ein separater Endpoint. Isoliertes Feature (siehe EMERGENCY_RESCHEDULE_DESIGN.md). 409 NÄCHSTE SCHRITTE: EMERGENCY_RESCHEDULE_SLOT_OCCUPIED — das Landefenster ist durch einen Auftrag blockiert, den die Kaskade NICHT verschieben darf (ein weiteres P0, ein Team- oder mehrtägiger Auftrag): wählen Sie einen anderen Techniker (arbeiten Sie das /candidates-Ranking ab) oder eine andere Zeit; die Verdrängung berührt nie P0-/Team-/mehrtägige Anker. EMERGENCY_RESCHEDULE_NOT_ELIGIBLE / CREW_UNSUPPORTED / NO_WORKING_DAY / IN_PAST — dieselben Abhilfen wie bei /candidates.

Argumente

after_hours_overridebooleanbodyoptional
Place this P0 outside working hours / approved time-off — you have phoned the technician and they agreed. Drops the non-working-day rejection; the response then carries an AFTER_HOURS warning. Double-booking, service area, required skills and the lead-tier rule still reject.
displacement_modeenumbodyoptional
Schicksal der verdrängten Aufträge: reschedule (Standard — auf spätere Fenster verschoben) oder reassign (an einen anderen machbaren Techniker zu ihrer URSPRÜNGLICHEN Zeit übergeben; Aufträge ohne Kapazität fallen auf reschedule zurück).
emergency_job_idstringbodyoptional
ID des einzuschiebenden P0-Auftrags.
▾jobobjectbodyoptional
A job that does not exist yet — the wizard's read-only preview before anything is written. Send this OR `emergency_job_id`.
▾addressobjectbodyoptional
Service address for a caller who does not exist yet. Geocoded when it carries no coordinates.
citystringbodyoptional
countrystringbodyoptional
formattedstringbodyoptional
latitudenumberbodyoptional
linestringbodyoptional
line2stringbodyoptional
longitudenumberbodyoptional
postal_codestringbodyoptional
statestringbodyoptional
customer_idstringbodyoptional
UUID of an existing customer — their stored address is used. Send this OR `address`.
demobilization_minutesintegerbodyoptional
Demobilization minutes after the work — same rules as mobilization_minutes.
job_duration_minutesintegerbodyoptional
Hands-on work minutes. Optional when the job type carries a default.
job_type_idstringbodyoptional
UUID of the job type: supplies default_duration_minutes when job_duration_minutes is omitted. Optional — omitted, the business's default job type applies.
mobilization_minutesintegerbodyoptional
Mobilization minutes before the work — same fallback rules as quoteJobRequest.
skill_idsarray<string>bodyoptional
UUIDs of skills the work needs. Optional; up to 20.
modeenumbodyerforderlich
Kaskadenmodus: overtime = verdrängte Aufträge bleiben am selben Tag (Techniker arbeitet länger); next_day = Überlauf wird auf den nächsten Arbeitstag verschoben.
start_atstringbodyerforderlich
Gewünschter Start — unternehmenslokale naive Datetime (z. B. "2026-07-20T09:00:00"). Muss in der Zukunft liegen.
technician_idstringbodyerforderlich
Ziel-Techniker (muss zum Unternehmen gehören).
POST/v1/job-requests/emergency/preview
curl -X POST "https://api.crisphive.com/v1/job-requests/emergency/preview" \
  -H "Authorization: Bearer chsk_test_4eC8xQ9mZ2pL7Ka0rT" \
  -H "Content-Type: application/json" \
  -d '{
  "after_hours_override": true,
  "displacement_mode": "reschedule",
  "emergency_job_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
  "job": {
    "address": {
      "city": "San Francisco",
      "country": "US",
      "formatted": "123 Market Street, San Francisco, CA 94103",
      "latitude": 1,
      "line": "123 Market Street",
      "line2": "Suite 200",
      "longitude": 1,
      "postal_code": "94103",
      "state": "CA"
    },
    "customer_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
    "demobilization_minutes": 15,
    "job_duration_minutes": 90,
    "job_type_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
    "mobilization_minutes": 15,
    "skill_ids": [
      "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01"
    ]
  },
  "mode": "overtime",
  "start_at": "2030-06-14T09:00:00",
  "technician_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01"
}'
Anfragetext
{
"after_hours_override": ,
"displacement_mode": ,
"emergency_job_id": ,
"job": {
"address": {
"city": ,
"country": ,
"formatted": ,
"latitude": ,
"line": ,
"line2": ,
"longitude": ,
"postal_code": ,
"state":
},
"customer_id": ,
"demobilization_minutes": ,
"job_duration_minutes": ,
"job_type_id": ,
"mobilization_minutes": ,
"skill_ids": [
]
},
"mode": ,
"start_at": ,
"technician_id":
}

Antworten