18 lines
815 B
TypeScript
18 lines
815 B
TypeScript
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 => {
|
|
const presenter = new LeagueStandingsPresenter();
|
|
return presenter.present(dto, currentUserId, previousStandings);
|
|
}; |