<?php

declare(strict_types=1);

namespace App\ApiResource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Dto\WorkHours\WeeklySummaryRow;
use App\State\WorkHourWeeklySummaryProvider;

#[ApiResource(
    operations: [
        new Get(
            uriTemplate: '/work-hours/weekly-summary',
            security: "is_granted('ROLE_USER')",
            provider: WorkHourWeeklySummaryProvider::class
        ),
    ],
    paginationEnabled: false
)]
final class WorkHourWeeklySummary
{
    public string $weekStart = '';
    public string $weekEnd   = '';

    /** @var list<string> */
    public array $days = [];

    /** @var list<WeeklySummaryRow> */
    public array $rows = [];
}
