feat(appointment): add booking services endpoint and update security configuration for public access
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user