This commit is contained in:
2025-12-17 12:05:00 +01:00
parent 4d890863d3
commit 07dfefebe4
65 changed files with 6034 additions and 778 deletions

View File

@@ -4,15 +4,8 @@ import { Logger } from '@core/shared/application';
export class InMemoryLeagueStandingsRepository implements ILeagueStandingsRepository {
private standings: Map<string, RawStanding[]> = new Map(); // Key: leagueId
constructor(private readonly logger: Logger, initialStandings: Record<string, RawStanding[]> = {}) {
constructor(private readonly logger: Logger) {
this.logger.info('InMemoryLeagueStandingsRepository initialized.');
for (const leagueId in initialStandings) {
// Ensure initialStandings[leagueId] is not undefined before setting
if (initialStandings[leagueId] !== undefined) {
this.standings.set(leagueId, initialStandings[leagueId]);
this.logger.debug(`Seeded standings for league: ${leagueId}.`);
}
}
}
async getLeagueStandings(leagueId: string): Promise<RawStanding[]> {