<?php
/**
 * Taxonomy schema definition.
 *
 * @package AIPT\Api\PromptBuilder\Schemas
 * @since   2.6.0
 */

namespace AIPT\Api\PromptBuilder\Schemas;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Provides the step schema for the taxonomy generator wizard.
 */
class TaxonomySchema {

	/**
	 * Get the schema configuration for the taxonomy generator.
	 *
	 * @return array<string, mixed> Schema configuration.
	 */
	public static function get_schema(): array {
		return array(
			'generator_type' => 'taxonomy',
			'label'          => __( 'Taxonomy Generator', 'ai-product-tools' ),
			'description'    => __( 'Create prompt instructions for taxonomy descriptions and naming tasks.', 'ai-product-tools' ),
			'prompt_mode'    => 'additional',
			'steps'          => array(
				array(
					'key'         => 'writing_tone',
					'type'        => 'multi_select',
					'label'       => __( 'Writing Tone', 'ai-product-tools' ),
					'description' => __( 'Choose up to 3 tones that match your brand voice.', 'ai-product-tools' ),
					'required'    => true,
					'options_key' => 'tones',
					'min_items'   => 1,
					'max_items'   => 3,
				),
			array(
				'key'         => 'target_audience',
				'type'        => 'multi_select',
					'label'       => __( 'Target Audience', 'ai-product-tools' ),
					'description' => __( 'Select up to 3 audiences this taxonomy content targets.', 'ai-product-tools' ),
					'required'    => false,
					'options_key' => 'target_audiences',
					'max_items'   => 3,
				),
				array(
					'key'         => 'purpose',
					'type'        => 'single_select',
					'label'       => __( 'Purpose', 'ai-product-tools' ),
					'description' => __( 'Choose what kind of taxonomy content should be generated.', 'ai-product-tools' ),
					'required'    => true,
					'options'     => array(
						array(
							'value' => 'seo_description',
							'label' => __( 'SEO Description', 'ai-product-tools' ),
						),
						array(
							'value' => 'display_name',
							'label' => __( 'Display Name', 'ai-product-tools' ),
						),
						array(
							'value' => 'marketing_description',
							'label' => __( 'Marketing Description', 'ai-product-tools' ),
						),
					),
				),
				array(
					'key'         => 'content_length',
					'type'        => 'single_select',
					'label'       => __( 'Content Length', 'ai-product-tools' ),
					'description' => __( 'Choose the desired detail level for the output.', 'ai-product-tools' ),
					'required'    => true,
					'options'     => array(
						array(
							'value' => 'short',
							'label' => __( 'Short (50-100 words)', 'ai-product-tools' ),
						),
						array(
							'value' => 'medium',
							'label' => __( 'Medium (100-250 words)', 'ai-product-tools' ),
						),
						array(
							'value' => 'long',
							'label' => __( 'Long (250-500 words)', 'ai-product-tools' ),
						),
					),
				),
				array(
					'key'           => 'language',
					'type'          => 'text_input',
					'label'         => __( 'Language', 'ai-product-tools' ),
					'description'   => __( 'Specify the language the taxonomy content should use.', 'ai-product-tools' ),
					'required'      => true,
					'default_value' => 'English',
					'placeholder'   => __( 'e.g. English, Turkish', 'ai-product-tools' ),
				),
			array(
				'key'         => 'custom_prompt_variables',
				'type'        => 'variables_textarea',
				'label'       => __( 'Custom Prompt with Variables', 'ai-product-tools' ),
				'description' => __( 'Write custom instructions using taxonomy or term variables. Variables like {TERM_NAME}, {DESCRIPTION}, {PARENT} will be replaced with actual taxonomy data during generation.', 'ai-product-tools' ),
				'required'    => false,
				'placeholder' => __( 'e.g. Focus on the {TERM_NAME} term. Mention {PARENT} as the parent category and include {DESCRIPTION}.', 'ai-product-tools' ),
			),
				array(
					'key'         => 'special_instructions',
					'type'        => 'textarea',
					'label'       => __( 'Special Instructions', 'ai-product-tools' ),
					'description' => __( 'Add any extra guidance for the taxonomy output.', 'ai-product-tools' ),
					'required'    => false,
					'placeholder' => __( 'Any specific requirements...', 'ai-product-tools' ),
				),
				array(
					'key'         => 'review',
					'type'        => 'review',
					'label'       => __( 'Review', 'ai-product-tools' ),
					'description' => __( 'Review your selections before generating the prompt.', 'ai-product-tools' ),
				),
			),
		);
	}
}
