<?php

declare(strict_types=1);

namespace App\Module\Reporting\Infrastructure\ApiPlatform\Resource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use App\Module\Reporting\Application\DTO\TasksByStatusOutput;
use App\Module\Reporting\Infrastructure\ApiPlatform\State\TasksByStatusProvider;

/**
 * Rapport en lecture seule : nombre de taches non archivees par statut.
 *
 * Filtre query-param : ?projectId=
 *
 * Aucune entite Doctrine sous-jacente : le provider lit via DBAL et retourne
 * directement une liste de TasksByStatusOutput. Pagination desactivee.
 */
#[ApiResource(
    shortName: 'ReportTasksByStatus',
    operations: [
        new GetCollection(
            uriTemplate: '/reports/tasks-by-status',
            paginationEnabled: false,
            security: "is_granted('reporting.view')",
            provider: TasksByStatusProvider::class,
        ),
    ],
    output: TasksByStatusOutput::class,
)]
final class TasksByStatusResource {}
