feat: add clinic role support to doctor profile access and update API endpoint for clinic owners

This commit is contained in:
hamed
2026-06-13 18:10:44 +03:30
parent 5c2e9fae3f
commit c1c57df4ff
5 changed files with 253 additions and 21 deletions
+38
View File
@@ -106,6 +106,44 @@ Get doctor detail with clinics.
---
## GET `/api/v1/clinic/my-doctor/{doctorUuid}`
Get doctor detail for clinic owner — only doctors who are members of the authenticated clinic.
**Permission:** `ROLE_CLINIC`
### Path Parameters
| Param | Type | Description |
|-------|------|-------------|
| `doctorUuid` | string (UUID) | Doctor UUID |
### Response `200`
```json
{
"success": true,
"data": {
"data": {
"uuid": "...",
"title": "دکتر علی احمدی",
"specialties": [...],
"clinics": [{ "uuid": "...", "name": "کلینیک نور", "address": "...", "telephone": "..." }]
}
}
}
```
> ⚠️ **Double-nested:** Frontend extracts with `data?.data?.data`
> **Side note:** Returns only the authenticated clinic's data in the `clinics` array (not all clinics of the doctor).
### Errors
| Code | HTTP | Description |
|------|------|-------------|
| `ERR_VALIDATION_002` | 404 | Clinic or doctor not found |
| `ERR_AUTH_006` | 403 | Doctor is not a member of this clinic |
---
## GET `/api/v1/doctors`
List doctors with pagination and filters.