<?php

declare(strict_types=1);

namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Dto\Rtt\EmployeeRttWeekSummary;
use App\Dto\Rtt\RttMonthPayment;
use App\State\EmployeeRttSummaryProvider;

#[ApiResource(
    operations: [
        new Get(
            uriTemplate: '/employees/{id}/rtt-summary',
            security: "is_granted('ROLE_ADMIN')",
            provider: EmployeeRttSummaryProvider::class
        ),
    ],
    paginationEnabled: false
)]
final class EmployeeRttSummary
{
    public int $year                         = 0;
    public int $carryMonth                   = 5;
    public int $carryFromPreviousYearMinutes = 0;
    public int $carryBase25Minutes           = 0;
    public int $carryBonus25Minutes          = 0;
    public int $carryBase50Minutes           = 0;
    public int $carryBonus50Minutes          = 0;
    public int $currentYearRecoveryMinutes   = 0;
    public int $availableMinutes             = 0;
    public int $totalPaidMinutes             = 0;
    public ?string $rttStartDate             = null;

    /** @var list<RttMonthPayment> */
    public array $monthPayments = [];

    /** @var list<EmployeeRttWeekSummary> */
    public array $weeks = [];
}
