import { ApiProperty } from '@nestjs/swagger';
import { IsArray, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { DriverDto } from '../../driver/dto/DriverDto';
import { RaceDto } from '../../race/dto/RaceDto';
import { ProtestDTO } from './ProtestDTO';

export class LeagueAdminProtestsDTO {
  @ApiProperty({ type: [ProtestDTO] }) 
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => ProtestDTO)
  protests: ProtestDTO[];

  @ApiProperty({ type: () => RaceDto })
  @ValidateNested()
  @Type(() => RaceDto)
  racesById: { [raceId: string]: RaceDto }; 

  @ApiProperty({ type: () => DriverDto })
  @ValidateNested()
  @Type(() => DriverDto)
  driversById: { [driverId: string]: DriverDto }; 
}