mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 08:04:53 +00:00
69 lines
1.6 KiB
TypeScript
69 lines
1.6 KiB
TypeScript
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 {
|
|
@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()
|
|
@IsOptional()
|
|
x?: number;
|
|
|
|
@ApiProperty({ description: 'Y position on canvas', example: 200 })
|
|
@IsNumber()
|
|
@IsOptional()
|
|
y?: number;
|
|
|
|
@ApiPropertyOptional({
|
|
description: 'List of subspace modifications (add/update/delete)',
|
|
type: [ModifySubspaceDto],
|
|
})
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => ModifySubspaceDto)
|
|
subspace?: 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[];
|
|
@ApiProperty({
|
|
description: 'UUID of the Space',
|
|
example: 'd290f1ee-6c54-4b01-90e6-d701748f0851',
|
|
})
|
|
@IsString()
|
|
@IsOptional()
|
|
spaceModelUuid?: string;
|
|
}
|