34 lines
914 B
TypeScript
34 lines
914 B
TypeScript
import { TurnHistoryAggregate, TurnActionType, TurnActionData } from '../Game/TurnHistoryAggregate';
|
|
|
|
export interface ITurnHistoryRepository {
|
|
/**
|
|
* Save a turn history entry
|
|
*/
|
|
save(turnHistory: TurnHistoryAggregate): Promise<TurnHistoryAggregate>;
|
|
|
|
/**
|
|
* Get all turn history for a game
|
|
*/
|
|
findByGameId(gameId: string): Promise<TurnHistoryAggregate[]>;
|
|
|
|
/**
|
|
* Get turn history for a specific player in a game
|
|
*/
|
|
findByGameAndPlayer(gameId: string, playerId: string): Promise<TurnHistoryAggregate[]>;
|
|
|
|
/**
|
|
* Get the last N turns for a game
|
|
*/
|
|
findLastNTurns(gameId: string, limit: number): Promise<TurnHistoryAggregate[]>;
|
|
|
|
/**
|
|
* Get turn count for a game
|
|
*/
|
|
countTurnsByGame(gameId: string): Promise<number>;
|
|
|
|
/**
|
|
* Delete all turn history for a game
|
|
*/
|
|
deleteByGameId(gameId: string): Promise<void>;
|
|
}
|