<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Repository;

use App\Administration\Domain\Model\SchoolClass\ClassId;
use App\Administration\Domain\Model\Subject\SubjectId;
use App\Administration\Domain\Model\User\UserId;
use App\Scolarite\Domain\Exception\EvaluationNotFoundException;
use App\Scolarite\Domain\Model\Evaluation\Evaluation;
use App\Scolarite\Domain\Model\Evaluation\EvaluationId;
use App\Shared\Domain\Tenant\TenantId;
use DateTimeImmutable;

interface EvaluationRepository
{
    public function save(Evaluation $evaluation): void;

    /** @throws EvaluationNotFoundException */
    public function get(EvaluationId $id, TenantId $tenantId): Evaluation;

    public function findById(EvaluationId $id, TenantId $tenantId): ?Evaluation;

    /** @return array<Evaluation> */
    public function findByTeacher(UserId $teacherId, TenantId $tenantId): array;

    /** @return array<Evaluation> */
    public function findByTeacherAndClass(UserId $teacherId, ClassId $classId, TenantId $tenantId): array;

    /** @return array<Evaluation> */
    public function findByClass(ClassId $classId, TenantId $tenantId): array;

    /** @return array<Evaluation> Toutes les évaluations publiées (notes visibles) */
    public function findAllWithPublishedGrades(TenantId $tenantId): array;

    /** @return array<Evaluation> Évaluations dont les notes sont publiées */
    public function findWithPublishedGradesBySubjectAndClassInDateRange(
        SubjectId $subjectId,
        ClassId $classId,
        DateTimeImmutable $startDate,
        DateTimeImmutable $endDate,
        TenantId $tenantId,
    ): array;
}
