feat(doctor): update schedule fields in doctor API responses to reflect actual availability

This commit is contained in:
hamed
2026-06-15 15:11:29 +03:30
parent ec36eefeb8
commit c662eb9b4f
5 changed files with 398 additions and 28 deletions
@@ -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]);