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

export class LeagueWithCapacityDTO {
  @ApiProperty()
  @IsString()
  id: string;

  @ApiProperty()
  @IsString()
  name: string;

  // ... other properties of LeagueWithCapacityDTO
  @ApiProperty({ nullable: true })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiProperty()
  @IsString()
  ownerId: string;

  @ApiProperty({ type: () => LeagueSettingsDTO })
  @ValidateNested()
  @Type(() => LeagueSettingsDTO)
  settings: LeagueSettingsDTO;

  @ApiProperty()
  @IsString()
  createdAt: string;

  @ApiProperty()
  @IsNumber()
  usedSlots: number;

  @ApiProperty({ type: () => Object, nullable: true }) // Using Object for generic social links
  @IsOptional()
  socialLinks?: {
    discordUrl?: string;
    youtubeUrl?: string;
    websiteUrl?: string;
  };
}