<?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\StudentGradeCollectionProvider;

#[ApiResource(
    shortName: 'StudentGrade',
    operations: [
        new GetCollection(
            uriTemplate: '/me/grades',
            provider: StudentGradeCollectionProvider::class,
            name: 'get_my_grades',
        ),
        new GetCollection(
            uriTemplate: '/me/grades/subject/{subjectId}',
            uriVariables: ['subjectId'],
            provider: StudentGradeCollectionProvider::class,
            name: 'get_my_grades_by_subject',
        ),
    ],
)]
final class StudentGradeResource
{
    #[ApiProperty(identifier: true)]
    public ?string $id = null;

    public ?string $evaluationId = null;

    public ?string $evaluationTitle = null;

    public ?string $evaluationDate = null;

    public ?int $gradeScale = null;

    public ?float $coefficient = null;

    public ?string $subjectId = null;

    public ?string $subjectName = null;

    public ?float $value = null;

    public ?string $status = null;

    public ?string $appreciation = null;

    public ?string $publishedAt = null;

    public ?float $classAverage = null;

    public ?float $classMin = null;

    public ?float $classMax = null;
}
