<?php
if (!defined('ABSPATH')) {
    exit;
}

class Manfiet_Expense_Tracker_Activator {
    public static function activate() {
        // Create database tables
        Manfiet_Expense_Tracker::install();
        Manfiet_Invoice_Manager::install();
        Manfiet_Financial_Account_Manager::install();
        Manfiet_Vendor_Manager::install();
        Manfiet_Client_Manager::install();

        // Add user roles & permissions
        Manfiet_Expense_Role_Permissions::add_roles();

        // Create the frontend page once during activation.
        Manfiet_Expense_Tracker_Pages::create_expense_page();

        if (!wp_next_scheduled('manfiet_send_monthly_report')) {
            wp_schedule_event(time(), 'monthly', 'manfiet_send_monthly_report');
        }
    }
}
