import { ModifyAction } from '@app/common/constants/modify-action.enum'; import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsArray, IsEnum, IsOptional, IsString, ValidateNested, } from 'class-validator'; import { ModifyTagDto } from 'src/space/dtos/tag/modify-tag.dto'; export class ModifySubspaceModelDto { @ApiProperty({ description: 'Action to perform: add, update, or delete', example: ModifyAction.ADD, }) @IsEnum(ModifyAction) action: ModifyAction; @ApiPropertyOptional({ description: 'UUID of the subspace (required for update/delete)', example: '123e4567-e89b-12d3-a456-426614174000', }) @IsOptional() @IsString() uuid?: string; @ApiPropertyOptional({ description: 'Name of the subspace (required for add/update)', example: 'Living Room', }) @IsOptional() @IsString() subspaceName?: string; @ApiPropertyOptional({ description: 'List of tag modifications (add/update/delete) for the subspace', type: [ModifyTagDto], }) @IsOptional() @IsArray() @ValidateNested({ each: true }) @Type(() => ModifyTagDto) tags?: ModifyTagDto[]; }