update in tag service

This commit is contained in:
hannathkadher
2024-12-24 11:33:58 +04:00
parent 1e47fffc0a
commit cb2778dce5
22 changed files with 705 additions and 117 deletions

View File

@ -1,4 +1,59 @@
import { PartialType } from '@nestjs/swagger';
import { AddSpaceDto } from './add.space.dto';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import {
IsArray,
IsNumber,
IsOptional,
IsString,
ValidateNested,
} from 'class-validator';
import { ModifySubspaceDto } from './subspace';
import { Type } from 'class-transformer';
import { ModifyTagDto } from './tag/modify-tag.dto';
export class UpdateSpaceDto extends PartialType(AddSpaceDto) {}
export class UpdateSpaceDto {
@ApiProperty({
description: 'Updated name of the space ',
example: 'New Space Name',
})
@IsOptional()
@IsString()
spaceName?: string;
@ApiProperty({
description: 'Icon identifier for the space',
example: 'assets/location',
required: false,
})
@IsString()
@IsOptional()
public icon?: string;
@ApiProperty({ description: 'X position on canvas', example: 120 })
@IsNumber()
x: number;
@ApiProperty({ description: 'Y position on canvas', example: 200 })
@IsNumber()
y: number;
@ApiPropertyOptional({
description: 'List of subspace modifications (add/update/delete)',
type: [ModifySubspaceDto],
})
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => ModifySubspaceDto)
subspaceModels?: ModifySubspaceDto[];
@ApiPropertyOptional({
description:
'List of tag modifications (add/update/delete) for the space model',
type: [ModifyTagDto],
})
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => ModifyTagDto)
tags?: ModifyTagDto[];
}