mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 20:04:54 +00:00
* refactor: reducing used queries on get communities (#385) * refactor: fix create space logic (#394) * Remove unique constraint on subspace and product in SubspaceProductAllocationEntity; update product relation to nullable in NewTagEntity * refactor: fix create space logic * device model updated to include the fixes and final columns * updated space models to include suggested fixes, update final logic and column names * task: removing old references of the old tag-product relation * task: remove old use of tags * task: remove old tag & tag model usage * refactor: delete space * task: remove unused functions * fix lint rule
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
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[];
|
|
}
|