refactor core presenters
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user