<?php

declare(strict_types=1);

namespace App\Administration\Domain\Event;

use App\Administration\Domain\Model\GradingConfiguration\GradingMode;
use App\Administration\Domain\Model\GradingConfiguration\SchoolGradingConfigurationId;
use App\Administration\Domain\Model\SchoolClass\AcademicYearId;
use App\Administration\Domain\Model\SchoolClass\SchoolId;
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 ou du changement du mode de notation.
 */
final readonly class ModeNotationConfigure implements DomainEvent
{
    public function __construct(
        public SchoolGradingConfigurationId $configurationId,
        public TenantId $tenantId,
        public SchoolId $schoolId,
        public AcademicYearId $academicYearId,
        public GradingMode $mode,
        private DateTimeImmutable $occurredOn,
    ) {
    }

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

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