refactor core presenters

This commit is contained in:
2025-12-19 19:42:19 +01:00
parent 8116fe888f
commit 94fc538f44
228 changed files with 2817 additions and 3097 deletions

View File

@@ -1,10 +1,45 @@
import { ApiProperty } from '@nestjs/swagger';
import { RaceViewModel } from '@core/racing/application/presenters/IGetAllRacesPresenter';
export class AllRacesPageDTO {
@ApiProperty({ type: [RaceViewModel] })
races!: RaceViewModel[];
export type AllRacesStatus = 'scheduled' | 'running' | 'completed' | 'cancelled' | 'all';
export class AllRacesListItemDTO {
@ApiProperty()
id!: string;
@ApiProperty()
totalCount!: number;
track!: string;
@ApiProperty()
car!: string;
@ApiProperty()
scheduledAt!: string;
@ApiProperty()
status!: 'scheduled' | 'running' | 'completed' | 'cancelled';
@ApiProperty()
leagueId!: string;
@ApiProperty()
leagueName!: string;
@ApiProperty({ nullable: true })
strengthOfField!: number | null;
}
export class AllRacesFilterOptionsDTO {
@ApiProperty({ type: [{ value: String, label: String }] })
statuses!: { value: AllRacesStatus; label: string }[];
@ApiProperty({ type: [{ id: String, name: String }] })
leagues!: { id: string; name: string }[];
}
export class AllRacesPageDTO {
@ApiProperty({ type: [AllRacesListItemDTO] })
races!: AllRacesListItemDTO[];
@ApiProperty({ type: AllRacesFilterOptionsDTO })
filters!: AllRacesFilterOptionsDTO;
}