<?php

declare(strict_types=1);

namespace App\Administration\Domain\Repository;

use App\Administration\Domain\Exception\ParentInvitationNotFoundException;
use App\Administration\Domain\Model\Invitation\InvitationCode;
use App\Administration\Domain\Model\Invitation\InvitationStatus;
use App\Administration\Domain\Model\Invitation\ParentInvitation;
use App\Administration\Domain\Model\Invitation\ParentInvitationId;
use App\Administration\Domain\Model\User\UserId;
use App\Shared\Domain\Tenant\TenantId;
use DateTimeImmutable;

interface ParentInvitationRepository
{
    public function save(ParentInvitation $invitation): void;

    /**
     * @throws ParentInvitationNotFoundException
     */
    public function get(ParentInvitationId $id, TenantId $tenantId): ParentInvitation;

    public function findById(ParentInvitationId $id, TenantId $tenantId): ?ParentInvitation;

    public function findByCode(InvitationCode $code): ?ParentInvitation;

    /**
     * @return ParentInvitation[]
     */
    public function findAllByTenant(TenantId $tenantId): array;

    /**
     * @return ParentInvitation[]
     */
    public function findByStudent(UserId $studentId, TenantId $tenantId): array;

    /**
     * @return ParentInvitation[]
     */
    public function findByStatus(InvitationStatus $status, TenantId $tenantId): array;

    /**
     * @return ParentInvitation[]
     */
    public function findExpiredSent(DateTimeImmutable $at): array;

    public function delete(ParentInvitationId $id, TenantId $tenantId): void;
}
