import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
import { RaceDTO } from '../../race/dtos/RaceDTO';

export class LeagueScheduleDTO {
  @ApiProperty()
  @IsString()
  seasonId!: string;

  @ApiProperty({ description: 'Whether the season schedule is published' })
  @IsBoolean()
  published!: boolean;

  @ApiProperty({ type: [RaceDTO] })
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => RaceDTO)
  races!: RaceDTO[];
}