Files
lolympus-tournament-support/apps/api/src/modules/community/dto/create-community.dto.ts
T

48 lines
763 B
TypeScript

import { Type } from 'class-transformer';
import {
IsOptional,
IsString,
MaxLength,
MinLength,
ValidateNested,
} from 'class-validator';
class CreateCommunityOwnerDto {
@IsOptional()
@IsString()
@MaxLength(64)
kakaoTalkId?: string;
@IsOptional()
@IsString()
@MaxLength(64)
kakaoTalkNickname?: string;
@IsOptional()
@IsString()
@MaxLength(64)
discordId?: string;
@IsOptional()
@IsString()
@MaxLength(64)
discordNickname?: string;
}
export class CreateCommunityDto {
@IsString()
@MinLength(1)
@MaxLength(64)
name!: string;
@IsOptional()
@IsString()
@MaxLength(1024)
description?: string;
@IsOptional()
@ValidateNested()
@Type(() => CreateCommunityOwnerDto)
owner?: CreateCommunityOwnerDto;
}