feat(custom-fields): allow creating values without predefined field ID
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
import { IsString, IsOptional, IsNotEmpty, IsEnum } from 'class-validator';
|
||||
import {
|
||||
IsString,
|
||||
IsOptional,
|
||||
IsNotEmpty,
|
||||
IsEnum,
|
||||
IsBoolean,
|
||||
IsArray,
|
||||
} from 'class-validator';
|
||||
|
||||
export enum CustomFieldEntityType {
|
||||
MACHINE = 'machine',
|
||||
@@ -16,9 +23,26 @@ export class CustomFieldEntityParamsDto {
|
||||
}
|
||||
|
||||
export class UpsertCustomFieldValueDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
customFieldId: string;
|
||||
customFieldId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customFieldName?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
customFieldType?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
customFieldRequired?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
customFieldOptions?: string[];
|
||||
|
||||
@IsEnum(CustomFieldEntityType)
|
||||
entityType: CustomFieldEntityType;
|
||||
|
||||
Reference in New Issue
Block a user