<?php

declare(strict_types=1);

/** APO-196 Card 6 — GET /api/v1/administration/users/registration-settings */
final class MyronGetRegistrationSettingsAction implements MyronAction
{
    public function __construct(private readonly MyronAuthRepository $auth) {}
    public function metadata(): MyronActionMetadata
    {
        return new MyronActionMetadata(
            uri: '/api/v1/administration/users/registration-settings', method: 'GET',
            domain: 'administration', resource: 'registration-settings', verb: 'get',
            inputSchema: ['type' => 'object', 'properties' => []],
            outputSchema: ['type' => 'object', 'properties' => []],
            requiredScope: MyronApiScopes::ADMINISTRATION_READ,
            summary: 'Get the current registration settings (allowed email domains).',
            audienceClass: 3,
            snapshotInclude: true, snapshotKey: 'administration.registrationSettings',
            exposeToMcp: true,
        );
    }
    public function execute(array $input, MyronActionCallerContext $caller): MyronActionResult
    {
        return MyronActionResult::ok((array) $this->auth->getRegistrationSettings());
    }
}
