<?php
/**
 * مهاجرت سطوح قدیمی تکنسین (bronze/silver/...) به junior/expert/...
 * php run-service-tier-migrate.php
 */
declare(strict_types=1);

if ( ! defined( 'ACC_BASE_PATH' ) ) {
    define( 'ACC_BASE_PATH', __DIR__ );
    require __DIR__ . '/standalone/bootstrap.php';
}

require_once ACC_PATH . 'includes/helpers/svc-rewards.php';

header( 'Content-Type: application/json; charset=utf-8' );

$updated = Svc_Rewards::migrate_legacy_tiers();

echo json_encode( [
    'success' => true,
    'updated_accounts' => $updated,
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT );
