fix : correction des Heures et ajout d'une validation pour les chefs de site
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-02-26 14:49:28 +01:00
parent 5cced46254
commit b68fef61c4
20 changed files with 547 additions and 106 deletions

View File

@@ -51,7 +51,7 @@ final readonly class EmployeeWriteProcessor implements ProcessorInterface
$today = new DateTimeImmutable('today');
if ($isNew) {
$this->ensureContractPeriodExists($data, $currentContract, $today);
$this->ensureContractPeriodExists($data, $currentContract, new DateTimeImmutable('1970-01-01'));
return $result;
}
@@ -61,7 +61,7 @@ final readonly class EmployeeWriteProcessor implements ProcessorInterface
}
$todayPeriod = $this->periodRepository->findOneCoveringDate($data, $today);
if (null !== $todayPeriod && null === $todayPeriod->getEndDate() && $todayPeriod->getStartDate() === $today) {
if (null !== $todayPeriod && null === $todayPeriod->getEndDate() && $todayPeriod->getStartDate()->format('Y-m-d') === $today->format('Y-m-d')) {
$todayPeriod->setContract($currentContract);
$this->entityManager->flush();