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

@@ -2216,41 +2216,6 @@
"incidents"
]
},
"DashboardStatsResponseDTO": {
"type": "object",
"properties": {
"totalUsers": {
"type": "number"
},
"activeUsers": {
"type": "number"
},
"suspendedUsers": {
"type": "number"
},
"deletedUsers": {
"type": "number"
},
"systemAdmins": {
"type": "number"
},
"recentLogins": {
"type": "number"
},
"newUsersToday": {
"type": "number"
}
},
"required": [
"totalUsers",
"activeUsers",
"suspendedUsers",
"deletedUsers",
"systemAdmins",
"recentLogins",
"newUsersToday"
]
},
"DeleteMediaOutputDTO": {
"type": "object",
"properties": {
@@ -3541,6 +3506,102 @@
"transactions"
]
},
"HomeDataDTO": {
"type": "object",
"properties": {
"isAlpha": {
"type": "boolean"
},
"upcomingRaces": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HomeUpcomingRaceDTO"
}
},
"topLeagues": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HomeTopLeagueDTO"
}
},
"teams": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HomeTeamDTO"
}
}
},
"required": [
"isAlpha",
"upcomingRaces",
"topLeagues",
"teams"
]
},
"HomeTeamDTO": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"logoUrl": {
"type": "string"
}
},
"required": [
"id",
"name",
"description"
]
},
"HomeTopLeagueDTO": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"id",
"name",
"description"
]
},
"HomeUpcomingRaceDTO": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"track": {
"type": "string"
},
"car": {
"type": "string"
},
"formattedDate": {
"type": "string"
}
},
"required": [
"id",
"track",
"car",
"formattedDate"
]
},
"ImportRaceResultsDTO": {
"type": "object",
"properties": {

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[];
}