mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 07:57:54 +00:00
31 lines
738 B
TypeScript
31 lines
738 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import {
|
|
IsArray,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsString,
|
|
ValidateNested,
|
|
} from 'class-validator';
|
|
import { CreateSpaceProductModelDto } from './create-space-product-model.dto';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class CreateSubspaceModelDto {
|
|
@ApiProperty({
|
|
description: 'Name of the subspace',
|
|
example: 'Living Room',
|
|
})
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
subspaceName: string;
|
|
|
|
@ApiProperty({
|
|
description: 'List of products included in the model',
|
|
type: [CreateSpaceProductModelDto],
|
|
})
|
|
@IsArray()
|
|
@IsOptional()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => CreateSpaceProductModelDto)
|
|
spaceProductModels?: CreateSpaceProductModelDto[];
|
|
}
|