This commit is contained in:
2025-12-21 17:05:36 +01:00
parent 08b0d59e45
commit f2d8a23583
66 changed files with 1131 additions and 1342 deletions

View File

@@ -52,7 +52,7 @@ export class GetDriversLeaderboardUseCase {
async execute(
_input: GetDriversLeaderboardInput,
): Promise<Result<void, ApplicationErrorCode<GetDriversLeaderboardErrorCode, { message: string }>>> {
): Promise<Result<GetDriversLeaderboardResult, ApplicationErrorCode<GetDriversLeaderboardErrorCode, { message: string }>>> {
this.logger.debug('Executing GetDriversLeaderboardUseCase');
try {
const drivers = await this.driverRepository.findAll();
@@ -90,14 +90,12 @@ export class GetDriversLeaderboardUseCase {
this.logger.debug('Successfully retrieved drivers leaderboard.');
this.output.present({
return Result.ok({
items: items.sort((a, b) => b.rating - a.rating),
totalRaces,
totalWins,
activeCount,
});
return Result.ok(undefined);
} catch (error) {
this.logger.error(
'Error executing GetDriversLeaderboardUseCase',