From 9654d58ea0eb99549b82a53586c1e628e266e04f Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Sun, 31 Mar 2024 22:30:05 +0300 Subject: [PATCH] Add AddCommunityDto class with properties --- src/community/dtos/add.community.dto.ts | 32 +++++++++++++++++++++++++ src/community/dtos/index.ts | 1 + 2 files changed, 33 insertions(+) create mode 100644 src/community/dtos/add.community.dto.ts create mode 100644 src/community/dtos/index.ts diff --git a/src/community/dtos/add.community.dto.ts b/src/community/dtos/add.community.dto.ts new file mode 100644 index 0000000..d28af76 --- /dev/null +++ b/src/community/dtos/add.community.dto.ts @@ -0,0 +1,32 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsString, IsOptional } from 'class-validator'; + +export class AddCommunityDto { + @ApiProperty({ + description: 'spaceName', + required: true, + }) + @IsString() + @IsNotEmpty() + public spaceName: string; + + @ApiProperty({ + description: 'parentUuid', + required: false, + }) + @IsString() + @IsOptional() + public parentUuid?: string; + + @ApiProperty({ + description: 'spaceTypeUuid', + required: true, + }) + @IsString() + @IsNotEmpty() + public spaceTypeUuid: string; + + constructor(dto: Partial) { + Object.assign(this, dto); + } +} diff --git a/src/community/dtos/index.ts b/src/community/dtos/index.ts new file mode 100644 index 0000000..7119b23 --- /dev/null +++ b/src/community/dtos/index.ts @@ -0,0 +1 @@ +export * from './add.community.dto';