الحجوزات›معاينة الإدراج الطارئ + إعادة الجدولة المتتالية

معاينة الإدراج الطارئ + إعادة الجدولة المتتالية

يحسب (دون كتابة) تتابع إدراج عمل طارئ على فنّي في وقت مختار: أين يقع العمل الطارئ + كل عمل يُدفَع إلى الخلف، مجمّعًا حسب اليوم بالتوقيت المحلي للنشاط التجاري. أمّا `displacement_mode=reassign` فيسلّم كل عمل مُزاح إلى فنّي مجدٍ آخر في نافذته الأصلية (وعد نفس اليوم) — والأعمال التي لا تتوفّر لها سعة بديلة تعود إلى إعادة الجدولة وتبقى في `days`. يبقي `mode=overtime` الجميع في نفس اليوم (يعمل الفنّي لوقت متأخر)؛ ويدحرج `mode=next_day` الفائض إلى يوم (أيام) العمل التالية. للقراءة فقط — آمن للاستدعاء المتكرر؛ والتنفيذ نقطة نهاية منفصلة. ميزة معزولة (راجع EMERGENCY_RESCHEDULE_DESIGN.md). الخطوات التالية عند 409: EMERGENCY_RESCHEDULE_SLOT_OCCUPIED — نافذة الوصول محجوبة بعمل لا يجوز للتتابع تحريكه (P0 آخر، أو عمل طاقم أو متعدد الأيام): اختر فنّيًا آخر (اجتَز ترتيب /candidates) أو وقتًا آخر؛ الإزاحة لا تمسّ مراسي P0/الطاقم/متعدد الأيام أبدًا. EMERGENCY_RESCHEDULE_NOT_ELIGIBLE / CREW_UNSUPPORTED / NO_WORKING_DAY / IN_PAST — العلاجات نفسها كما في /candidates.

المعاملات

after_hours_overridebooleanbodyاختياري
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_modeenumbodyاختياري
مصير الأعمال المُزاحة: reschedule (الافتراضي — تُدفَع إلى نوافذ لاحقة) أو reassign (تُسلَّم إلى فنّي مجدٍ آخر في وقتها الأصلي؛ والأعمال التي لا سعة لها تعود إلى إعادة الجدولة).
emergency_job_idstringbodyاختياري
معرّف عمل P0 المراد إدراجه.
▾jobobjectbodyاختياري
A job that does not exist yet — the wizard's read-only preview before anything is written. Send this OR `emergency_job_id`.
▾addressobjectbodyاختياري
Service address for a caller who does not exist yet. Geocoded when it carries no coordinates.
citystringbodyاختياري
countrystringbodyاختياري
formattedstringbodyاختياري
latitudenumberbodyاختياري
linestringbodyاختياري
line2stringbodyاختياري
longitudenumberbodyاختياري
postal_codestringbodyاختياري
statestringbodyاختياري
customer_idstringbodyاختياري
UUID of an existing customer — their stored address is used. Send this OR `address`.
demobilization_minutesintegerbodyاختياري
Demobilization minutes after the work — same rules as mobilization_minutes.
job_duration_minutesintegerbodyاختياري
Hands-on work minutes. Optional when the job type carries a default.
job_type_idstringbodyاختياري
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_minutesintegerbodyاختياري
Mobilization minutes before the work — same fallback rules as quoteJobRequest.
skill_idsarray<string>bodyاختياري
UUIDs of skills the work needs. Optional; up to 20.
modeenumbodyمطلوب
وضع التتابع: overtime = تبقى الأعمال المُزاحة في نفس اليوم (يعمل الفنّي لوقت متأخر)؛ next_day = يُدحرَج الفائض إلى يوم العمل التالي.
start_atstringbodyمطلوب
وقت البدء المطلوب — تاريخ ووقت ساذج بالتوقيت المحلي للنشاط التجاري (مثل "2026-07-20T09:00:00"). يجب أن يكون في المستقبل.
technician_idstringbodyمطلوب
الفنّي المستهدف (يجب أن يكون تابعًا للنشاط التجاري).
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"
}'
نص الطلب
{
"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":
}

الاستجابات