<?php

class YATOON_Deactivator {
    
    public static function deactivate() {
        // Unschedule tasks
        $timestamp = wp_next_scheduled('yatoon_sync_square_data');
        if ($timestamp) {
            wp_unschedule_event($timestamp, 'yatoon_sync_square_data');
        }
        $waitlist_timestamp = wp_next_scheduled('yatoon_check_waitlist_availability');
        if ($waitlist_timestamp) {
            wp_unschedule_event($waitlist_timestamp, 'yatoon_check_waitlist_availability');
        }
        
        // Flush rewrite rules
        flush_rewrite_rules();
    }
}
