<?php
/**
 * Cron یادآوری PM — اجرای دستی یا Task Scheduler
 * C:\xampp\php\php.exe C:\xampp\htdocs\acc-engine\run-svc-pm-cron.php
 */
declare(strict_types=1);

define( 'ACC_BASE_PATH', __DIR__ );
define( 'ACC_PATH', __DIR__ . '/' );
define( 'ABSPATH', __DIR__ . '/' );

require_once __DIR__ . '/standalone/bootstrap.php';
require_once ACC_PATH . 'includes/controllers/SR_Controller.php';

$result = SR_Controller::cron_pm_reminders();

if ( php_sapi_name() === 'cli' ) {
    echo "PM reminders: checked={$result['checked']}, created={$result['created']}\n";
} else {
    header( 'Content-Type: application/json; charset=utf-8' );
    echo json_encode( [ 'success' => true, 'data' => $result ], JSON_UNESCAPED_UNICODE );
}
