<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Repository;

use App\Administration\Domain\Model\User\UserId;
use App\Scolarite\Domain\Exception\RenduNonTrouveException;
use App\Scolarite\Domain\Model\Homework\HomeworkId;
use App\Scolarite\Domain\Model\HomeworkSubmission\HomeworkSubmission;
use App\Scolarite\Domain\Model\HomeworkSubmission\HomeworkSubmissionId;
use App\Shared\Domain\Tenant\TenantId;

interface HomeworkSubmissionRepository
{
    public function save(HomeworkSubmission $submission): void;

    /** @throws RenduNonTrouveException */
    public function get(HomeworkSubmissionId $id, TenantId $tenantId): HomeworkSubmission;

    public function findById(HomeworkSubmissionId $id, TenantId $tenantId): ?HomeworkSubmission;

    public function findByHomeworkAndStudent(
        HomeworkId $homeworkId,
        UserId $studentId,
        TenantId $tenantId,
    ): ?HomeworkSubmission;

    /** @return array<HomeworkSubmission> */
    public function findByHomework(HomeworkId $homeworkId, TenantId $tenantId): array;

    /**
     * @return array<string, string|null> Map homeworkId => submission status value (or null)
     */
    public function findStatusesByStudent(UserId $studentId, TenantId $tenantId, HomeworkId ...$homeworkIds): array;
}
