14 lines
905 B
TypeScript
14 lines
905 B
TypeScript
import { GameAggregate, GameState } from '../Game/GameAggregate';
|
|
import { IPaginatedRepository } from './IBaseRepository';
|
|
|
|
export interface IGameRepository extends IPaginatedRepository<GameAggregate, { games: GameAggregate[], totalCount: number }> {
|
|
// Game-specific methods
|
|
findByGameCode(gamecode: string): Promise<GameAggregate | null>;
|
|
findActiveGames(): Promise<GameAggregate[]>;
|
|
findGamesByPlayer(playerId: string): Promise<GameAggregate[]>;
|
|
findWaitingGames(): Promise<GameAggregate[]>;
|
|
findFinishedGames(from?: number, to?: number): Promise<{ games: GameAggregate[], totalCount: number }>;
|
|
addPlayerToGame(gameId: string, playerId: string): Promise<GameAggregate | null>;
|
|
removePlayerFromGame(gameId: string, playerId: string): Promise<GameAggregate | null>;
|
|
updateGameState(gameId: string, state: GameState, winner?: string): Promise<GameAggregate | null>;
|
|
} |