<?php
/**
 * Importer Interface
 *
 * Defines the contract for all migration importer classes.
 * Every method returns [ 'success' => bool, 'message' => string ].
 *
 * @package SEOvaultSEO\Migration
 */

namespace SEOvaultSEO\Migration;

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

interface ImporterInterface {

	/**
	 * Get the human-readable name of the plugin being imported from.
	 *
	 * @return string
	 */
	public function get_plugin_name();

	/**
	 * Get the plugin file path for the plugin being imported from.
	 *
	 * @return string
	 */
	public function get_plugin_file();

	/**
	 * Check if the source plugin is active.
	 *
	 * @return bool
	 */
	public function is_plugin_active();

	/**
	 * Detect whether the source plugin has data for the given post.
	 *
	 * @param int $post_id Post ID.
	 * @return array
	 */
	public function detect_post( $post_id );

	/**
	 * Detect whether the source plugin has data for the given term.
	 *
	 * @param int $term_id Term ID.
	 * @return array
	 */
	public function detect_term( $term_id );

	/**
	 * Import data for a specific post.
	 *
	 * @param int $post_id Post ID.
	 * @return array
	 */
	public function import_post( $post_id );

	/**
	 * Import data for a specific term.
	 *
	 * @param int $term_id Term ID.
	 * @return array
	 */
	public function import_term( $term_id );

	/**
	 * Import global settings from the source plugin.
	 *
	 * @return array
	 */
	public function import_global_settings();

	/**
	 * Clean up source-plugin data after import (if desired).
	 *
	 * @return array
	 */
	public function cleanup();

	/**
	 * Import meta-robots settings for a post.
	 *
	 * @param int $post_id Post ID.
	 * @return array
	 */
	public function import_post_meta_robots( $post_id );

	/**
	 * Import meta-robots settings for a term.
	 *
	 * @param int $term_id Term ID.
	 * @return array
	 */
	public function import_term_meta_robots( $term_id );

	/**
	 * Import general SEO settings for a post.
	 *
	 * @param int $post_id Post ID.
	 * @return array
	 */
	public function import_post_general_settings( $post_id );

	/**
	 * Import general SEO settings for a term.
	 *
	 * @param int $term_id Term ID.
	 * @return array
	 */
	public function import_term_general_settings( $term_id );

	/**
	 * Import social metadata for a post.
	 *
	 * @param int $post_id Post ID.
	 * @return array
	 */
	public function import_post_social( $post_id );

	/**
	 * Import social metadata for a term.
	 *
	 * @param int $term_id Term ID.
	 * @return array
	 */
	public function import_term_social( $term_id );

	/**
	 * Persist SEOvault settings for a post.
	 *
	 * @param int   $post_id Post ID.
	 * @param array $data    Prepared meta array.
	 * @return array
	 */
	public function update_post_meta_data( $post_id, array $data );

	/**
	 * Persist SEOvault settings for a term.
	 *
	 * @param int   $term_id Term ID.
	 * @param array $data    Prepared meta array.
	 * @return array
	 */
	public function update_term_meta_data( $term_id, array $data );

	/**
	 * Get count and post IDs for batch processing.
	 *
	 * @param array $post_types  Post types to check.
	 * @param int   $batch_size  Batch size.
	 * @param int   $offset      Offset.
	 * @return array
	 */
	public function get_count_and_posts( $post_types, $batch_size, $offset );

	/**
	 * Get count and term IDs for batch processing.
	 *
	 * @param array $taxonomies        Taxonomy names.
	 * @param array $taxonomies_objects Taxonomy objects.
	 * @param int   $batch_size        Batch size.
	 * @param int   $offset            Offset.
	 * @return array
	 */
	public function get_count_and_terms( $taxonomies, $taxonomies_objects, $batch_size, $offset );
}
