fix : calcule des RTT pour les chauffeurs
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-03-20 14:42:36 +01:00
parent a1110069b5
commit 085fe0c150
3 changed files with 16 additions and 2 deletions

View File

@@ -252,6 +252,20 @@ final readonly class RttRecoveryComputationService
private function computeMetrics(WorkHour $workHour): WorkMetrics
{
$driverDay = $workHour->getDayHoursMinutes() ?? 0;
$driverNight = $workHour->getNightHoursMinutes() ?? 0;
$driverWorkshop = $workHour->getWorkshopHoursMinutes() ?? 0;
if ($driverDay > 0 || $driverNight > 0 || $driverWorkshop > 0) {
$totalMinutes = $driverDay + $driverNight + $driverWorkshop;
return new WorkMetrics(
dayMinutes: $driverDay + $driverWorkshop,
nightMinutes: $driverNight,
totalMinutes: $totalMinutes,
);
}
$ranges = [
[$workHour->getMorningFrom(), $workHour->getMorningTo()],
[$workHour->getAfternoonFrom(), $workHour->getAfternoonTo()],