feat: add holiday management endpoints and jalaali-js dependency
- Added a new endpoint to list holidays for a specific doctor. - Added a new endpoint to delete a holiday, with access control for doctors and admins. - Implemented a repository method to retrieve all holidays for a doctor. - Added jalaali-js library to handle date conversions.
This commit is contained in:
@@ -19,6 +19,17 @@ class HolidayRepository extends ServiceEntityRepository
|
||||
return $this->findOneBy(['uuid' => $uuid]);
|
||||
}
|
||||
|
||||
/** @return Holiday[] */
|
||||
public function findAllByDoctor(Doctor $doctor): array
|
||||
{
|
||||
return $this->createQueryBuilder('h')
|
||||
->where('h.doctor = :doctor')
|
||||
->setParameter('doctor', $doctor)
|
||||
->orderBy('h.startDate', 'DESC')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
/** @return Holiday[] */
|
||||
public function findActiveByDoctor(Doctor $doctor, int $from, int $to): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user