website refactor

This commit is contained in:
2026-01-14 16:28:39 +01:00
parent 85e09b6f4d
commit 4b7d82ab43
119 changed files with 2403 additions and 1615 deletions

View File

@@ -0,0 +1,25 @@
import type { DriversLeaderboardDTO } from '@/lib/types/generated/DriversLeaderboardDTO';
import type { DriversViewData } from '@/lib/types/view-data/DriversViewData';
export class DriversViewDataBuilder {
static build(dto: DriversLeaderboardDTO): DriversViewData {
return {
drivers: dto.drivers.map(driver => ({
id: driver.id,
name: driver.name,
country: driver.country,
avatarUrl: driver.avatarUrl || '',
iracingId: driver.iracingId || null,
rating: driver.rating || null,
globalRank: driver.globalRank || null,
consistency: driver.consistency || null,
totalRaces: driver.racesCompleted,
wins: driver.wins,
isActive: driver.isActive,
})),
totalRaces: dto.totalRaces,
totalWins: dto.totalWins,
activeCount: dto.activeCount,
};
}
}