feat(representation): expose doctor representation details and add counts in admin views
This commit is contained in:
@@ -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'])]
|
||||
|
||||
Reference in New Issue
Block a user