Files
gridpilot.gg/apps/api/src/domain/league/dtos/LeagueWithCapacityDTO.ts

45 lines
1010 B
TypeScript

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;
};
}