import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsOptional, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { DriverDTO } from '../../driver/dtos/DriverDTO';

export class LeagueOwnerSummaryDTO {
  @ApiProperty({ type: () => DriverDTO })
  @ValidateNested()
  @Type(() => DriverDTO)
  driver!: DriverDTO;

  @ApiProperty({ nullable: true })
  @IsOptional()
  @IsNumber()
  rating!: number | null;

  @ApiProperty({ nullable: true })
  @IsOptional()
  @IsNumber()
  rank!: number | null;
}