<?php

declare(strict_types=1);

namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\QueryParameter;
use App\State\AbsencePrintProvider;

#[ApiResource(
    operations: [
        new Get(
            uriTemplate: '/absences/print',
            provider: AbsencePrintProvider::class,
            parameters: [
                new QueryParameter(key: 'from', required: true),
                new QueryParameter(key: 'to', required: true),
                new QueryParameter(key: 'sites', required: false),
                new QueryParameter(key: 'contractNatures', required: false),
                new QueryParameter(key: 'workContracts', required: false),
            ],
            security: "is_granted('ROLE_ADMIN')"
        ),
    ]
)]
final class AbsencePrint {}
