Files
backend/src/space-model/dtos/create-space-model.dto.ts
hannathkadher 565b0f72b7 update
2025-02-17 17:11:56 +04:00

34 lines
961 B
TypeScript

import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, IsArray, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { CreateSubspaceModelDto } from './subspaces-model-dtos/create-subspace-model.dto';
import { ProcessTagDto } from 'src/tags/dtos';
export class CreateSpaceModelDto {
@ApiProperty({
description: 'Name of the space model',
example: 'Apartment Model',
})
@IsNotEmpty()
@IsString()
modelName: string;
@ApiProperty({
description: 'List of subspaces included in the model',
type: [CreateSubspaceModelDto],
})
@IsArray()
@ValidateNested({ each: true })
@Type(() => CreateSubspaceModelDto)
subspaceModels?: CreateSubspaceModelDto[];
@ApiProperty({
description: 'List of tags associated with the space model',
type: [ProcessTagDto],
})
@IsArray()
@ValidateNested({ each: true })
@Type(() => ProcessTagDto)
tags?: ProcessTagDto[];
}