import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNumber, IsOptional } from 'class-validator';

export class DriverSummaryDTO {
  @ApiProperty()
  @IsString()
  id!: string;

  @ApiProperty()
  @IsString()
  name!: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  country?: string;

  @ApiProperty({ nullable: true })
  @IsOptional()
  @IsString()
  avatarUrl!: string | null;

  @ApiProperty({ required: false, nullable: true })
  @IsOptional()
  @IsNumber()
  rating?: number | null;

  @ApiProperty({ required: false, nullable: true })
  @IsOptional()
  @IsNumber()
  globalRank?: number | null;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsNumber()
  totalRaces?: number;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsNumber()
  wins?: number;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsNumber()
  podiums?: number;

  @ApiProperty({ required: false, nullable: true })
  @IsOptional()
  @IsNumber()
  consistency?: number | null;
}