feat: add doctor_uuid support in authStore and update DoctorDetailPage to prioritize doctorUuid

This commit is contained in:
hamed
2026-06-13 19:19:50 +03:30
parent 09c393a574
commit ab5dca4fb6
5 changed files with 250 additions and 7 deletions
+7 -4
View File
@@ -532,6 +532,7 @@ class AuthController extends BaseController
$dbUuid = $activeCtx?->getDbUuid();
$dbKey = $dbUuid !== null ? $this->buildDbKey($dbUuid) : null;
$context = $dbUuid !== null ? $this->findContextByDbUuid($dbUuid, $availableContexts) : null;
$doctor = $this->doctorRepo->findByUser($user);
return $this->success([
'id' => $user->getId(),
@@ -543,6 +544,7 @@ class AuthController extends BaseController
'primary_role' => $primaryRole,
'db_uuid' => $dbUuid,
'db_key' => $dbKey,
'doctor_uuid' => $doctor?->getUuid(),
'context' => $context,
'available_contexts' => $availableContexts,
]);
@@ -625,10 +627,11 @@ class AuthController extends BaseController
];
foreach ($this->clinicRepo->findByDoctor($doctor) as $clinic) {
$contexts[] = [
'type' => 'clinic',
'db_uuid' => $clinic->getUuid(),
'name' => $clinic->getName() ?? '',
'role' => 'clinic',
'type' => 'clinic',
'db_uuid' => $clinic->getUuid(),
'name' => $clinic->getName() ?? '',
'role' => 'clinic',
'doctor_uuid' => $doctor->getUuid(),
];
}
}