services refactor

This commit is contained in:
2025-12-17 22:17:02 +01:00
parent 26f7a2b6aa
commit 055a7f67b5
93 changed files with 7434 additions and 659 deletions

View File

@@ -1,6 +1,18 @@
import { LeagueStandingsDto, StandingEntryDto } from '../dtos';
import type { LeagueStandingsDto, StandingEntryDto } from '../dtos';
import { LeagueStandingsViewModel } from '../view-models';
/**
* League Standings Presenter
* Transforms LeagueStandingsDto to LeagueStandingsViewModel
*/
export class LeagueStandingsPresenter {
present(dto: LeagueStandingsDto, currentUserId: string, previousStandings?: StandingEntryDto[]): LeagueStandingsViewModel {
return new LeagueStandingsViewModel(dto, currentUserId, previousStandings);
}
}
// Legacy functional export for backward compatibility
export const presentLeagueStandings = (dto: LeagueStandingsDto, currentUserId: string, previousStandings?: StandingEntryDto[]): LeagueStandingsViewModel => {
return new LeagueStandingsViewModel(dto, currentUserId, previousStandings);
const presenter = new LeagueStandingsPresenter();
return presenter.present(dto, currentUserId, previousStandings);
};