view data fixes

This commit is contained in:
2026-01-24 00:52:27 +01:00
parent 62e8b768ce
commit ae59df61eb
321 changed files with 1157 additions and 2234 deletions

View File

@@ -2216,6 +2216,41 @@
"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": {
@@ -4235,6 +4270,9 @@
"LeagueScheduleDTO": {
"type": "object",
"properties": {
"leagueId": {
"type": "string"
},
"seasonId": {
"type": "string"
},
@@ -4473,6 +4511,16 @@
},
"isParallelActive": {
"type": "boolean"
},
"totalRaces": {
"type": "number"
},
"completedRaces": {
"type": "number"
},
"nextRaceAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
@@ -4480,7 +4528,9 @@
"name",
"status",
"isPrimary",
"isParallelActive"
"isParallelActive",
"totalRaces",
"completedRaces"
]
},
"LeagueSettingsDTO": {
@@ -4515,6 +4565,18 @@
},
"races": {
"type": "number"
},
"positionChange": {
"type": "number"
},
"lastRacePoints": {
"type": "number"
},
"droppedRaceIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
@@ -4524,7 +4586,10 @@
"position",
"wins",
"podiums",
"races"
"races",
"positionChange",
"lastRacePoints",
"droppedRaceIds"
]
},
"LeagueStandingsDTO": {
@@ -4658,6 +4723,15 @@
"logoUrl": {
"type": "string",
"nullable": true
},
"pendingJoinRequestsCount": {
"type": "number"
},
"pendingProtestsCount": {
"type": "number"
},
"walletBalance": {
"type": "number"
}
},
"required": [
@@ -5449,8 +5523,34 @@
"type": "string"
},
"leagueName": {
"type": "string",
"nullable": true
"type": "string"
},
"track": {
"type": "string"
},
"car": {
"type": "string"
},
"sessionType": {
"type": "string"
},
"leagueId": {
"type": "string"
},
"strengthOfField": {
"type": "number"
},
"isUpcoming": {
"type": "boolean"
},
"isLive": {
"type": "boolean"
},
"isPast": {
"type": "boolean"
},
"status": {
"type": "string"
}
},
"required": [

View File

@@ -1,80 +0,0 @@
import { ApiProperty } from '@nestjs/swagger';
class UserGrowthDto {
@ApiProperty({ description: 'Label for the time period' })
label!: string;
@ApiProperty({ description: 'Number of new users' })
value!: number;
@ApiProperty({ description: 'Color class for the bar' })
color!: string;
}
class RoleDistributionDto {
@ApiProperty({ description: 'Role name' })
label!: string;
@ApiProperty({ description: 'Number of users with this role' })
value!: number;
@ApiProperty({ description: 'Color class for the bar' })
color!: string;
}
class StatusDistributionDto {
@ApiProperty({ description: 'Number of active users' })
active!: number;
@ApiProperty({ description: 'Number of suspended users' })
suspended!: number;
@ApiProperty({ description: 'Number of deleted users' })
deleted!: number;
}
class ActivityTimelineDto {
@ApiProperty({ description: 'Date label' })
date!: string;
@ApiProperty({ description: 'Number of new users' })
newUsers!: number;
@ApiProperty({ description: 'Number of logins' })
logins!: number;
}
export class DashboardStatsResponseDto {
@ApiProperty({ description: 'Total number of users' })
totalUsers!: number;
@ApiProperty({ description: 'Number of active users' })
activeUsers!: number;
@ApiProperty({ description: 'Number of suspended users' })
suspendedUsers!: number;
@ApiProperty({ description: 'Number of deleted users' })
deletedUsers!: number;
@ApiProperty({ description: 'Number of system admins' })
systemAdmins!: number;
@ApiProperty({ description: 'Number of recent logins (last 24h)' })
recentLogins!: number;
@ApiProperty({ description: 'Number of new users today' })
newUsersToday!: number;
@ApiProperty({ type: [UserGrowthDto], description: 'User growth over last 7 days' })
userGrowth!: UserGrowthDto[];
@ApiProperty({ type: [RoleDistributionDto], description: 'Distribution of user roles' })
roleDistribution!: RoleDistributionDto[];
@ApiProperty({ type: StatusDistributionDto, description: 'Distribution of user statuses' })
statusDistribution!: StatusDistributionDto;
@ApiProperty({ type: [ActivityTimelineDto], description: 'Activity timeline for last 7 days' })
activityTimeline!: ActivityTimelineDto[];
}

View File

@@ -0,0 +1,24 @@
export interface HealthDTO {
status: 'ok' | 'degraded' | 'error' | 'unknown';
timestamp: string;
uptime?: number;
responseTime?: number;
errorRate?: number;
lastCheck?: string;
checksPassed?: number;
checksFailed?: number;
components?: Array<{
name: string;
status: 'ok' | 'degraded' | 'error' | 'unknown';
lastCheck?: string;
responseTime?: number;
errorRate?: number;
}>;
alerts?: Array<{
id: string;
type: 'critical' | 'warning' | 'info';
title: string;
message: string;
timestamp: string;
}>;
}

View File

@@ -1,9 +1,13 @@
import { ApiProperty } from '@nestjs/swagger';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
import { RaceDTO } from '../../race/dtos/RaceDTO';
export class LeagueScheduleDTO {
@ApiPropertyOptional()
@IsString()
leagueId?: string;
@ApiProperty()
@IsString()
seasonId!: string;

View File

@@ -1,4 +1,4 @@
import { ApiProperty } from '@nestjs/swagger';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
export class RaceDTO {
@ApiProperty()
@@ -10,6 +10,33 @@ export class RaceDTO {
@ApiProperty()
date!: string;
@ApiProperty({ nullable: true })
@ApiPropertyOptional({ nullable: true })
leagueName?: string;
@ApiPropertyOptional()
track?: string;
@ApiPropertyOptional()
car?: string;
@ApiPropertyOptional()
sessionType?: string;
@ApiPropertyOptional()
leagueId?: string;
@ApiPropertyOptional()
strengthOfField?: number;
@ApiPropertyOptional()
isUpcoming?: boolean;
@ApiPropertyOptional()
isLive?: boolean;
@ApiPropertyOptional()
isPast?: boolean;
@ApiPropertyOptional()
status?: string;
}