refactor driver module (wip)

This commit is contained in:
2025-12-22 01:43:34 +01:00
parent b445d6dd37
commit e7dbec4a85
31 changed files with 379 additions and 395 deletions

View File

@@ -5,22 +5,22 @@ export class CompleteOnboardingInputDTO {
@ApiProperty()
@IsString()
@IsNotEmpty()
firstName: string;
firstName!: string;
@ApiProperty()
@IsString()
@IsNotEmpty()
lastName: string;
lastName!: string;
@ApiProperty()
@IsString()
@IsNotEmpty()
displayName: string;
displayName!: string;
@ApiProperty()
@IsString()
@IsNotEmpty()
country: string;
country!: string;
@ApiProperty({ required: false })
@IsOptional()

View File

@@ -4,7 +4,7 @@ import { IsBoolean, IsString } from 'class-validator';
export class CompleteOnboardingOutputDTO {
@ApiProperty()
@IsBoolean()
success: boolean;
success!: boolean;
@ApiProperty({ required: false })
@IsString()

View File

@@ -2,20 +2,20 @@ import { ApiProperty } from '@nestjs/swagger';
export class DriverDTO {
@ApiProperty()
id: string;
id!: string;
@ApiProperty()
iracingId: string;
iracingId!: string;
@ApiProperty()
name: string;
name!: string;
@ApiProperty()
country: string;
country!: string;
@ApiProperty({ required: false })
bio?: string;
@ApiProperty()
joinedAt: string;
joinedAt!: string;
}

View File

@@ -2,34 +2,34 @@ import { ApiProperty } from '@nestjs/swagger';
export class DriverLeaderboardItemDTO {
@ApiProperty()
id: string;
id!: string;
@ApiProperty()
name: string;
name!: string;
@ApiProperty()
rating: number;
rating!: number;
@ApiProperty()
skillLevel: string; // Assuming skillLevel is a string like 'Rookie', 'Pro', etc.
skillLevel!: string; // Assuming skillLevel is a string like 'Rookie', 'Pro', etc.
@ApiProperty()
nationality: string;
nationality!: string;
@ApiProperty()
racesCompleted: number;
racesCompleted!: number;
@ApiProperty()
wins: number;
wins!: number;
@ApiProperty()
podiums: number;
podiums!: number;
@ApiProperty()
isActive: boolean;
isActive!: boolean;
@ApiProperty()
rank: number;
rank!: number;
@ApiProperty({ nullable: true })
avatarUrl?: string;

View File

@@ -2,5 +2,5 @@ import { ApiProperty } from '@nestjs/swagger';
export class DriverStatsDTO {
@ApiProperty()
totalDrivers: number;
totalDrivers!: number;
}

View File

@@ -3,14 +3,14 @@ import { DriverLeaderboardItemDTO } from './DriverLeaderboardItemDTO';
export class DriversLeaderboardDTO {
@ApiProperty({ type: [DriverLeaderboardItemDTO] })
drivers: DriverLeaderboardItemDTO[];
drivers!: DriverLeaderboardItemDTO[];
@ApiProperty()
totalRaces: number;
totalRaces!: number;
@ApiProperty()
totalWins: number;
totalWins!: number;
@ApiProperty()
activeCount: number;
activeCount!: number;
}

View File

@@ -2,20 +2,20 @@ import { ApiProperty } from '@nestjs/swagger';
export class GetDriverOutputDTO {
@ApiProperty()
id: string;
id!: string;
@ApiProperty()
iracingId: string;
iracingId!: string;
@ApiProperty()
name: string;
name!: string;
@ApiProperty()
country: string;
country!: string;
@ApiProperty()
bio?: string;
@ApiProperty()
joinedAt: string;
joinedAt!: string;
}

View File

@@ -2,81 +2,81 @@ import { ApiProperty } from '@nestjs/swagger';
export class DriverProfileDriverSummaryDTO {
@ApiProperty()
id: string;
id!: string;
@ApiProperty()
name: string;
name!: string;
@ApiProperty()
country: string;
country!: string;
@ApiProperty()
avatarUrl: string;
avatarUrl!: string;
@ApiProperty({ nullable: true })
iracingId: string | null;
iracingId!: string | null;
@ApiProperty()
joinedAt: string;
joinedAt!: string;
@ApiProperty({ nullable: true })
rating: number | null;
rating!: number | null;
@ApiProperty({ nullable: true })
globalRank: number | null;
globalRank!: number | null;
@ApiProperty({ nullable: true })
consistency: number | null;
consistency!: number | null;
@ApiProperty({ nullable: true })
bio: string | null;
bio!: string | null;
@ApiProperty({ nullable: true })
totalDrivers: number | null;
totalDrivers!: number | null;
}
export class DriverProfileStatsDTO {
@ApiProperty()
totalRaces: number;
totalRaces!: number;
@ApiProperty()
wins: number;
wins!: number;
@ApiProperty()
podiums: number;
podiums!: number;
@ApiProperty()
dnfs: number;
dnfs!: number;
@ApiProperty({ nullable: true })
avgFinish: number | null;
avgFinish!: number | null;
@ApiProperty({ nullable: true })
bestFinish: number | null;
bestFinish!: number | null;
@ApiProperty({ nullable: true })
worstFinish: number | null;
worstFinish!: number | null;
@ApiProperty({ nullable: true })
finishRate: number | null;
finishRate!: number | null;
@ApiProperty({ nullable: true })
winRate: number | null;
winRate!: number | null;
@ApiProperty({ nullable: true })
podiumRate: number | null;
podiumRate!: number | null;
@ApiProperty({ nullable: true })
percentile: number | null;
percentile!: number | null;
@ApiProperty({ nullable: true })
rating: number | null;
rating!: number | null;
@ApiProperty({ nullable: true })
consistency: number | null;
consistency!: number | null;
@ApiProperty({ nullable: true })
overallRank: number | null;
overallRank!: number | null;
}
export class DriverProfileFinishDistributionDTO {

View File

@@ -4,9 +4,9 @@ import { IsString } from 'class-validator';
export class GetDriverRegistrationStatusQueryDTO {
@ApiProperty()
@IsString()
raceId: string;
raceId!: string;
@ApiProperty()
@IsString()
driverId: string;
driverId!: string;
}