Modern UI: the statistics screen reads the almanac

ModernSession::read_statistics_screen answers the statistics screen's filters
with real data: eternal table, national tournaments (winners, scorers,
history), series and records, winners by season and the own club per five
minutes. Views the engine does not record yet (title chances, transfers,
weekly curves, season finances) answer available false, reason not_recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-27 09:00:22 +01:00
1 parent e82ce1649f
commit 015fa65f56
6 files changed
+378 -1

No files matched your search

+8
View File
@@ -747,6 +747,14 @@ int main(int argc, char** argv) {
const auto request = cli::Json::Object{{"kind", kind}, {"requestId", std::string("request:sim-") + kind}};
std::printf("ui_read %s\n -> %s\n", kind, cli::dump_json(session.ui_read(request, revision)).c_str());
}
for (const auto& filter : {cli::Json::Object{{"section", 3}}, cli::Json::Object{{"section", 4}, {"country", 0}},
cli::Json::Object{{"section", 4}, {"country", 2}}, cli::Json::Object{{"section", 6}},
cli::Json::Object{{"section", 7}}, cli::Json::Object{{"section", 7}, {"category", 1}},
cli::Json::Object{{"section", 8}}, cli::Json::Object{{"section", 1}}}) {
std::string answer = cli::dump_json(session.read_statistics_screen(filter));
if (answer.size() > 1500) answer = answer.substr(0, 1500) + " ...";
std::printf("statistics screen %s\n -> %s\n", cli::dump_json(filter).c_str(), answer.c_str());
}
std::printf("ui_read wrong manager\n -> %s\n",
cli::dump_json(session.ui_read(cli::Json::Object{{"kind", "desktop"}, {"managerId", "manager:99"}}, revision)).c_str());
}
+8
View File
@@ -269,6 +269,14 @@ int main(int argc, char** argv) {
}
check(s(at(session.read_almanac(O{{"kind", "match"}, {"id", "match:0-0"}}), "error")) == "almanac_match_not_found",
"unknown match");
// the statistics screen: real data (fictional false), unrecorded views say so
const J minutes = session.read_statistics_screen(O{{"section", 8}});
check(truth(at(minutes, "ok")) && !truth(at(minutes, "fictional")) && at(minutes, "rows").array() &&
at(minutes, "rows").array()->size() == 4, "minute statistics");
const J transfers = session.read_statistics_screen(O{{"section", 1}});
check(truth(at(transfers, "ok")) && !truth(at(transfers, "available")) && s(at(transfers, "reason")) == "not_recorded",
"transfer history not recorded");
check(s(at(session.read_statistics_screen(O{{"section", 9}}), "error")) == "invalid_statistics_filter", "bad section");
}
} catch (const std::exception& ex) {
std::fprintf(stderr, "FAIL: %s\n", ex.what());