<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Event;

use App\Administration\Domain\Model\User\UserId;
use App\Scolarite\Domain\Model\TeacherReplacement\TeacherReplacementId;
use App\Shared\Domain\DomainEvent;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

final readonly class RemplacementDesigne implements DomainEvent
{
    public function __construct(
        public TeacherReplacementId $replacementId,
        public UserId $replacedTeacherId,
        public UserId $replacementTeacherId,
        public DateTimeImmutable $startDate,
        public DateTimeImmutable $endDate,
        private DateTimeImmutable $occurredOn,
    ) {
    }

    #[Override]
    public function occurredOn(): DateTimeImmutable
    {
        return $this->occurredOn;
    }

    #[Override]
    public function aggregateId(): UuidInterface
    {
        return $this->replacementId->value;
    }
}
