services refactor
This commit is contained in:
@@ -1,25 +1,17 @@
|
||||
import type {
|
||||
IRaceWithSOFPresenter,
|
||||
RaceWithSOFResultDTO,
|
||||
RaceWithSOFViewModel,
|
||||
} from '@core/racing/application/presenters/IRaceWithSOFPresenter';
|
||||
import type { RaceWithSOFDto } from '../dtos/RaceWithSOFDto';
|
||||
|
||||
export class RaceWithSOFPresenter implements IRaceWithSOFPresenter {
|
||||
present(dto: RaceWithSOFResultDTO): RaceWithSOFViewModel {
|
||||
export interface RaceWithSOFViewModel {
|
||||
id: string;
|
||||
track: string;
|
||||
strengthOfField: number | null;
|
||||
}
|
||||
|
||||
export class RaceWithSOFPresenter {
|
||||
present(dto: RaceWithSOFDto): RaceWithSOFViewModel {
|
||||
return {
|
||||
id: dto.raceId,
|
||||
leagueId: dto.leagueId,
|
||||
scheduledAt: dto.scheduledAt.toISOString(),
|
||||
id: dto.id,
|
||||
track: dto.track,
|
||||
trackId: dto.trackId,
|
||||
car: dto.car,
|
||||
carId: dto.carId,
|
||||
sessionType: dto.sessionType,
|
||||
status: dto.status,
|
||||
strengthOfField: dto.strengthOfField,
|
||||
registeredCount: dto.registeredCount,
|
||||
maxParticipants: dto.maxParticipants,
|
||||
participantCount: dto.participantCount,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user