diff --git a/src/Service/Rtt/RttRecoveryComputationService.php b/src/Service/Rtt/RttRecoveryComputationService.php index c40044a..19b8c1d 100644 --- a/src/Service/Rtt/RttRecoveryComputationService.php +++ b/src/Service/Rtt/RttRecoveryComputationService.php @@ -254,7 +254,8 @@ final readonly class RttRecoveryComputationService } $contractAtSolidarity = $employeeContractsByDate[$solidarityDate] ?? null; - $solidarityIsoDay = (int) new DateTimeImmutable($solidarityDate)->format('N'); + // Le Lundi de Pentecôte est toujours un lundi (ISO 1), mais on le dérive pour rester explicite. + $solidarityIsoDay = (int) new DateTimeImmutable($solidarityDate)->format('N'); // Attendu RÉEL du jour (planning workDaysHours), pas la répartition uniforme : // c'est ce qui rend la neutralisation correcte (cf. spec). $solidarityExpected = $this->dailyReferenceResolver->resolve( diff --git a/tests/Service/Rtt/RttRecoveryComputationServiceTest.php b/tests/Service/Rtt/RttRecoveryComputationServiceTest.php index 09232b9..b6c9630 100644 --- a/tests/Service/Rtt/RttRecoveryComputationServiceTest.php +++ b/tests/Service/Rtt/RttRecoveryComputationServiceTest.php @@ -209,6 +209,8 @@ final class RttRecoveryComputationServiceTest extends TestCase /** * CUSTOM 28h : prorata = round(28×12) = 336 (5h36). worked 0, expected 336 → delta 0. + * Le delta est nul ici par coïncidence du fallback uniforme (expected = prorata) ; avec un vrai + * workDaysHours où la valeur du lundi diffère, expected ≠ prorata et le delta serait non nul. */ public function testSolidarityAdjustmentCustom28hUsesProrata(): void {