<?php

use MintyPHP\Http\ApiBootstrap;
use MintyPHP\Http\ApiResponse;
use MintyPHP\Service\Settings\SettingsAppGateway;

ApiBootstrap::init(requireAuth: false);
ApiResponse::requireMethod('GET');

$settingsAppGateway = app(SettingsAppGateway::class);

header('Cache-Control: public, max-age=60');

// Appearance (theme, primary color) is tenant-scoped — the public settings
// endpoint exposes only the non-tenant, non-appearance surface.
ApiResponse::success([
    'data' => [
        'app_title' => $settingsAppGateway->getAppTitle(),
        'registration_enabled' => $settingsAppGateway->isRegistrationEnabled(),
    ],
]);
