<?php
/**
 * Template Mapping Hooks – wires AJAX actions to controller static endpoints.
 *
 * @package    MOMCS_Sync
 * @subpackage MOMCS_Sync\includes\common\hooks
 * @author     miniOrange
 */

declare(strict_types=1);

namespace MOMCS_Sync\Includes\Common\Hooks;

use MOMCS_Sync\Includes\Common\Controllers\Template_Mapping\Template_Mapping_Controller;

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

/**
 * Template Mapping Hooks.
 */
class Template_Mapping_Hooks {
	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->register_hooks();
	}

	/**
	 * Register AJAX hooks for template mapping feature.
	 */
	private function register_hooks(): void {
		add_action( 'wp_ajax_momcs_sync_save_template_mapping', array( Template_Mapping_Controller::class, 'handle_save_template_mapping' ) );
		add_action( 'wp_ajax_momcs_sync_get_template_mapping', array( Template_Mapping_Controller::class, 'handle_get_template_mapping' ) );
		add_action( 'wp_ajax_momcs_sync_validate_parent_mapping', array( \MOMCS_Sync\Includes\Common\Controllers\Template_Mapping\Unified_Mapping_Controller::class, 'handle_validate_parent_mapping' ) );
	}
}
