<?php

declare(strict_types=1);

namespace App\Scolarite\Infrastructure\Api\Resource;

use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Scolarite\Infrastructure\Api\Provider\ClassStatisticsProvider;

#[ApiResource(
    shortName: 'ClassStatistics',
    operations: [
        new Get(
            uriTemplate: '/classes/{classId}/statistics',
            provider: ClassStatisticsProvider::class,
            name: 'get_class_statistics',
        ),
    ],
)]
final class ClassStatisticsResource
{
    #[ApiProperty(identifier: true)]
    public ?string $classId = null;

    public ?string $periodId = null;

    /** @var list<array{evaluationId: string, title: string, average: float|null, min: float|null, max: float|null, median: float|null, gradedCount: int}> */
    public array $evaluations = [];
}
