<?php

declare(strict_types=1);

namespace App\Administration\Domain\Event;

use App\Administration\Domain\Model\AcademicYear\PeriodType;
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 configuration initiale des périodes d'une année scolaire.
 */
final readonly class PeriodesConfigurees implements DomainEvent
{
    public function __construct(
        public AcademicYearId $academicYearId,
        public TenantId $tenantId,
        public PeriodType $periodType,
        public int $periodCount,
        private DateTimeImmutable $occurredOn,
    ) {
    }

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

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