<?php
require __DIR__.'/_bootstrap.php';
use Zoo\Database;
use Zoo\Auth\PlayerAuthService;
use Zoo\Referral\ReferralService;
try{
    $db=Database::connect();
    $p=(new PlayerAuthService($db))->authenticate([]);
    json_out(['ok'=>true,'summary'=>(new ReferralService($db))->summary((int)$p['user_id'])]);
}catch(Throwable $e){json_out(['ok'=>false,'error'=>$e->getMessage()],422);}
