Refactor doctor name handling across the application

- Removed the "دکتر" prefix from doctor names in various components and API responses to ensure consistency and clarity.
- Updated the AppointmentDetailPage, CommentsPage, DashboardPage, RatingsPage, SecretariesPage, and other relevant files to reflect the changes in doctor name formatting.
- Adjusted API documentation to align with the new naming conventions.
- Implemented validation to prevent the creation of clinics without a name and restricted users to a single clinic.
- Added tests to verify that doctor names are stored without titles and that clinic creation adheres to the new validation rules.
This commit is contained in:
hamed
2026-07-19 16:09:55 +03:30
parent 7761c37a3e
commit b05aeaf58b
30 changed files with 260 additions and 71 deletions
+14 -3
View File
@@ -8,7 +8,18 @@
Create a new clinic.
**Permission:** `AUTH` — any authenticated user becomes the clinic owner
**Permission:** `AUTH` — any authenticated user becomes the clinic owner, and is
granted `ROLE_CLINIC` on success.
**One clinic per user.** `ClinicRepository::findByUser()` (which resolves the
caller's working context) is a `findOneBy`, so a second clinic would be
unreachable data — the request is rejected instead.
**Errors:**
| Code | HTTP | توضیح |
|------|------|-------|
| ERR_VALIDATION_001 | 422 | `name` خالی است (field: `name`) |
| ERR_CONFLICT_001 | 409 | این کاربر از قبل مالک یک کلینیک است |
### Request Body (`application/json`)
```json
@@ -295,7 +306,7 @@ Get doctors associated with a clinic.
{
"id": "1207",
"uuid": "...",
"name": "دکتر آرمان رضایی",
"name": "آرمان رضایی",
"gender": "man",
"degree": "specialist",
"img": [],
@@ -401,7 +412,7 @@ List the permission rows of every doctor in the clinic.
"uuid": "ce200cde-826d-11f1-b923-c282b864cdcc",
"clinic_uuid": "41e325c4-e825-4067-8438-5d828ecaee09",
"doctor_uuid": "bcabb3a8-cae3-45ec-876c-548f9c1e1569",
"doctor_name": "دکتر تست",
"doctor_name": "تست",
"active": true,
"permissions": { "version": 1, "resources": { "...": {} } },
"created_at": 1784352916,