<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Event;

use App\Scolarite\Domain\Model\Competency\StudentCompetencyResultId;
use App\Shared\Domain\DomainEvent;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

final readonly class ResultatCompetenceModifie implements DomainEvent
{
    public function __construct(
        public StudentCompetencyResultId $resultId,
        public string $competencyEvaluationId,
        public string $studentId,
        public string $oldLevelCode,
        public string $newLevelCode,
        private DateTimeImmutable $occurredOn,
    ) {
    }

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

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