<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Repository;

use App\Scolarite\Domain\Exception\GradeNotFoundException;
use App\Scolarite\Domain\Model\Evaluation\EvaluationId;
use App\Scolarite\Domain\Model\Grade\Grade;
use App\Scolarite\Domain\Model\Grade\GradeId;
use App\Shared\Domain\Tenant\TenantId;

interface GradeRepository
{
    public function save(Grade $grade): void;

    public function saveAppreciation(Grade $grade): void;

    /** @throws GradeNotFoundException */
    public function get(GradeId $id, TenantId $tenantId): Grade;

    public function findById(GradeId $id, TenantId $tenantId): ?Grade;

    /** @return array<Grade> */
    public function findByEvaluation(EvaluationId $evaluationId, TenantId $tenantId): array;

    /**
     * @param array<EvaluationId> $evaluationIds
     *
     * @return array<string, list<Grade>> Clé = evaluationId (string)
     */
    public function findByEvaluations(array $evaluationIds, TenantId $tenantId): array;

    public function hasGradesForEvaluation(EvaluationId $evaluationId, TenantId $tenantId): bool;
}
