<?php

declare(strict_types=1);

namespace App\Scolarite\Infrastructure\Api\Resource;

use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use App\Scolarite\Infrastructure\Api\Provider\StudentCompetencyProgressProvider;

#[ApiResource(
    shortName: 'StudentCompetencyProgress',
    operations: [
        new GetCollection(
            uriTemplate: '/students/{studentId}/competency-progress',
            uriVariables: ['studentId'],
            provider: StudentCompetencyProgressProvider::class,
            name: 'get_student_competency_progress',
        ),
    ],
)]
final class StudentCompetencyProgressResource
{
    #[ApiProperty(identifier: true)]
    public ?string $competencyId = null;

    public ?string $competencyCode = null;

    public ?string $competencyName = null;

    public ?string $currentLevelCode = null;

    public ?string $currentLevelName = null;

    /** @var array<array{date: string, levelCode: string, evaluationTitle: string}> */
    public array $history = [];
}
