import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsArray, IsObject, ValidateNested } from 'class-validator';
import { DriverDTO } from '../../driver/dtos/DriverDTO';
import { RaceDTO } from '../../race/dtos/RaceDTO';
import { ProtestDTO } from './ProtestDTO';

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

  @ApiProperty({ type: Object })
  @IsObject()
  @ValidateNested()
  @Type(() => RaceDTO)
  racesById!: Record<string, RaceDTO>;

  @ApiProperty({ type: Object })
  @IsObject()
  @ValidateNested()
  @Type(() => DriverDTO)
  driversById!: Record<string, DriverDTO>;
}