fix : redirection après login + écran des heures chauffeurs
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-03-16 09:13:35 +01:00
parent 3d26d6b50f
commit 01f8058f56
14 changed files with 255 additions and 77 deletions

View File

@@ -229,8 +229,10 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
* isPresentAfternoon:bool,
* dayHoursMinutes:?int,
* nightHoursMinutes:?int,
* workshopHoursMinutes:?int,
* hasBreakfast:bool,
* hasLunch:bool,
* hasDinner:bool,
* hasOvernight:bool
* }
*/
@@ -238,37 +240,41 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
{
if ($isDriver) {
return [
'morningFrom' => null,
'morningTo' => null,
'afternoonFrom' => null,
'afternoonTo' => null,
'eveningFrom' => null,
'eveningTo' => null,
'isPresentMorning' => false,
'isPresentAfternoon' => false,
'dayHoursMinutes' => $this->normalizeMinutes($entry['dayHoursMinutes'] ?? null, $employeeId, 'dayHoursMinutes'),
'nightHoursMinutes' => $this->normalizeMinutes($entry['nightHoursMinutes'] ?? null, $employeeId, 'nightHoursMinutes'),
'hasBreakfast' => $this->normalizePresence($entry['hasBreakfast'] ?? false, $employeeId, 'hasBreakfast'),
'hasLunch' => $this->normalizePresence($entry['hasLunch'] ?? false, $employeeId, 'hasLunch'),
'hasOvernight' => $this->normalizePresence($entry['hasOvernight'] ?? false, $employeeId, 'hasOvernight'),
'morningFrom' => null,
'morningTo' => null,
'afternoonFrom' => null,
'afternoonTo' => null,
'eveningFrom' => null,
'eveningTo' => null,
'isPresentMorning' => false,
'isPresentAfternoon' => false,
'dayHoursMinutes' => $this->normalizeMinutes($entry['dayHoursMinutes'] ?? null, $employeeId, 'dayHoursMinutes'),
'nightHoursMinutes' => $this->normalizeMinutes($entry['nightHoursMinutes'] ?? null, $employeeId, 'nightHoursMinutes'),
'workshopHoursMinutes' => $this->normalizeMinutes($entry['workshopHoursMinutes'] ?? null, $employeeId, 'workshopHoursMinutes'),
'hasBreakfast' => $this->normalizePresence($entry['hasBreakfast'] ?? false, $employeeId, 'hasBreakfast'),
'hasLunch' => $this->normalizePresence($entry['hasLunch'] ?? false, $employeeId, 'hasLunch'),
'hasDinner' => $this->normalizePresence($entry['hasDinner'] ?? false, $employeeId, 'hasDinner'),
'hasOvernight' => $this->normalizePresence($entry['hasOvernight'] ?? false, $employeeId, 'hasOvernight'),
];
}
if ($isPresenceTracking) {
return [
'morningFrom' => null,
'morningTo' => null,
'afternoonFrom' => null,
'afternoonTo' => null,
'eveningFrom' => null,
'eveningTo' => null,
'isPresentMorning' => $this->normalizePresence($entry['isPresentMorning'] ?? false, $employeeId, 'isPresentMorning'),
'isPresentAfternoon' => $this->normalizePresence($entry['isPresentAfternoon'] ?? false, $employeeId, 'isPresentAfternoon'),
'dayHoursMinutes' => null,
'nightHoursMinutes' => null,
'hasBreakfast' => false,
'hasLunch' => false,
'hasOvernight' => false,
'morningFrom' => null,
'morningTo' => null,
'afternoonFrom' => null,
'afternoonTo' => null,
'eveningFrom' => null,
'eveningTo' => null,
'isPresentMorning' => $this->normalizePresence($entry['isPresentMorning'] ?? false, $employeeId, 'isPresentMorning'),
'isPresentAfternoon' => $this->normalizePresence($entry['isPresentAfternoon'] ?? false, $employeeId, 'isPresentAfternoon'),
'dayHoursMinutes' => null,
'nightHoursMinutes' => null,
'workshopHoursMinutes' => null,
'hasBreakfast' => false,
'hasLunch' => false,
'hasDinner' => false,
'hasOvernight' => false,
];
}
@@ -281,13 +287,15 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
'eveningTo' => $this->normalizeTime($entry['eveningTo'] ?? null, $employeeId, 'eveningTo'),
// On conserve aussi la présence si envoyée (cas forfait affiché côté UI),
// même si le contrat résolu ce jour est en suivi horaire.
'isPresentMorning' => $this->normalizePresence($entry['isPresentMorning'] ?? false, $employeeId, 'isPresentMorning'),
'isPresentAfternoon' => $this->normalizePresence($entry['isPresentAfternoon'] ?? false, $employeeId, 'isPresentAfternoon'),
'dayHoursMinutes' => null,
'nightHoursMinutes' => null,
'hasBreakfast' => false,
'hasLunch' => false,
'hasOvernight' => false,
'isPresentMorning' => $this->normalizePresence($entry['isPresentMorning'] ?? false, $employeeId, 'isPresentMorning'),
'isPresentAfternoon' => $this->normalizePresence($entry['isPresentAfternoon'] ?? false, $employeeId, 'isPresentAfternoon'),
'dayHoursMinutes' => null,
'nightHoursMinutes' => null,
'workshopHoursMinutes' => null,
'hasBreakfast' => false,
'hasLunch' => false,
'hasDinner' => false,
'hasOvernight' => false,
];
}
@@ -368,8 +376,10 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
* isPresentAfternoon:bool,
* dayHoursMinutes:?int,
* nightHoursMinutes:?int,
* workshopHoursMinutes:?int,
* hasBreakfast:bool,
* hasLunch:bool,
* hasDinner:bool,
* hasOvernight:bool
* } $entry
*/
@@ -385,8 +395,10 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
&& false === $entry['isPresentAfternoon']
&& (null === $entry['dayHoursMinutes'] || 0 === $entry['dayHoursMinutes'])
&& (null === $entry['nightHoursMinutes'] || 0 === $entry['nightHoursMinutes'])
&& (null === $entry['workshopHoursMinutes'] || 0 === $entry['workshopHoursMinutes'])
&& false === $entry['hasBreakfast']
&& false === $entry['hasLunch']
&& false === $entry['hasDinner']
&& false === $entry['hasOvernight'];
}
@@ -402,8 +414,10 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
* isPresentAfternoon:bool,
* dayHoursMinutes:?int,
* nightHoursMinutes:?int,
* workshopHoursMinutes:?int,
* hasBreakfast:bool,
* hasLunch:bool,
* hasDinner:bool,
* hasOvernight:bool
* } $entry
*/
@@ -420,8 +434,10 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
->setIsPresentAfternoon($entry['isPresentAfternoon'])
->setDayHoursMinutes($entry['dayHoursMinutes'])
->setNightHoursMinutes($entry['nightHoursMinutes'])
->setWorkshopHoursMinutes($entry['workshopHoursMinutes'])
->setHasBreakfast($entry['hasBreakfast'])
->setHasLunch($entry['hasLunch'])
->setHasDinner($entry['hasDinner'])
->setHasOvernight($entry['hasOvernight'])
// Toute modification invalide la validation chef de site.
->setIsSiteValid(false)
@@ -442,8 +458,10 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
* isPresentAfternoon:bool,
* dayHoursMinutes:?int,
* nightHoursMinutes:?int,
* workshopHoursMinutes:?int,
* hasBreakfast:bool,
* hasLunch:bool,
* hasDinner:bool,
* hasOvernight:bool
* } $entry
*/
@@ -459,8 +477,10 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
&& $workHour->getIsPresentAfternoon() === $entry['isPresentAfternoon']
&& $workHour->getDayHoursMinutes() === $entry['dayHoursMinutes']
&& $workHour->getNightHoursMinutes() === $entry['nightHoursMinutes']
&& $workHour->getWorkshopHoursMinutes() === $entry['workshopHoursMinutes']
&& $workHour->getHasBreakfast() === $entry['hasBreakfast']
&& $workHour->getHasLunch() === $entry['hasLunch']
&& $workHour->getHasDinner() === $entry['hasDinner']
&& $workHour->getHasOvernight() === $entry['hasOvernight'];
}
}