<?php
/**
 * Advanced Coupons Integration.
 *
 * @since   1.0.0
 * @package SAAI
 */

namespace SAAI\Integrations;

use SAAI\Abstracts\Abstract_Class;
use SAAI\Helpers\Connect;

defined( 'ABSPATH' ) || exit;

/**
 * Advanced Coupons Integration class.
 *
 * Integrates with Advanced Coupons for WooCommerce plugin to enable
 * StoreAgent AI features like coupon generation.
 *
 * @since 1.0.0
 */
class Advanced_Coupons extends Abstract_Class {

    /**
     * Run the integration.
     *
     * @since 1.0.0
     * @return void
     */
    public function run() {
        add_filter( 'acfwf_is_storeagent_connected', array( $this, 'is_storeagent_connected' ) );
    }

    /**
     * Check if StoreAgent is connected.
     *
     * This filter is used by Advanced Coupons to determine if StoreAgent AI
     * features (like AI coupon generation) should be available.
     *
     * @since 1.0.0
     *
     * @return bool True if StoreAgent is connected, false otherwise.
     */
    public function is_storeagent_connected() {
        return Connect::is_connected();
    }
}
