Bind league fixtures and round navigation to live engine data (by Codex)

This commit is contained in:
Codex committed 2026-10-28 22:23:59 +01:00
1 parent 1c35698dbe
commit 545e16f153
21 files changed
+207 -31

No files matched your search

+7
View File
@@ -372,6 +372,13 @@ int main() {
bad_report=report_read;bad_report["data"]["table"][1]["rank"]=1;rejects([&]{engine_report_projection(report_bundle,report_index_read,bad_report,"league:live",0);});
bad_report=report_read;bad_report["data"]["filter"]=3;rejects([&]{engine_report_projection(report_bundle,report_index_read,bad_report,"league:live",0);});
auto bad_index=report_index_read;bad_index["data"]["leagues"][0]["members"][1]="club:6";rejects([&]{engine_report_index(report_bundle,bad_index);});
const Json fixture_read_data={{"kind","league-fixtures"},{"leagueId","league:live"},{"league",{{"id","league:live"},{"name","Live League"}}},{"round",1},{"rounds",2},{"matches",{{{"id","fixture:one"},{"home",{{"id","club:6"},{"name","Live A"}}},{"away",{{"id","club:7"},{"name","Live B"}}},{"status","open"},{"result",nullptr}}}}};
const auto fixture_read=report_wrap("league-fixtures",fixture_read_data);const auto fixture_value=engine_fixtures_projection(report_bundle,report_index_read,fixture_read,"league:live",1);
require(fixture_value.at("matches")[0].at("home_goals").is_null()&&fixture_value.at("matches")[0].at("home")=="club:6","fixture adapter invented an open result");
auto bad_fixture=fixture_read;bad_fixture["data"]["matches"][0]["result"]={12,14};rejects([&]{engine_fixtures_projection(report_bundle,report_index_read,bad_fixture,"league:live",1);});
bad_fixture=fixture_read;bad_fixture["data"]["round"]=2;rejects([&]{engine_fixtures_projection(report_bundle,report_index_read,bad_fixture,"league:live",1);});
bad_fixture=fixture_read;bad_fixture["data"]["matches"][0]["away"]["id"]="club:6";rejects([&]{engine_fixtures_projection(report_bundle,report_index_read,bad_fixture,"league:live",1);});
bad_fixture=fixture_read;bad_fixture["meta"]["stateRevision"]="42";rejects([&]{engine_fixtures_projection(report_bundle,report_index_read,bad_fixture,"league:live",1);});
std::cout << "engine DTO, exact money, scope and booking tests passed\n";
return 0;
} catch (const std::exception &e) { std::cerr << e.what() << '\n'; return 1; }