mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00

* task: add getCommunitiesV2 * task: update getOneSpace API to match revamp structure * refactor: implement modifications to pace management APIs * refactor: remove space link
37 lines
773 B
TypeScript
37 lines
773 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import {
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
ValidateIf,
|
|
} from 'class-validator';
|
|
|
|
export class CreateProductAllocationDto {
|
|
@ApiProperty({
|
|
description: 'The name of the tag (if creating a new tag)',
|
|
example: 'New Tag',
|
|
})
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@ValidateIf((o) => !o.tagUuid)
|
|
tagName: string;
|
|
|
|
@ApiProperty({
|
|
description: 'UUID of the tag (if selecting an existing tag)',
|
|
example: '123e4567-e89b-12d3-a456-426614174000',
|
|
})
|
|
@IsUUID()
|
|
@IsNotEmpty()
|
|
@ValidateIf((o) => !o.tagName)
|
|
tagUuid: string;
|
|
|
|
@ApiProperty({
|
|
description: 'UUID of the product',
|
|
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
})
|
|
@IsUUID()
|
|
@IsOptional()
|
|
productUuid: string;
|
|
}
|