This commit is contained in:
2025-12-17 14:04:11 +01:00
parent 1ea9c9649f
commit daa4bb6576
238 changed files with 4263 additions and 1752 deletions

View File

@@ -0,0 +1,32 @@
import { ITeamsLeaderboardPresenter, TeamsLeaderboardResultDTO, TeamsLeaderboardViewModel } from '@core/racing/application/presenters/ITeamsLeaderboardPresenter';
export class TeamsLeaderboardPresenter implements ITeamsLeaderboardPresenter {
private result: TeamsLeaderboardViewModel | null = null;
reset() {
this.result = null;
}
present(dto: TeamsLeaderboardResultDTO) {
this.result = {
teams: dto.teams as any, // Cast to match the view model
recruitingCount: dto.recruitingCount,
groupsBySkillLevel: {
beginner: [],
intermediate: [],
advanced: [],
pro: [],
},
topTeams: dto.teams.slice(0, 10) as any,
};
}
getViewModel(): TeamsLeaderboardViewModel | null {
return this.result;
}
get viewModel(): TeamsLeaderboardViewModel {
if (!this.result) throw new Error('Presenter not presented');
return this.result;
}
}