Files
gridpilot.gg/apps/api/src/domain/race/dtos/AllRacesPageDTO.ts
2025-12-19 19:42:19 +01:00

45 lines
1020 B
TypeScript

import { ApiProperty } from '@nestjs/swagger';
export type AllRacesStatus = 'scheduled' | 'running' | 'completed' | 'cancelled' | 'all';
export class AllRacesListItemDTO {
@ApiProperty()
id!: string;
@ApiProperty()
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;
}