feat: unify doctor title handling and enhance specialty selection
- Implemented a helper function `displayDoctorName` to prepend "دکتر" to doctor names for consistent display across the application. - Updated various components (InviteDoctorModal, DashboardPage, DoctorDetailPage, DoctorsPage, etc.) to utilize the new helper for rendering doctor names. - Modified the DoctorFormPage to automatically add the "دکتر" title in the UI without requiring user input. - Fixed the EditSpecialtyPicker component to allow multiple specialty selections, resolving a UI bug where only one specialty could be selected at a time. - Ensured that the backend strips the "دکتر" title from the name during pre-registration and doctor creation processes. - Added tests for the new functionality, including checks for title handling and specialty selection logic. - Updated API documentation to reflect changes in name handling and display logic.
This commit is contained in:
+1
-1
@@ -589,7 +589,7 @@ Submit a pre-registration request (doctor or clinic). Public endpoint — no aut
|
||||
| Field | Type | Required | Notes |
|
||||
|-------|------|----------|-------|
|
||||
| `type` | string | ✅ | `independent_doctor` \| `doctor_with_clinic` \| `clinic_manager` |
|
||||
| `name` | string | ✅ | min 2 chars |
|
||||
| `name` | string | ✅ | min 2 chars. عنوان «دکتر» ابتدای نام (و پیشوندهای تکراری «دکتر دکتر …») هنگام ثبت حذف میشود؛ نام تمیز ذخیره و در نمایش دوباره «دکتر» افزوده میشود. |
|
||||
| `mobile` | string | ✅ | 10–15 chars |
|
||||
| `info` | string | ❌ | specialty, address, etc. |
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
# Doctor API
|
||||
|
||||
> **`name` در برابر `display_name`:** `name` نامِ خام است (بدون عنوان — برای فرم ویرایش).
|
||||
> `display_name` نامِ آمادهٔ نمایش با پیشوند «دکتر» است که بکاند تولید میکند
|
||||
> (`PersianText::withDoctorTitle`) تا همهٔ کلاینتها یکسان و بدون «دکتر دکتر …» نشان دهند؛
|
||||
> در لیست و جزئیات پزشک هر دو حاضرند. برای نمایش از `display_name`، برای ویرایش از `name` استفاده کنید.
|
||||
|
||||
> فیلد `owner_status` (`claimed` | `unclaimed` | `pending_transfer`) به خروجی لیست و جزئیات پزشک
|
||||
> اضافه شده است — پروفایل `unclaimed` (ایمپورت نظام پزشکی) در سایت دکمهٔ «تصاحب پروفایل» میگیرد
|
||||
> (`docs/api/doctor-claim.md`) و نوبتدهی آنلاینش غیرفعال است.
|
||||
@@ -94,6 +99,7 @@ Get doctor detail with clinics.
|
||||
"data": {
|
||||
"uuid": "550e8400-...",
|
||||
"name": "علی احمدی",
|
||||
"display_name": "دکتر علی احمدی",
|
||||
"gender": "man",
|
||||
"medical_system_code": "12345",
|
||||
"degree": "specialist",
|
||||
@@ -237,6 +243,7 @@ List doctors with pagination and filters.
|
||||
{
|
||||
"uuid": "...",
|
||||
"name": "علی احمدی",
|
||||
"display_name": "دکتر علی احمدی",
|
||||
"gender": "man",
|
||||
"degree": "specialist",
|
||||
"img": [],
|
||||
|
||||
Reference in New Issue
Block a user