<?php

declare(strict_types=1);

namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\State\WorkHourDayContextProvider;

#[ApiResource(
    operations: [
        new Get(
            uriTemplate: '/work-hours/day-context',
            security: "is_granted('ROLE_USER')",
            provider: WorkHourDayContextProvider::class
        ),
    ],
    paginationEnabled: false
)]
final class WorkHourDayContext
{
    public string $workDate = '';

    /**
     * @var list<array{
     *     employeeId:int,
     *     hasContractAtDate:bool,
     *     absenceLabel:?string,
     *     absenceColor:?string,
     *     absenceHalf:?string,
     *     absentMorning:bool,
     *     absentAfternoon:bool,
     *     creditedMinutes:int,
     *     creditedPresenceUnits:float,
     *     isDriverContract:bool,
     *     hasFormation:bool,
     *     formationLabel:?string,
     *     virtualHolidayMinutes:int,
     *     contractNature:?string,
     *     trackingMode:?string,
     *     weeklyHours:?int,
     *     contractType:?string,
     *     contractName:?string,
     *     workDaysHours:?array<int, int>
     * }>
     */
    public array $rows = [];
}
