feat(doctor): update schedule fields in doctor API responses to reflect actual availability
This commit is contained in:
@@ -19,6 +19,19 @@ class WeeklyScheduleRepository extends ServiceEntityRepository
|
||||
return $this->findOneBy(['doctor' => $doctor]);
|
||||
}
|
||||
|
||||
/** @param Doctor[] $doctors @return WeeklySchedule[] */
|
||||
public function findByDoctors(array $doctors): array
|
||||
{
|
||||
if (empty($doctors)) {
|
||||
return [];
|
||||
}
|
||||
return $this->createQueryBuilder('ws')
|
||||
->where('ws.doctor IN (:doctors)')
|
||||
->setParameter('doctors', $doctors)
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
public function findByUuid(string $uuid): ?WeeklySchedule
|
||||
{
|
||||
return $this->findOneBy(['uuid' => $uuid]);
|
||||
|
||||
Reference in New Issue
Block a user