findBusyIntervals() and getServiceStartTimes() gain an optional excludeAppointmentId, mirroring isSlotTaken($doctor, $start, $end, $excludeId) which already had it. Without it an appointment being rescheduled sees itself as busy, so its current time never appears among the candidates and "same hour, different service" is impossible. The parameter is optional with a null default and only affects the service-mode path; no existing call site changes behaviour. SlotModeFrozenTest caught the signature change immediately while both response contracts stayed green, so the signature fixture was updated once with a written rationale, as its own header permits. Task: docs/new_feture/taskes/task-00-service-mode-completion/ Slot-mode contract: unchanged (--group=slot-mode-frozen green) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
84 lines
3.3 KiB
PHP
84 lines
3.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* READ-ONLY — امضای منجمد متدهای عمومی SlotCalculatorService.
|
|
*
|
|
* افزودن پارامتر **اختیاری** جدید مجاز است و باید یک بار همینجا ثبت شود؛ تغییر نام،
|
|
* تغییر نوع، تغییر ترتیب یا حذف پارامتر موجود ممنوع است.
|
|
* رجوع: docs/new_feture/taskes/_shared/red-lines.md
|
|
*
|
|
* تاریخچهٔ بهروزرسانیهای مجاز:
|
|
* - تسک ۰۰ / قابلیت ۴: `getServiceStartTimes(..., ?int $excludeAppointmentId = null)`.
|
|
* پارامتر اختیاری با پیشفرض null و فقط روی مسیر **سرویسی**؛ هیچ فراخوانیِ موجودی
|
|
* رفتارش عوض نشد. لازم بود چون بدون آن، نوبتِ در حال جابهجایی خودش را اشغال میبیند
|
|
* و زمان فعلیاش در فهرست زمانهای ممکن نمیآید.
|
|
*/
|
|
return [
|
|
'explainEmptyDay' => [
|
|
'returns' => '?string',
|
|
'params' => [
|
|
'doctor' => 'App\Doctor\Entity\Doctor',
|
|
'date' => 'string',
|
|
'clinic' => '?App\Clinic\Entity\Clinic = NULL',
|
|
'forManagement' => 'bool = false',
|
|
],
|
|
],
|
|
'findNextAvailableStart' => [
|
|
'returns' => '?int',
|
|
'params' => [
|
|
'doctor' => 'App\Doctor\Entity\Doctor',
|
|
'clinic' => '?App\Clinic\Entity\Clinic = NULL',
|
|
'daysAhead' => 'int = 30',
|
|
'forManagement' => 'bool = false',
|
|
],
|
|
],
|
|
'getAllSlotsWithAvailability' => [
|
|
'returns' => 'array',
|
|
'params' => [
|
|
'doctor' => 'App\Doctor\Entity\Doctor',
|
|
'date' => 'string',
|
|
'clinic' => '?App\Clinic\Entity\Clinic = NULL',
|
|
'forManagement' => 'bool = false',
|
|
],
|
|
],
|
|
'getAvailableSlots' => [
|
|
'returns' => 'array',
|
|
'params' => [
|
|
'doctor' => 'App\Doctor\Entity\Doctor',
|
|
'date' => 'string',
|
|
'clinic' => '?App\Clinic\Entity\Clinic = NULL',
|
|
'forManagement' => 'bool = false',
|
|
],
|
|
],
|
|
'getServiceStartTimes' => [
|
|
'returns' => 'array',
|
|
'params' => [
|
|
'doctor' => 'App\Doctor\Entity\Doctor',
|
|
'date' => 'string',
|
|
'durationMinutes' => 'int',
|
|
'clinic' => '?App\Clinic\Entity\Clinic = NULL',
|
|
'forManagement' => 'bool = false',
|
|
// تسک ۰۰ / قابلیت ۴ — تنها افزودهٔ مجاز؛ رجوع به docblock بالا
|
|
'excludeAppointmentId' => '?int = NULL',
|
|
],
|
|
],
|
|
'hasAnyAvailability' => [
|
|
'returns' => 'bool',
|
|
'params' => [
|
|
'doctor' => 'App\Doctor\Entity\Doctor',
|
|
'date' => 'string',
|
|
'clinic' => '?App\Clinic\Entity\Clinic = NULL',
|
|
'forManagement' => 'bool = false',
|
|
],
|
|
],
|
|
'resolveSlotLocationId' => [
|
|
'returns' => '?int',
|
|
'params' => [
|
|
'doctor' => 'App\Doctor\Entity\Doctor',
|
|
'slotStart' => 'int',
|
|
'clinic' => '?App\Clinic\Entity\Clinic = NULL',
|
|
'forManagement' => 'bool = false',
|
|
],
|
|
],
|
|
];
|