website refactor

This commit is contained in:
2026-01-21 00:53:29 +01:00
parent 4516427a19
commit 5f3712e5ab
10 changed files with 85 additions and 201 deletions

View File

@@ -7,6 +7,7 @@
import type { StandingRepository } from '../../domain/repositories/StandingRepository';
import type { DriverRepository } from '../../domain/repositories/DriverRepository';
import type { DriverStatsRepository } from '../../domain/repositories/DriverStatsRepository';
import type { Logger } from '@core/shared/domain/Logger';
export interface DriverRanking {
@@ -21,11 +22,25 @@ export class RankingUseCase {
constructor(
_standingRepository: StandingRepository,
_driverRepository: DriverRepository,
private readonly _driverStatsRepository: DriverStatsRepository,
private readonly _logger: Logger,
) {}
async getAllDriverRankings(): Promise<DriverRanking[]> {
this._logger.debug('Getting all driver rankings');
return [];
const allStats = await this._driverStatsRepository.getAllStats();
const rankings: DriverRanking[] = [];
allStats.forEach((stats, driverId) => {
rankings.push({
driverId,
rating: stats.rating,
wins: stats.wins,
totalRaces: stats.totalRaces,
overallRank: stats.overallRank,
});
});
return rankings;
}
}