<?php

declare(strict_types=1);

namespace App\Administration\Domain\Event;

use App\Shared\Domain\DomainEvent;
use App\Shared\Domain\Tenant\TenantId;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

/**
 * Event emitted when a user account is activated.
 *
 * This event triggers the sending of a confirmation email
 * and any other side effects related to account activation.
 */
final readonly class CompteActive implements DomainEvent
{
    public function __construct(
        public string $userId,
        public string $email,
        public TenantId $tenantId,
        public string $role,
        private DateTimeImmutable $occurredOn,
        private UuidInterface $aggregateId,
    ) {
    }

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

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