feat(representation): expose doctor representation details and add counts in admin views

This commit is contained in:
hamed
2026-07-12 13:00:49 +03:30
parent 476d5bb80e
commit 1a8b3bfa53
10 changed files with 366 additions and 4 deletions
+11 -1
View File
@@ -44,6 +44,7 @@ class DoctorController extends BaseController
private readonly \App\Appointment\Repository\AppointmentRepository $appointmentRepo,
private readonly TenantInsuranceCleanupService $insuranceCleanup,
private readonly \App\Representation\Service\DomainContextResolver $domainResolver,
private readonly \App\Representation\Repository\RepresentationRepository $representationRepo,
private readonly string $projectDir,
) {}
@@ -169,8 +170,17 @@ class DoctorController extends BaseController
],
], $clinics);
$repId = $doctor->getRepresentationId();
$rep = $repId !== null ? $this->representationRepo->find($repId) : null;
$representation = $rep !== null
? ['id' => $rep->getId(), 'uuid' => $rep->getUuid(), 'full_name' => $rep->getFullName()]
: null;
$schedule = $this->scheduleRepo->findByDoctor($doctor);
return $this->success(['data' => array_merge($doctor->toDetailArray($schedule), ['clinics' => $clinicData])]);
return $this->success(['data' => array_merge($doctor->toDetailArray($schedule), [
'clinics' => $clinicData,
'representation' => $representation,
])]);
}
#[Route('/api/v1/clinic/my-doctor/{doctorUuid}', methods: ['GET'])]