feat: implement realistic data seeding for doctors, clinics, and secretaries
- Added seed_realistic_data.php to clean existing data and populate the database with realistic entries for doctors, clinics, and secretaries. - Created a structured approach to generate 100 doctors per city with diverse specialties and services. - Implemented database cleanup routines to ensure a fresh start for data seeding. - Enhanced the DoctorSecretaryRepository with improved comments for clarity.
This commit is contained in:
@@ -171,7 +171,7 @@ class SecretaryController extends BaseController
|
||||
return $this->success(['message' => 'منشی غیرفعال شد']);
|
||||
}
|
||||
|
||||
/** لیست منشیان مطب شخصی یک دکتر */
|
||||
/** لیست منشی ها مطب شخصی یک دکتر */
|
||||
#[Route('/api/v1/secretaries/{doctorUuid}', methods: ['GET'])]
|
||||
public function list(string $doctorUuid, #[CurrentUser] User $currentUser): JsonResponse
|
||||
{
|
||||
@@ -180,7 +180,7 @@ class SecretaryController extends BaseController
|
||||
return $this->error(ErrorCodes::ERR_VALIDATION_002, 'دکتر یافت نشد', 404);
|
||||
}
|
||||
|
||||
// فقط خود دکتر یا ادمین میتوانند منشیان مطب شخصی را ببینند
|
||||
// فقط خود دکتر یا ادمین میتوانند منشی ها مطب شخصی را ببینند
|
||||
if (!$currentUser->hasRole('ROLE_ADMIN') && $doctor->getUser()->getId() !== $currentUser->getId()) {
|
||||
return $this->error(ErrorCodes::ERR_AUTH_006, 'دسترسی ممنوع', 403);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ class SecretaryController extends BaseController
|
||||
return $this->success($secretaries);
|
||||
}
|
||||
|
||||
/** لیست همه منشیان کلینیک (از همه دکترها، owner_type='clinic') */
|
||||
/** لیست همه منشی ها کلینیک (از همه دکترها، owner_type='clinic') */
|
||||
#[Route('/api/v1/secretaries/clinic/{clinicUuid}', methods: ['GET'])]
|
||||
public function listByClinic(string $clinicUuid, #[CurrentUser] User $currentUser): JsonResponse
|
||||
{
|
||||
@@ -227,7 +227,7 @@ class SecretaryController extends BaseController
|
||||
}
|
||||
|
||||
if ($secretary->getOwnerType() === DoctorSecretary::OWNER_CLINIC) {
|
||||
// فقط مالک کلینیک میتواند منشیان کلینیکی را مدیریت کند
|
||||
// فقط مالک کلینیک میتواند منشی ها کلینیکی را مدیریت کند
|
||||
if (!$user->hasRole('ROLE_CLINIC')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class DoctorSecretaryRepository extends ServiceEntityRepository
|
||||
return $this->findBy(['doctor' => $doctor], ['createdAt' => 'DESC']);
|
||||
}
|
||||
|
||||
/** منشیان مطب شخصی یک دکتر (owner_type='doctor') */
|
||||
/** منشی ها مطب شخصی یک دکتر (owner_type='doctor') */
|
||||
public function findByDoctorScope(Doctor $doctor): array
|
||||
{
|
||||
return $this->findBy(
|
||||
@@ -108,7 +108,7 @@ class DoctorSecretaryRepository extends ServiceEntityRepository
|
||||
return $clinic->getDoctors()->contains($doctor);
|
||||
}
|
||||
|
||||
/** همه منشیان کلینیک (owner_type='clinic') */
|
||||
/** همه منشی ها کلینیک (owner_type='clinic') */
|
||||
public function findByClinic(Clinic $clinic): array
|
||||
{
|
||||
return $this->createQueryBuilder('s')
|
||||
|
||||
Reference in New Issue
Block a user