<?php

declare(strict_types=1);

namespace App\Administration\Domain\Event;

use App\Administration\Domain\Model\StudentGuardian\RelationshipType;
use App\Administration\Domain\Model\StudentGuardian\StudentGuardianId;
use App\Administration\Domain\Model\User\UserId;
use App\Shared\Domain\DomainEvent;
use App\Shared\Domain\Tenant\TenantId;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

/**
 * Event émis lors de la liaison d'un parent à un élève.
 */
final readonly class ParentLieAEleve implements DomainEvent
{
    public function __construct(
        public StudentGuardianId $linkId,
        public UserId $studentId,
        public UserId $guardianId,
        public RelationshipType $relationshipType,
        public TenantId $tenantId,
        private DateTimeImmutable $occurredOn,
    ) {
    }

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

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