<?php

declare(strict_types=1);

namespace App\Service\Contracts;

use App\Entity\Contract;
use App\Entity\Employee;
use App\Entity\EmployeeContractPeriod;
use App\Enum\ContractNature;
use DateTimeImmutable;

interface EmployeeContractPeriodManagerInterface
{
    /**
     * @param null|array<int, int> $workDaysHours iso-day → minutes
     */
    public function ensureContractPeriodExists(
        Employee $employee,
        Contract $contract,
        DateTimeImmutable $startDate,
        ?DateTimeImmutable $endDate,
        ContractNature $nature,
        bool $isDriver = false,
        ?array $workDaysHours = null,
        ?int $interimAgencyId = null,
    ): void;

    public function closeCurrentPeriod(
        ?EmployeeContractPeriod $todayPeriod,
        DateTimeImmutable $requestedEndDate,
        bool $paidLeaveSettled,
        ?string $comment = null,
        bool $isAlreadyEnded = false
    ): void;

    /**
     * @param null|array<int, int> $workDaysHours iso-day → minutes
     */
    public function createNextPeriod(
        Employee $employee,
        Contract $contract,
        DateTimeImmutable $startDate,
        ?DateTimeImmutable $endDate,
        ContractNature $nature,
        ?EmployeeContractPeriod $todayPeriod,
        bool $isDriver = false,
        ?array $workDaysHours = null,
        ?int $interimAgencyId = null,
    ): void;
}
