import { ApiProperty } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsArray, IsNotEmpty, IsOptional, IsString, ValidateNested, } from 'class-validator'; import { ProcessTagDto } from 'src/tags/dtos'; import { CreateProductAllocationDto } from '../create-product-allocation.dto'; export class AddSubspaceDto { @ApiProperty({ example: 'Meeting Room 1', description: 'Name of the subspace', }) @IsNotEmpty() @IsString() subspaceName: string; @ApiProperty({ description: 'List of tags associated with the subspace', type: [ProcessTagDto], }) @IsArray() @ValidateNested({ each: true }) @Type(() => CreateProductAllocationDto) @IsOptional() productAllocations?: CreateProductAllocationDto[]; }