<?php

declare(strict_types=1);

namespace App\SuperAdmin\Domain\Event;

use App\Shared\Domain\DomainEvent;
use App\Shared\Domain\Tenant\TenantId;
use App\SuperAdmin\Domain\Model\Establishment\EstablishmentId;
use DateTimeImmutable;
use Override;
use Ramsey\Uuid\UuidInterface;

final readonly class EtablissementCree implements DomainEvent
{
    public function __construct(
        public EstablishmentId $establishmentId,
        public TenantId $tenantId,
        public string $name,
        public string $subdomain,
        private DateTimeImmutable $occurredOn,
    ) {
    }

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

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