feat: email notifications about uploaded invoices to management

This commit is contained in:
Björn Fromme committed 2024-04-04 15:08:52 +02:00
1 parent ffc33cebc5
commit 8d0babba14
5 files changed
+100 -3

No files matched your search

+18
View File
@@ -20,4 +20,22 @@ class UserRepository extends ServiceEntityRepository
{
parent::__construct($registry, User::class);
}
public function getUsersByRoleAndHotelCode(string $role, string $hotelCode): array
{
$hotelCodeBase = substr($hotelCode, 0, 3);
$qb = $this->createQueryBuilder('user');
return $qb
->where($qb->expr()->andX(
$qb->expr()->eq('user.hotelCode', ':hotelCode'),
$qb->expr()->like('user.roles', ':role')
))
->setParameter('hotelCode', $hotelCodeBase)
->setParameter('role', '%"'.$role.'"%')
->getQuery()
->getResult()
;
}
}