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:
@@ -12,6 +12,7 @@ use App\Doctor\Entity\Doctor;
|
||||
use App\Doctor\Repository\DoctorRepository;
|
||||
use App\Shared\Captcha\CaptchaGuard;
|
||||
use App\Shared\Constant\ErrorCodes;
|
||||
use App\Shared\Util\PersianText;
|
||||
use App\Shared\Controller\BaseController;
|
||||
use App\Sms\Service\SmsService;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
@@ -46,7 +47,9 @@ class PreRegistrationController extends BaseController
|
||||
|
||||
$data = json_decode($request->getContent(), true) ?? [];
|
||||
$type = trim($data['type'] ?? '');
|
||||
$name = trim($data['name'] ?? '');
|
||||
// نام هرگز عنوان «دکتر» را در خود ندارد؛ لایهٔ نمایش آن را میافزاید. اینجا تمیز
|
||||
// میشود تا realName، پزشک و کلینیکِ ساختهشده از این درخواست همگی سازگار باشند.
|
||||
$name = PersianText::stripDoctorTitle(trim($data['name'] ?? ''));
|
||||
$mobile = trim($data['mobile'] ?? '');
|
||||
$info = trim($data['info'] ?? '') ?: null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user