<?php

declare(strict_types=1);

/** APO-196 Card 6 — GET /api/v1/administration/site-settings */
final class MyronGetSiteSettingsAction implements MyronAction
{
    public function __construct(private readonly MyronSiteSettingsRepository $repo) {}
    public function metadata(): MyronActionMetadata
    {
        return new MyronActionMetadata(
            uri: '/api/v1/administration/site-settings', method: 'GET',
            domain: 'administration', resource: 'site-settings', verb: 'get',
            inputSchema: ['type' => 'object', 'properties' => []],
            outputSchema: ['type' => 'object', 'properties' => []],
            requiredScope: MyronApiScopes::ADMINISTRATION_READ,
            summary: 'Get the install site settings (site name, contact, locale, defaults, meta).',
            audienceClass: 3,
            snapshotInclude: true, snapshotKey: 'administration.siteSettings',
            exposeToMcp: true,
        );
    }
    public function execute(array $input, MyronActionCallerContext $caller): MyronActionResult
    {
        return MyronActionResult::ok((array) $this->repo->getSettings());
    }
}
