import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsArray, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { LeagueConfigFormModelBasicsDTO } from './LeagueConfigFormModelBasicsDTO';
import { LeagueConfigFormModelStructureDTO } from './LeagueConfigFormModelStructureDTO';
import { LeagueConfigFormModelScoringDTO } from './LeagueConfigFormModelScoringDTO';
import { LeagueConfigFormModelDropPolicyDTO } from './LeagueConfigFormModelDropPolicyDTO';
import { LeagueConfigFormModelStewardingDTO } from './LeagueConfigFormModelStewardingDTO';
import { LeagueConfigFormModelTimingsDTO } from './LeagueConfigFormModelTimingsDTO';

export class LeagueConfigFormModelDTO {
  @ApiProperty()
  @IsString()
  leagueId: string;

  @ApiProperty({ type: LeagueConfigFormModelBasicsDTO })
  @ValidateNested()
  @Type(() => LeagueConfigFormModelBasicsDTO)
  basics: LeagueConfigFormModelBasicsDTO;

  @ApiProperty({ type: LeagueConfigFormModelStructureDTO })
  @ValidateNested()
  @Type(() => LeagueConfigFormModelStructureDTO)
  structure: LeagueConfigFormModelStructureDTO;

  @ApiProperty({ type: [Object] }) 
  @IsArray()
  championships: any[];

  @ApiProperty({ type: LeagueConfigFormModelScoringDTO })
  @ValidateNested()
  @Type(() => LeagueConfigFormModelScoringDTO)
  scoring: LeagueConfigFormModelScoringDTO;

  @ApiProperty({ type: LeagueConfigFormModelDropPolicyDTO })
  @ValidateNested()
  @Type(() => LeagueConfigFormModelDropPolicyDTO)
  dropPolicy: LeagueConfigFormModelDropPolicyDTO;

  @ApiProperty({ type: LeagueConfigFormModelTimingsDTO })
  @ValidateNested()
  @Type(() => LeagueConfigFormModelTimingsDTO)
  timings: LeagueConfigFormModelTimingsDTO;

  @ApiProperty({ type: LeagueConfigFormModelStewardingDTO })
  @ValidateNested()
  @Type(() => LeagueConfigFormModelStewardingDTO)
  stewarding: LeagueConfigFormModelStewardingDTO;
}