feat: add reserved turns management for generals and nations; enhance command selection UI

This commit is contained in:
2026-01-17 02:27:50 +00:00
parent 0fed50b5a9
commit f13f8bc1cf
8 changed files with 552 additions and 15 deletions
+14
View File
@@ -108,6 +108,11 @@ export const loadGeneralTurns = async (db: DatabaseClient, generalId: number): P
return buildTurnListFromRows(rows, MAX_GENERAL_TURNS);
};
export const listGeneralTurns = async (db: DatabaseClient, generalId: number): Promise<ReservedTurnView[]> => {
const turns = await loadGeneralTurns(db, generalId);
return serializeTurnList(turns);
};
export const loadNationTurns = async (
db: DatabaseClient,
nationId: number,
@@ -120,6 +125,15 @@ export const loadNationTurns = async (
return buildTurnListFromRows(rows, MAX_NATION_TURNS);
};
export const listNationTurns = async (
db: DatabaseClient,
nationId: number,
officerLevel: number
): Promise<ReservedTurnView[]> => {
const turns = await loadNationTurns(db, nationId, officerLevel);
return serializeTurnList(turns);
};
export const setGeneralTurn = async (
db: DatabaseClient,
generalId: number,