added tag action

This commit is contained in:
hannathkadher
2024-12-23 20:34:44 +04:00
parent a4740e8bbd
commit b0eec7c38e
10 changed files with 332 additions and 99 deletions

View File

@ -0,0 +1,40 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsString, IsOptional, IsArray, ValidateNested } from 'class-validator';
import { ModifyTagModelDto } from '../tag-model-dtos';
export class ModifySubspaceModelDto {
@ApiProperty({
description: 'Action to perform: add, update, or delete',
example: 'add',
})
@IsString()
action: 'add' | 'update' | 'delete';
@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: [ModifyTagModelDto],
})
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => ModifyTagModelDto)
tags?: ModifyTagModelDto[];
}