<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Event;

use App\Administration\Domain\Model\SchoolClass\ClassId;
use App\Administration\Domain\Model\Subject\SubjectId;
use App\Administration\Domain\Model\User\UserId;
use App\Scolarite\Domain\Model\Schedule\DayOfWeek;
use App\Scolarite\Domain\Model\Schedule\ScheduleSlotId;
use App\Shared\Domain\DomainEvent;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

final readonly class CoursCree implements DomainEvent
{
    public function __construct(
        public ScheduleSlotId $slotId,
        public ClassId $classId,
        public SubjectId $subjectId,
        public UserId $teacherId,
        public DayOfWeek $dayOfWeek,
        public string $startTime,
        public string $endTime,
        public ?string $room,
        private DateTimeImmutable $occurredOn,
    ) {
    }

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

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