<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\CoreBundle\Tenant;

/**
 * The two things this installation serves over HTTP.
 *
 * A host serves one of them, not both — which is what makes it possible to put
 * the admin on its own domain without a path prefix, and to run a municipality
 * that has an admin area but no public site at all.
 *
 * The exception is a tenant that names no admin domain: its frontend host keeps
 * serving the admin under `/admin`, exactly as a single-tenant build does.
 */
enum Surface: string
{
    /** The public site: the CMS, the offer list, the account area. */
    case Frontend = 'frontend';

    /** The admin area. */
    case Admin = 'admin';

    public function label(): string
    {
        return match ($this) {
            self::Frontend => 'tenants.surface.frontend',
            self::Admin => 'tenants.surface.admin',
        };
    }
}
