feat : modification écran RTT + modification écran frais
All checks were successful
Auto Tag Develop / tag (push) Successful in 8s

This commit is contained in:
2026-03-19 17:10:11 +01:00
parent 3ec1e1f10d
commit 17f871e82d
15 changed files with 468 additions and 67 deletions

View File

@@ -228,6 +228,45 @@ final class WorkHourRepository extends ServiceEntityRepository implements WorkHo
return $result;
}
public function isWeekFullyValidated(Employee $employee, DateTimeImmutable $from, DateTimeImmutable $to): bool
{
// At least one validated day must exist
$validatedCount = (int) $this->createQueryBuilder('w')
->select('COUNT(w.id)')
->andWhere('w.employee = :employee')
->andWhere('w.workDate >= :from')
->andWhere('w.workDate <= :to')
->andWhere('w.isValid = :isValid')
->setParameter('employee', $employee)
->setParameter('from', $from)
->setParameter('to', $to)
->setParameter('isValid', true)
->getQuery()
->getSingleScalarResult()
;
if (0 === $validatedCount) {
return false;
}
// No non-validated day must exist in the range
$nonValidatedCount = (int) $this->createQueryBuilder('w')
->select('COUNT(w.id)')
->andWhere('w.employee = :employee')
->andWhere('w.workDate >= :from')
->andWhere('w.workDate <= :to')
->andWhere('w.isValid = :isValid')
->setParameter('employee', $employee)
->setParameter('from', $from)
->setParameter('to', $to)
->setParameter('isValid', false)
->getQuery()
->getSingleScalarResult()
;
return 0 === $nonValidatedCount;
}
public function hasPendingSiteValidationForSiteAndDate(int $siteId, DateTimeInterface $date): bool
{
$workDate = DateTimeImmutable::createFromInterface($date);