feat(doctor): update schedule fields in doctor API responses to reflect actual availability

This commit is contained in:
hamed
2026-06-15 15:11:29 +03:30
parent ec36eefeb8
commit c662eb9b4f
5 changed files with 398 additions and 28 deletions
+36 -15
View File
@@ -80,18 +80,23 @@ Get doctor detail with clinics.
"data": {
"data": {
"uuid": "550e8400-...",
"title": "دکتر علی احمدی",
"gender": "male",
"name": "دکتر علی احمدی",
"gender": "man",
"medical_system_code": "12345",
"degree": "متخصص",
"info": "...",
"image": "https://...",
"doctor_rate": 4.5,
"active_doctor_appointment": true,
"specialties": [{ "id": 1, "name": "قلب و عروق" }],
"doctor_services": [{ "id": 3, "name": "نوار قلب" }],
"clinics": [{ "uuid": "...", "name": "کلینیک الوند" }],
"created_at": 1717000000
"degree": "specialist",
"detail": "...",
"img": [],
"satisfaction": "60",
"point": "3.5",
"free_turn": "دوشنبه 09:0013:00",
"hours_of_work": "شنبه: 09:0013:00 و 14:0018:00 | یکشنبه: 09:0013:00",
"active": true,
"specialties": [{ "uuid": "...", "id": "1", "name": "قلب و عروق", "parent_id": null }],
"expertise": [{ "uuid": "...", "id": "3", "name": "نوار قلب" }],
"address": [],
"state": [],
"city": [],
"clinics": [{ "uuid": "...", "name": "کلینیک الوند", "address": "...", "telephone": "..." }]
}
}
}
@@ -144,6 +149,16 @@ Get doctor detail for clinic owner — only doctors who are members of the authe
---
### Schedule Fields Notes
| Field | When schedule exists | When no schedule |
|-------|---------------------|-----------------|
| `free_turn` | نزدیک‌ترین روز/ساعت کاری از امروز (مثلاً «دوشنبه ۹:۰۰–۱۳:۰۰») | «نوبت آزادی موجود نیست» |
| `hours_of_work` | خلاصه ساعت‌های روزهای فعال با `\|` جداشده | «برنامه کاری تنظیم نشده» |
| `active` | `activeDoctorAppointment && has_active_sessions` | `false` — نوبت‌دهی غیرفعال |
---
## GET `/api/v1/doctors`
List doctors with pagination and filters.
@@ -167,10 +182,16 @@ List doctors with pagination and filters.
"data": [
{
"uuid": "...",
"title": "دکتر علی احمدی",
"degree": "متخصص",
"doctor_rate": 4.5,
"image": "https://..."
"name": "دکتر علی احمدی",
"gender": "man",
"degree": "specialist",
"img": [],
"specialties": [{ "uuid": "...", "id": "1", "name": "قلب و عروق" }],
"satisfaction": "60",
"point": "3.5",
"free_turn": "دوشنبه 09:0013:00",
"hours_of_work": "شنبه: 09:0013:00 و 14:0018:00 | یکشنبه: 09:0013:00",
"active": true
}
],
"meta": {