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:
hamed
2026-08-03 12:42:42 +03:30
co-authored by Claude Opus 5
parent a63abc31be
commit fd59eb57a3
10 changed files with 107 additions and 45 deletions
+17
View File
@@ -1085,6 +1085,23 @@ New query param `reserve=1` → returns only reserve-list entries; without it on
| `service_total_minutes` | int\|null | مدت ثبت‌شده؛ در حالت اسلاتی `null` |
| `service_buffer_minutes` | int\|null | بافر مؤثر لحظهٔ ثبت |
### `has_schedule` روی فهرست پزشکان (2026-08)
`GET /api/v1/my/clinic-doctors` برای هر پزشک `has_schedule` می‌دهد: آیا در محیط جاری
`WeeklySchedule` دارد یا نه. صفحهٔ نوبت‌ها فقط برای پزشکِ دارای برنامه تب می‌سازد —
تبِ پزشکی که روز کاری ندارد جز یک تایم‌لاین همیشه‌خالی چیزی نشان نمی‌دهد.
با یک کوئری برای کل فهرست گرفته می‌شود (`findByDoctors`)، نه یکی به‌ازای هر پزشک.
```json
{ "success": true, "data": { "data": [
{ "uuid": "631e81d8-…", "name": "امیر کاظمی", "has_schedule": true }
] } }
```
`GET /api/v1/clinic/doctor-list/{clinicUuid}` این فیلد را **ندارد** (عمومی است و نقش
ادمین را سرو می‌کند)؛ کلاینت نبودِ فیلد را «نمی‌دانیم» می‌گیرد و پزشک را پنهان نمی‌کند.
### فیلتر و فیلدِ منبع (2026-08)
صفحهٔ نوبت‌ها برای هر منبع تبِ مستقل دارد، پس فهرست باید بتواند «نوبت‌های همین دستگاه/اتاق»