<?php
/**
 * Post type extension interface.
 *
 * @package SmartyPress_AI_Engine
 */

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

/**
 * Describes a post type specific generation adapter.
 */
interface SmartyPress_AI_Post_Type_Extension_Interface {

	/**
	 * Check whether this extension supports the post type/settings.
	 *
	 * @param string $post_type Post type.
	 * @param array  $settings Generation settings.
	 * @return bool
	 */
	public function supports( $post_type, array $settings );

	/**
	 * Get generation rules for prompts/context.
	 *
	 * @param array $settings Generation settings.
	 * @return array
	 */
	public function get_generation_rules( array $settings );

	/**
	 * Get SEO optimization rules.
	 *
	 * @param array $settings Generation settings.
	 * @return array
	 */
	public function get_seo_rules( array $settings );

	/**
	 * Build item-specific context.
	 *
	 * @param array $item Queue item.
	 * @param array $settings Generation settings.
	 * @return string
	 */
	public function build_item_context( array $item, array $settings );

	/**
	 * Prepare generated post data before persistence.
	 *
	 * @param array $post_data Generated post data.
	 * @param array $item Queue item.
	 * @param array $settings Generation settings.
	 * @return array
	 */
	public function prepare_post_data( array $post_data, array $item, array $settings );

	/**
	 * Apply metadata after post is persisted.
	 *
	 * @param int   $post_id Post ID.
	 * @param array $post_data Generated post data.
	 * @param array $item Queue item.
	 * @param array $settings Generation settings.
	 * @return void
	 */
	public function apply_metadata( $post_id, array $post_data, array $item, array $settings );
}
