Files
backend/src/space-model/dtos/subspaces-model-dtos/create-subspace-model.dto.ts
2025-02-21 21:22:48 +04:00

24 lines
623 B
TypeScript

import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsNotEmpty, IsString, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { ProcessTagDto } from 'src/tags/dtos';
export class CreateSubspaceModelDto {
@ApiProperty({
description: 'Name of the subspace',
example: 'Living Room',
})
@IsNotEmpty()
@IsString()
subspaceName: string;
@ApiProperty({
description: 'List of tag models associated with the subspace',
type: [ProcessTagDto],
})
@IsArray()
@ValidateNested({ each: true })
@Type(() => ProcessTagDto)
tags?: ProcessTagDto[];
}