final POC

This commit is contained in:
magdo
2025-11-24 23:28:57 +01:00
parent ce02f55a99
commit 6b3446e9b6
49 changed files with 4634 additions and 4620 deletions
@@ -0,0 +1,38 @@
import { GameSnapshotAggregate, SnapshotTrigger } from '../Game/GameSnapshotAggregate';
export interface IGameSnapshotRepository {
/**
* Save a game state snapshot
*/
save(snapshot: GameSnapshotAggregate): Promise<GameSnapshotAggregate>;
/**
* Get the most recent snapshot for a game
*/
findLatestByGameId(gameId: string): Promise<GameSnapshotAggregate | null>;
/**
* Get all snapshots for a game
*/
findByGameId(gameId: string): Promise<GameSnapshotAggregate[]>;
/**
* Get snapshots by trigger type
*/
findByGameAndTrigger(gameId: string, trigger: SnapshotTrigger): Promise<GameSnapshotAggregate[]>;
/**
* Get snapshot at specific turn
*/
findByGameAndTurn(gameId: string, turnNumber: number): Promise<GameSnapshotAggregate | null>;
/**
* Delete old snapshots (keep only last N)
*/
deleteOldSnapshots(gameId: string, keepCount: number): Promise<void>;
/**
* Delete all snapshots for a game
*/
deleteByGameId(gameId: string): Promise<void>;
}