feat(appointment): add booking services endpoint and update security configuration for public access

This commit is contained in:
hamed
2026-07-15 23:48:38 +03:30
parent 2df16c6d29
commit ac4a430564
5 changed files with 149 additions and 2 deletions
@@ -76,6 +76,27 @@ class ServiceItemRepository extends ServiceEntityRepository
->getSingleScalarResult();
}
/**
* سرویس‌های فعالِ «نمایش در نوبت‌دهی» (bookable) یک entity — برای نمایش عمومیِ
* انتخاب سرویس در نوبت‌گیری آنلاین.
*
* @return ServiceItem[]
*/
public function findBookableByEntity(string $entityType, int $entityId): array
{
return $this->createQueryBuilder('i')
->join('i.section', 's')
->where('s.entityType = :type')
->andWhere('s.entityId = :id')
->andWhere('i.bookable = true')
->andWhere('i.active = true')
->setParameter('type', $entityType)
->setParameter('id', $entityId)
->orderBy('i.name', 'ASC')
->getQuery()
->getResult();
}
public function save(ServiceItem $item): void
{
$this->getEntityManager()->persist($item);