<?php

declare(strict_types=1);

namespace App\Administration\Domain\Event;

use App\Administration\Domain\Model\SchoolClass\AcademicYearId;
use App\Shared\Domain\DomainEvent;
use App\Shared\Domain\Tenant\TenantId;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

/**
 * Événement émis lors de la modification des dates d'une période scolaire.
 */
final readonly class PeriodeModifiee implements DomainEvent
{
    public function __construct(
        public AcademicYearId $academicYearId,
        public TenantId $tenantId,
        public int $periodSequence,
        public string $periodLabel,
        private DateTimeImmutable $occurredOn,
    ) {
    }

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

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