[#339] Ajout d'une page listant les règles de calcules (#5)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|        #339          |        Ajout d'une page listant les règles de calcules         |

## Description de la PR
[#339] Ajout d'une page listant les règles de calcules

## Modification du .env

## Check list

- [ ] Pas de régression
- [x] TU/TI/TF rédigée
- [x] TU/TI/TF OK
- [ ] CHANGELOG modifié

Reviewed-on: #5
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #5.
This commit is contained in:
2026-02-20 16:17:22 +00:00
committed by Autin
parent 49fecfc27a
commit f8ca5e50a0
16 changed files with 664 additions and 59 deletions

View File

@@ -13,6 +13,7 @@ use App\Entity\WorkHour;
use App\Enum\TrackingMode;
use App\Repository\EmployeeRepository;
use App\Repository\WorkHourRepository;
use App\Service\Contracts\EmployeeContractResolver;
use DateTimeImmutable;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\SecurityBundle\Security;
@@ -27,6 +28,7 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
private Security $security,
private EmployeeRepository $employeeRepository,
private WorkHourRepository $workHourRepository,
private EmployeeContractResolver $contractResolver,
) {}
public function process(
@@ -75,7 +77,8 @@ final readonly class WorkHourBulkUpsertProcessor implements ProcessorInterface
throw new AccessDeniedHttpException(sprintf('Employee %d is outside your scope.', $employeeId));
}
$isPresenceTracking = TrackingMode::PRESENCE->value === $employee->getContract()?->getTrackingMode();
$contract = $this->contractResolver->resolveForEmployeeAndDate($employee, $workDate);
$isPresenceTracking = TrackingMode::PRESENCE->value === $contract?->getTrackingMode();
$normalized = $this->normalizeEntry($entry, $employeeId, $isPresenceTracking);
$existing = $existingByEmployeeId[$employeeId] ?? null;