[#SIRH-36] corriger calcule rtt contrat custom #27

Merged
tristan merged 16 commits from feature/SIRH-36-corriger-le-calcule-des-rtt-des-contrat-4h into develop 2026-06-11 08:36:57 +00:00
2 changed files with 4 additions and 1 deletions
Showing only changes of commit 4fb3f3fc45 - Show all commits
@@ -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(
@@ -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
{