mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 21:44:55 +00:00
update in tag service
This commit is contained in:
@ -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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user