Modern UI contract: camps read and the first command, camp.book

ModernSession::ui_command checks careerId, expectedRevision and owner, runs
the engine action and answers command_result or error. A refused command
restores the state and both generators; a repeated requestId gets the stored
answer, a different command under the same id duplicate_request. The camps
read lists maps and camps with a binding, draw-free quote per camp, focus and
the season's stays. Tests cover stale revision, foreign owner, unknown camp,
booking, repeat, conflict and a refused second booking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-27 08:25:54 +01:00
1 parent fec4c6c7e7
commit 99a48a463d
7 files changed
+252 -2

No files matched your search

+1 -1
View File
@@ -743,7 +743,7 @@ int main(int argc, char** argv) {
read({{"kind", "squad"}});
read({{"kind", "table"}, {"league", 42}});
// the interface contract (docs/new_engine/ui-anbindung.md)
for (const char* kind : {"session", "desktop", "squad", "nonsense"}) {
for (const char* kind : {"session", "desktop", "squad", "camps", "nonsense"}) {
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());
}