<?php

declare(strict_types=1);

namespace App\Shared\Infrastructure\Tenant;

interface TenantRegistry
{
    /**
     * Retrieves the tenant configuration for the given tenant ID.
     *
     * @throws TenantNotFoundException if tenant does not exist
     */
    public function getConfig(TenantId $tenantId): TenantConfig;

    /**
     * Retrieves the tenant configuration for the given subdomain.
     *
     * @throws TenantNotFoundException if tenant does not exist
     */
    public function getBySubdomain(string $subdomain): TenantConfig;

    /**
     * Checks if a tenant with the given subdomain exists.
     */
    public function exists(string $subdomain): bool;

    /**
     * Retrieves all tenant configurations.
     *
     * @return TenantConfig[]
     */
    public function getAllConfigs(): array;
}
