32 lines
1.9 KiB
TypeScript
32 lines
1.9 KiB
TypeScript
import { GameAggregate } from '../Game/GameAggregate';
|
|
<<<<<<< HEAD
|
|
import { IPaginatedRepository } from './IBaseRepository';
|
|
|
|
export interface IGameRepository extends IPaginatedRepository<GameAggregate, { games: GameAggregate[], totalCount: number }> {
|
|
// Game-specific methods
|
|
findByGameCode(gamecode: string): Promise<GameAggregate | null>;
|
|
=======
|
|
|
|
export interface IGameRepository {
|
|
create(game: Partial<GameAggregate>): Promise<GameAggregate>;
|
|
findByPage(from: number, to: number): Promise<{ games: GameAggregate[], totalCount: number }>;
|
|
findByPageIncludingDeleted(from: number, to: number): Promise<{ games: GameAggregate[], totalCount: number }>;
|
|
findById(id: string): Promise<GameAggregate | null>;
|
|
findByIdIncludingDeleted(id: string): Promise<GameAggregate | null>;
|
|
findByGameCode(gamecode: string): Promise<GameAggregate | null>;
|
|
search(query: string, limit?: number, offset?: number): Promise<{ games: GameAggregate[], totalCount: number }>;
|
|
searchIncludingDeleted(query: string, limit?: number, offset?: number): Promise<{ games: GameAggregate[], totalCount: number }>;
|
|
update(id: string, update: Partial<GameAggregate>): Promise<GameAggregate | null>;
|
|
delete(id: string): Promise<any>;
|
|
softDelete(id: string): Promise<GameAggregate | null>;
|
|
|
|
// Game-specific methods
|
|
>>>>>>> 83fad59878db015ec8d86bdec1ecbbca0baddfd2
|
|
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, started: boolean, finished?: boolean, winner?: string): Promise<GameAggregate | null>;
|
|
} |