import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsArray, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { LeagueWithCapacityDTO } from './LeagueWithCapacityDTO';

export class AllLeaguesWithCapacityDTO {
  @ApiProperty({ type: [LeagueWithCapacityDTO] })
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => LeagueWithCapacityDTO)
  leagues: LeagueWithCapacityDTO[];

  @ApiProperty()
  @IsNumber()
  totalCount: number;
}