feat(appointments): only doctors with a weekly schedule get a tab
my/clinic-doctors now reports has_schedule per doctor, and the appointments page builds tabs from it. A doctor with no working days had a tab that could only ever show an empty timeline. The flag is resolved with one query for the whole list rather than one per doctor. Clinic owners now read this authenticated endpoint too instead of the public clinic doctor-list, which is where the flag lives; admin keeps the public list and, with no flag present, hides nobody. Also repairs fallout from making the resource supervisor mandatory: four test classes build resources through their own helpers and were failing with 422. The supervisorFor helper moved to ApiTestCase so all domains share one, rather than copying it per suite. Full backend suite is green again (1306 tests) — the previous commit only ran tests/Resource and missed this. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,7 @@ class AvailabilityEngineTest extends ApiTestCase
|
||||
{
|
||||
$created = $this->authJson('POST', '/api/v1/resource', $user, [
|
||||
'address_uuid' => $address->getUuid(),
|
||||
'supervisor_doctor_uuid' => $this->supervisorFor($address)->getUuid(),
|
||||
'type_uuid' => $type->getUuid(),
|
||||
'name' => $name,
|
||||
]);
|
||||
@@ -244,6 +245,7 @@ class AvailabilityEngineTest extends ApiTestCase
|
||||
|
||||
$created = $this->authJson('POST', '/api/v1/resource', $user, [
|
||||
'address_uuid' => $address->getUuid(),
|
||||
'supervisor_doctor_uuid' => $this->supervisorFor($address)->getUuid(),
|
||||
'type_uuid' => $room->getUuid(),
|
||||
'name' => 'اتاق سهتخته',
|
||||
'capacity' => 3,
|
||||
@@ -297,6 +299,7 @@ class AvailabilityEngineTest extends ApiTestCase
|
||||
// منبع هست ولی هیچ شیفتی ندارد.
|
||||
$this->authJson('POST', '/api/v1/resource', $user, [
|
||||
'address_uuid' => $address->getUuid(),
|
||||
'supervisor_doctor_uuid' => $this->supervisorFor($address)->getUuid(),
|
||||
'type_uuid' => $room->getUuid(),
|
||||
'name' => 'اتاق بیشیفت',
|
||||
]);
|
||||
@@ -350,6 +353,7 @@ class AvailabilityEngineTest extends ApiTestCase
|
||||
|
||||
$created = $this->authJson('POST', '/api/v1/resource', $user, [
|
||||
'address_uuid' => $address->getUuid(),
|
||||
'supervisor_doctor_uuid' => $this->supervisorFor($address)->getUuid(),
|
||||
'type_uuid' => $device->getUuid(),
|
||||
'name' => 'لیزر تنها',
|
||||
'setup_minutes' => 10,
|
||||
|
||||
Reference in New Issue
Block a user