<?php

declare(strict_types=1);

namespace Instinctor\Core;

/**
 * Handles plugin deactivation
 */

if (!defined('ABSPATH')) exit;
class Deactivator
{
    public static function deactivate(): void
    {
        // Clear scheduled events (legacy)
        wp_clear_scheduled_hook('instinctor_daily_cleanup');
        wp_clear_scheduled_hook('instinctor_process_subscriptions');
        wp_clear_scheduled_hook('instinctor_check_low_stock');
        
        // v1.3.0 Cron jobs
        \Instinctor\Services\CronService::unschedule();

        // T6 Queue runner cron
        \Instinctor\Core\Queue\WordPressDriver::unschedule();
        
        // Clear permalinks
        flush_rewrite_rules();
    }
}
