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
+56 -7
View File
@@ -33,9 +33,23 @@ class SmsSettings
#[ORM\Column(name: 'post_visit_text', type: 'text', nullable: true)]
private ?string $postVisitText = null;
#[ORM\Column(name: 'post_visit_text_pending', type: 'text', nullable: true)]
private ?string $postVisitTextPending = null;
#[ORM\Column(name: 'post_visit_text_status', type: 'string', length: 20)]
private string $postVisitTextStatus = 'none';
#[ORM\Column(name: 'post_visit_text_reject_reason', type: 'text', nullable: true)]
private ?string $postVisitTextRejectReason = null;
#[ORM\Column(name: 'updated_at', type: 'integer')]
private int $updatedAt;
public const TEXT_STATUS_NONE = 'none';
public const TEXT_STATUS_PENDING = 'pending';
public const TEXT_STATUS_APPROVED = 'approved';
public const TEXT_STATUS_REJECTED = 'rejected';
public function __construct(string $entityType, int $entityId)
{
$this->entityType = $entityType;
@@ -51,21 +65,56 @@ class SmsSettings
public function isPostVisitEnabled(): bool { return $this->postVisitEnabled; }
public function getPostVisitText(): ?string { return $this->postVisitText; }
public function getPostVisitTextPending(): ?string { return $this->postVisitTextPending; }
public function getPostVisitTextStatus(): string { return $this->postVisitTextStatus; }
public function getPostVisitTextRejectReason(): ?string { return $this->postVisitTextRejectReason; }
public function setReminderEnabled(bool $v): self { $this->reminderEnabled = $v; $this->updatedAt = time(); return $this; }
public function setReminderHoursBefore(int $v): self { $this->reminderHoursBefore = $v; $this->updatedAt = time(); return $this; }
public function setPostVisitEnabled(bool $v): self { $this->postVisitEnabled = $v; $this->updatedAt = time(); return $this; }
public function setPostVisitText(?string $v): self { $this->postVisitText = $v; $this->updatedAt = time(); return $this; }
public function submitPostVisitText(string $text): self
{
$this->postVisitTextPending = $text;
$this->postVisitTextStatus = self::TEXT_STATUS_PENDING;
$this->postVisitTextRejectReason = null;
$this->updatedAt = time();
return $this;
}
public function approvePostVisitText(): self
{
if ($this->postVisitTextPending !== null) {
$this->postVisitText = $this->postVisitTextPending;
}
$this->postVisitTextPending = null;
$this->postVisitTextStatus = self::TEXT_STATUS_APPROVED;
$this->updatedAt = time();
return $this;
}
public function rejectPostVisitText(string $reason): self
{
$this->postVisitTextStatus = self::TEXT_STATUS_REJECTED;
$this->postVisitTextRejectReason = $reason;
$this->updatedAt = time();
return $this;
}
public function toArray(): array
{
return [
'entity_type' => $this->entityType,
'entity_id' => $this->entityId,
'reminder_enabled' => $this->reminderEnabled,
'reminder_hours_before' => $this->reminderHoursBefore,
'post_visit_enabled' => $this->postVisitEnabled,
'post_visit_text' => $this->postVisitText,
'updated_at' => $this->updatedAt,
'entity_type' => $this->entityType,
'entity_id' => $this->entityId,
'reminder_enabled' => $this->reminderEnabled,
'reminder_hours_before' => $this->reminderHoursBefore,
'post_visit_enabled' => $this->postVisitEnabled,
'post_visit_text' => $this->postVisitText,
'post_visit_text_pending' => $this->postVisitTextPending,
'post_visit_text_status' => $this->postVisitTextStatus,
'post_visit_text_reject_reason' => $this->postVisitTextRejectReason,
'updated_at' => $this->updatedAt,
];
}
}