refactor
This commit is contained in:
@@ -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[]> {
|
||||
|
||||
Reference in New Issue
Block a user