<?php
require_once dirname(__DIR__) . '/bootstrap/chairman_production_core_bootstrap.php';

$raceDate = isset($_GET['race_date']) ? $_GET['race_date'] : date('Y-m-d');
$venue = isset($_GET['venue']) ? $_GET['venue'] : '';
$raceNum = isset($_GET['race_num']) ? intval($_GET['race_num']) : 0;
$mode = isset($_GET['mode']) ? strtoupper($_GET['mode']) : 'BALANCED';
$autoBuild = !isset($_GET['auto_build']) || $_GET['auto_build'] !== '0';

header('Content-Type: application/json; charset=utf-8');
echo json_encode($ChairmanProductionCore->payload($raceDate,$venue,$raceNum,$mode,$autoBuild), JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
