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

require_once BLR_BA_DIR . 'app/Modules/Outreach/module.php';
require_once BLR_BA_DIR . 'app/Modules/Notifications/module.php';

function blr_ba_activate(): void {
    \BLR\Backline\Core\SettingsPage::maybe_migrate_legacy_options();
    \BLR\Backline\Core\Access::grant_administrator_caps();
    \BLR\Backline\Core\Router::add_rewrite_rules();
    \BLR\Backline\Modules\Outreach\Module::ensure_cron_infrastructure();
    \BLR\Backline\Modules\Notifications\Module::install();
    update_option(\BLR\Backline\Core\SettingsPage::OPT_PLUGIN_VERSION, BLR_BA_VERSION, false);
    flush_rewrite_rules();
}

function blr_ba_deactivate(): void {
    \BLR\Backline\Modules\Outreach\Module::clear_scheduled_events();
    flush_rewrite_rules();
}
