<?php
/**
 * Jasani Filter Hook Registration
 *
 * @package    Common
 * @subpackage Hooks
 * @author     miniOrange <info@miniorange.com>
 * @license    MIT/Expat
 * @link       https://plugins.miniorange.com/woocommerce-api-product-sync-with-woocommerce-rest-apis
 */

namespace MOWCPS\Common\Hooks;

use MOWCPS\Common\Interfaces\Hookable_Interface;
use MOWCPS\Common\Constants\Plugin_Filters;
use MOWCPS\Common\Suppliers\Jasani as Jasani_Supplier;

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

/**
 * Class Jasani
 *
 * Handles Jasani hook registration.
 */
class Jasani implements Hookable_Interface {

	/**
	 * Initialize the Jasani filter hooks
	 */
	public function __construct() {
		$this->register_hooks();
	}

	/**
	 * Register WordPress hooks
	 *
	 * @return void
	 */
	public function register_hooks() {
		add_filter(
			Plugin_Filters::FILTER_DATA_ALTERATION_FILTER,
			array( Jasani_Supplier::class, 'apply_jasani_data_alteration_filters' ),
			10,
			1
		);
		add_filter(
			Plugin_Filters::FILTER_SYNC_SINGLE_VARIANCE_AS_SIMPLE,
			array( Jasani_Supplier::class, 'filter_sync_single_variance_as_simple' ),
			10,
			2
		);
		add_filter(
			Plugin_Filters::FILTER_RESOLVE_PRODUCT_ID_AFTER_META_LOOKUP,
			array( Jasani_Supplier::class, 'filter_resolve_product_id_after_meta_lookup' ),
			10,
			2
		);
	}
}
