view data fixes
This commit is contained in:
@@ -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": {
|
||||
|
||||
66
apps/api/src/domain/home/dtos/HomeDataDTO.ts
Normal file
66
apps/api/src/domain/home/dtos/HomeDataDTO.ts
Normal 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[];
|
||||
}
|
||||
Reference in New Issue
Block a user