src/user/dto/onboard-config.dto.ts
Properties |
| label |
Type : string
|
Decorators :
@IsString()
|
|
Defined in src/user/dto/onboard-config.dto.ts:21
|
| value |
Type : string
|
Decorators :
@IsString()
|
|
Defined in src/user/dto/onboard-config.dto.ts:24
|
import {
IsArray,
IsBoolean,
IsNumber,
IsOptional,
IsString,
ValidateNested,
} from "class-validator";
import { Type } from "class-transformer";
class ValidationObject {
@IsString()
condition: string;
@IsString()
message: string;
}
class Option {
@IsString()
label: string;
@IsString()
value: string;
}
export class CMSFieldType {
@IsString()
accessor: string;
@IsNumber()
@IsOptional()
id: number;
@IsString()
label: string;
@IsOptional()
@IsArray()
@ValidateNested()
@Type(() => Option)
options: Option[];
@IsBoolean()
@IsOptional()
required: boolean;
@IsString()
section: string;
@IsString()
type: string;
@IsOptional()
@ValidateNested()
@Type(() => ValidationObject)
validation: ValidationObject;
}
export class OnboardEditableFormDto {
@IsNumber()
id: number;
@Type(() => CMSFieldType)
@IsArray()
@ValidateNested({ each: true })
onboardEditableFields: CMSFieldType[];
}