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.
This commit is contained in:
2026-05-19 11:33:06 +02:00
parent 613ac02e1d
commit 8f355e05ad
8 changed files with 109 additions and 47 deletions

View File

@@ -10,6 +10,7 @@ use App\Entity\EmployeeContractPeriod;
use App\Enum\ContractNature;
use App\Enum\TrackingMode;
use App\Service\Contracts\EmployeeContractPhaseResolver;
use App\Service\Exercise\ExerciseYearResolver;
use App\State\EmployeeRttPaymentProcessor;
use DateTimeImmutable;
use PHPUnit\Framework\TestCase;
@@ -141,6 +142,7 @@ final class EmployeeRttPaymentProcessorTest extends TestCase
$this->setReadonlyProperty($processor, 'phaseResolver', new EmployeeContractPhaseResolver());
$this->setReadonlyProperty($processor, 'clock', $clock);
$this->setReadonlyProperty($processor, 'exerciseYearResolver', new ExerciseYearResolver());
return $processor;
}