<?php
require_once __DIR__.'/../../config.php';
require_once __DIR__ . '/../../engine/Kernel.php';
require_once __DIR__.'/../../engine/Logger.php';
require_once __DIR__.'/../../engine/MerchantEngine.php';
$ctx = Kernel::handle(['auth' => true]);
$u   = $ctx['user'];
$dash = MerchantEngine::getDashboard((int)$u['id']);
echo json_encode(['ok'=>true,'data'=>$dash], JSON_UNESCAPED_UNICODE);
