view data fixes
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 5m50s
Contract Testing / contract-snapshot (pull_request) Has been skipped

This commit is contained in:
2026-01-25 00:25:27 +01:00
parent 6c07abe5e7
commit e8a7261ec2
259 changed files with 468 additions and 373 deletions

View File

@@ -0,0 +1,66 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsBoolean, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
export class HomeUpcomingRaceDTO {
@ApiProperty()
id!: string;
@ApiProperty()
track!: string;
@ApiProperty()
car!: string;
@ApiProperty()
formattedDate!: string;
}
export class HomeTopLeagueDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
description!: string;
}
export class HomeTeamDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
description!: string;
@ApiProperty({ required: false })
logoUrl?: string;
}
export class HomeDataDTO {
@ApiProperty()
@IsBoolean()
isAlpha!: boolean;
@ApiProperty({ type: [HomeUpcomingRaceDTO] })
@IsArray()
@ValidateNested({ each: true })
@Type(() => HomeUpcomingRaceDTO)
upcomingRaces!: HomeUpcomingRaceDTO[];
@ApiProperty({ type: [HomeTopLeagueDTO] })
@IsArray()
@ValidateNested({ each: true })
@Type(() => HomeTopLeagueDTO)
topLeagues!: HomeTopLeagueDTO[];
@ApiProperty({ type: [HomeTeamDTO] })
@IsArray()
@ValidateNested({ each: true })
@Type(() => HomeTeamDTO)
teams!: HomeTeamDTO[];
}