<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Repository;

use App\Scolarite\Domain\Model\Schedule\ScheduleException;
use App\Scolarite\Domain\Model\Schedule\ScheduleExceptionId;
use App\Scolarite\Domain\Model\Schedule\ScheduleSlotId;
use App\Shared\Domain\Tenant\TenantId;
use DateTimeImmutable;

interface ScheduleExceptionRepository
{
    public function save(ScheduleException $exception): void;

    public function findById(ScheduleExceptionId $id, TenantId $tenantId): ?ScheduleException;

    public function findForSlotAndDate(
        ScheduleSlotId $slotId,
        DateTimeImmutable $date,
        TenantId $tenantId,
    ): ?ScheduleException;

    /**
     * @return array<ScheduleException>
     */
    public function findForSlotBetweenDates(
        ScheduleSlotId $slotId,
        DateTimeImmutable $startDate,
        DateTimeImmutable $endDate,
        TenantId $tenantId,
    ): array;

    /**
     * @return array<ScheduleException>
     */
    public function findForDateRange(
        TenantId $tenantId,
        DateTimeImmutable $startDate,
        DateTimeImmutable $endDate,
    ): array;

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