<?php
require __DIR__.'/_bootstrap.php';
use Zoo\Database;
use Zoo\Auth\PlayerAuthService;
use Zoo\Deposit\DepositService;

try{
    $db=Database::connect();
    $player=(new PlayerAuthService($db))->authenticate([]);
    json_out(['ok'=>true,'deposits'=>(new DepositService($db))->history((int)$player['user_id'])]);
}catch(Throwable $e){
    json_out(['ok'=>false,'error'=>$e->getMessage()],422);
}
