feat: enhance staff management and payment gateway features

- Fix national code handling in staff creation and updates to support Persian digits.
- Update ClinicStaff entity to allow longer national codes (up to 15 characters).
- Implement support for clinic secretaries in SecretaryController, allowing creation without a doctor UUID.
- Add a new endpoint to retrieve doctors associated with a clinic for secretary management.
- Improve appointment management by ensuring doctors are selectable even when no appointments exist.
- Extend PatientController to allow secretaries to create patient records if they have the appropriate permissions.
- Introduce a PriceInput component for better price formatting in forms, supporting Persian digits.
- Add a MockGateway for testing payment processes without real transactions.
- Enhance SMS settings management with an approval flow for post-visit text messages, including new fields for pending text and status.
- Update migrations to reflect changes in database schema for national codes and SMS settings.
This commit is contained in:
hamed
2026-06-15 11:03:56 +03:30
parent 55f646e2d4
commit 5cdcec23a9
32 changed files with 1487 additions and 128 deletions
+15 -2
View File
@@ -59,7 +59,7 @@ class StaffController extends BaseController
$staff->setPhone($data['phone'] ?? null);
$staff->setJobTitle($data['job_title'] ?? null);
$staff->setAddress($data['address'] ?? null);
$staff->setNationalCode($data['national_code'] ?? null);
$staff->setNationalCode($this->toLatinDigits($data['national_code'] ?? null));
$this->staffRepo->save($staff);
@@ -86,7 +86,7 @@ class StaffController extends BaseController
if (array_key_exists('phone', $data)) { $staff->setPhone($data['phone']); }
if (array_key_exists('job_title', $data)) { $staff->setJobTitle($data['job_title']); }
if (array_key_exists('address', $data)) { $staff->setAddress($data['address']); }
if (array_key_exists('national_code', $data)){ $staff->setNationalCode($data['national_code']); }
if (array_key_exists('national_code', $data)){ $staff->setNationalCode($this->toLatinDigits($data['national_code'])); }
$this->staffRepo->save($staff);
@@ -137,4 +137,17 @@ class StaffController extends BaseController
&& $staff->getEntityType() === $entityType
&& $staff->getEntityId() === $entityId;
}
private function toLatinDigits(?string $str): ?string
{
if ($str === null) {
return null;
}
return strtr($str, [
'۰' => '0', '۱' => '1', '۲' => '2', '۳' => '3', '۴' => '4',
'۵' => '5', '۶' => '6', '۷' => '7', '۸' => '8', '۹' => '9',
'٠' => '0', '١' => '1', '٢' => '2', '٣' => '3', '٤' => '4',
'٥' => '5', '٦' => '6', '٧' => '7', '٨' => '8', '٩' => '9',
]);
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ class ClinicStaff
#[ORM\Column(type: 'text', nullable: true)]
private ?string $address = null;
#[ORM\Column(name: 'national_code', type: 'string', length: 10, nullable: true)]
#[ORM\Column(name: 'national_code', type: 'string', length: 15, nullable: true)]
private ?string $nationalCode = null;
#[ORM\Column(type: 'boolean')]