<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Event;

use App\Administration\Domain\Model\User\UserId;
use App\Scolarite\Domain\Model\Homework\HomeworkId;
use App\Scolarite\Domain\Model\Homework\HomeworkRuleExceptionId;
use App\Shared\Domain\DomainEvent;
use App\Shared\Domain\Tenant\TenantId;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

final readonly class ExceptionDevoirDemandee implements DomainEvent
{
    /**
     * @param string[] $ruleTypes
     */
    public function __construct(
        public HomeworkRuleExceptionId $exceptionId,
        public TenantId $tenantId,
        public HomeworkId $homeworkId,
        public array $ruleTypes,
        public string $justification,
        public UserId $createdBy,
        private DateTimeImmutable $occurredOn,
    ) {
    }

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

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