<?php
/**
 * Template knowledge ability schemas.
 *
 * @package LolaCoreForBricks
 */

declare(strict_types=1);

namespace LolaCoreForBricks\Schemas;

use LolaCoreForBricks\AbilitiesProvider;

/**
 * Door 1 schemas for template reads and resolution.
 */
class TemplateSchemas
{
    /**
     * @return array<string, array<string, mixed>>
     */
    public static function define(): array
    {
        return [
            'getTemplates' => [
                'description' => 'List Bricks templates with type, conditions, and publish status.',
                'category'    => AbilitiesProvider::CATEGORY,
                'keywords'    => [
                    'exact' => ['bricks templates', 'plantillas bricks'],
                    'stem'  => ['template', 'plantilla'],
                ],
                'parameters'  => [
                    'type'       => 'object',
                    'properties' => array_merge(SchemaPagination::properties(), [
                        'type' => ['type' => 'string', 'description' => 'Filter by template type (header, footer, content, popup, etc.).'],
                    ]),
                ],
            ],
            'resolveTemplateForPage' => [
                'description' => 'Resolve which Bricks templates win for header, footer, and content on a page, with plain-language conditions.',
                'category'    => AbilitiesProvider::CATEGORY,
                'keywords'    => [
                    'exact' => ['resolve template', 'which template applies', 'plantilla activa'],
                    'stem'  => ['resolve', 'template'],
                ],
                'parameters'  => [
                    'type'       => 'object',
                    'properties' => [
                        'post_id' => ['type' => 'integer'],
                    ],
                    'required'   => ['post_id'],
                ],
            ],
        ];
    }
}
