feat(migrations): add ownership fields to doctors table for IRIMC import

- Introduced new columns: owner_status, source, source_ref, managed_by, and claimed_at to the doctors table.
- Created indexes for owner_status and source to optimize queries related to unclaimed doctors.

feat(auth): implement SystemOwnerCommand for managing system-owner user

- Added command to create, activate, and deactivate a system-owner user for IRIMC crawler.
- Ensured the user has ROLE_ADMIN to access import endpoints.
- Handled password setting and user status management within the command.
This commit is contained in:
hamed
2026-07-11 08:59:36 +03:30
parent f30bf5dfbd
commit 9f56f4aa08
28 changed files with 3694 additions and 989 deletions
@@ -74,7 +74,7 @@ class ClinicDoctorInvitation
$this->clinic = $clinic;
$this->invitedBy = $invitedBy;
$this->mobile = $mobile;
$this->token = bin2hex(random_bytes(48));
$this->token = bin2hex(random_bytes(16));
$this->invitedAt = time();
$this->expiresAt = $this->invitedAt + 72 * 3600;
}
@@ -94,7 +94,7 @@ class ClinicDoctorInvitation
public function refresh(): void
{
$this->token = bin2hex(random_bytes(48));
$this->token = bin2hex(random_bytes(16));
$this->tokenUsed = false;
$this->invitedAt = time();
$this->expiresAt = $this->invitedAt + 72 * 3600;