الحجوزات›ترتيب الفنّيين لإدراج طارئ من فئة P0

ترتيب الفنّيين لإدراج طارئ من فئة P0

تُرجع الفنّيين الذين يمكنهم تولّي العمل الطارئ في وقت البدء المطلوب، مرتّبين حسب الأسرع وصولًا أولًا (الوصول يتقدّم على كفاءة المسار في حالة P0). تحمل الاستجابة أيضًا `crew_recommendation` تاريخيًا (الحجم الوسيط للطاقم في أعمال مكتملة مماثلة + إخلاء مسؤولية إلزامي — AC-2). الفنّيون المحجوزون يظلّون مرشّحين — يحمل كل مدخل معاينة الإزاحة (أي الأعمال الأدنى أولوية التي ستُدفع، لكل يوم) التي سيسبّبها الالتزام بهم؛ total_moves=0 يعني خانة حرّة. أعمال P0 لا تُزاح أبدًا؛ وP1 لا يُزاح إلا بواسطة P0. يُقدَّر وقت الوصول من موقع بدء الفنّي (بلا GPS مباشر). مرّر technician_id المختار إلى emergency/preview + emergency/commit. الخطوات التالية عند 409: EMERGENCY_RESCHEDULE_NOT_ELIGIBLE — لا يمكن إدراج العمل كطارئ (ليس P0، أو بدأ/اكتمل/أُرشِف بالفعل، أو غير مسعّر): صحّح حالة العمل أو استخدم تأكيدًا عاديًا. EMERGENCY_RESCHEDULE_CREW_UNSUPPORTED — أعمال الطاقم لا يمكنها استخدام مسار الطوارئ (الإصدار v1): وفّر الطاقم عبر confirm/reassign بدلًا من ذلك. EMERGENCY_RESCHEDULE_NO_WORKING_DAY — التاريخ المختار لا يتضمّن ساعات عمل: اختر يوم عمل. EMERGENCY_RESCHEDULE_IN_PAST — وقت البدء مضى بالفعل: اختر وقتًا في المستقبل.

المعاملات

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.
emergency_job_idstringbodyمطلوب
ID of the P0 job to place.
limitintegerbodyاختياري
الحد الأقصى للمرشّحين المُرجَعين (الافتراضي 5، الحد الأقصى 10).
modeenumbodyمطلوب
Cascade mode each candidate's displacement preview assumes: overtime = displaced jobs stay same-day; next_day = overflow rolls to the next working day.
start_atstringbodyمطلوب
Desired start — business-local wall clock. Seconds may be omitted and a space may replace the T; an offset is accepted only when it agrees with the business timezone (a disagreeing one is refused with JOB_REQUEST_INVALID_INPUT rather than guessed). Must be in the future.
POST/v1/job-requests/emergency/candidates
curl -X POST "https://api.crisphive.com/v1/job-requests/emergency/candidates" \
  -H "Authorization: Bearer chsk_test_4eC8xQ9mZ2pL7Ka0rT" \
  -H "Content-Type: application/json" \
  -d '{
  "after_hours_override": true,
  "emergency_job_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
  "limit": 1,
  "mode": "overtime",
  "start_at": "2030-06-14T09:00:00"
}'
نص الطلب
{
"after_hours_override": ,
"emergency_job_id": ,
"limit": ,
"mode": ,
"start_at":
}

الاستجابات