Bind cup reports and linked competition phases to live engine data (by Codex)

This commit is contained in:
Codex committed 2026-10-28 23:03:36 +01:00
1 parent 545e16f153
commit 6b4aa9772d
26 files changed
+402 -33

No files matched your search

+8
View File
@@ -379,6 +379,14 @@ int main() {
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);});
const auto other_index=report_wrap("other-index",{{"kind","other-index"},{"views",{{{"id","cup-view:0:0"},{"name","Synthetic Cup"},{"entry",0},{"rounds",2},{"currentRound",1},{"knockout",true},{"twoLegs",false}}}},{"defaultViewId","cup-view:0:0"}});
auto other_data=fixture_read_data;other_data["kind"]="other-fixtures";other_data["viewId"]="cup-view:0:0";other_data["entry"]=0;other_data["available"]=true;other_data["heading"]="Round 1";
auto &om=other_data["matches"][0];om["homeHasSquad"]=true;om["awayHasSquad"]=false;om["secondLegVisible"]=false;om["secondLeg"]=nullptr;om["phase"]=nullptr;om["secondLegPhase"]=nullptr;om["date"]=nullptr;
const auto other_read=report_wrap("other-fixtures",other_data);require(engine_other_projection(report_bundle,other_index,other_read,"cup-view:0:0",1).at("matches")[0].at("home_goals").is_null(),"open cup got a score");
auto bad_other=other_read;bad_other["data"]["available"]=false;rejects([&]{engine_other_projection(report_bundle,other_index,bad_other,"cup-view:0:0",1);});
bad_other=other_read;bad_other["data"]["matches"][0]["result"]={1,2};rejects([&]{engine_other_projection(report_bundle,other_index,bad_other,"cup-view:0:0",1);});
bad_other=other_read;bad_other["data"]["entry"]=1;rejects([&]{engine_other_projection(report_bundle,other_index,bad_other,"cup-view:0:0",1);});
bad_other=other_read;bad_other["meta"]["stateRevision"]="42";rejects([&]{engine_other_projection(report_bundle,other_index,bad_other,"cup-view:0:0",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; }