Commit Graph

2 Commits

Author SHA1 Message Date
8f355e05ad refactor(exercise) : extract ExerciseYearResolver to dedup year formula
Pull the "date -> leave/RTT exercise year" formula out of
EmployeeRttPaymentProcessor, EmployeeRttSummaryProvider and
EmployeeLeaveSummaryProvider into a single
App\Service\Exercise\ExerciseYearResolver. Forfait flag is parameterised
so the leave (calendar year) and RTT (Juin N-1 -> Mai N) variants share
the same implementation. Pure refactor, no behavioural change.
2026-05-19 11:33:06 +02:00
8684d240bc feat(rtt) : phaseId support in EmployeeRttSummaryProvider
Mirror Task 3 (leave provider) on the RTT side: accept an optional `?phaseId`
query parameter and cap the exercise window to the phase boundaries when set.

- Inject EmployeeContractPhaseResolver.
- New helpers: resolveTargetPhase, clampYearToPhase, exerciseYearForDate.
- resolveYear now takes the phase: default year falls back to the phase end
  date when phaseId is provided; explicit year is silently clamped to the
  phase range.
- provide() narrows periodFrom / periodTo / limitDate to the phase end date
  for past phases.
- Default behavior (no phaseId) unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 11:15:22 +02:00