src/user/dto/onboard-config.dto.ts
Properties |
| accessor |
Type : string
|
Decorators :
@IsString()
|
|
Defined in src/user/dto/onboard-config.dto.ts:29
|
| id |
Type : number
|
Decorators :
@IsNumber()
|
|
Defined in src/user/dto/onboard-config.dto.ts:33
|
| label |
Type : string
|
Decorators :
@IsString()
|
|
Defined in src/user/dto/onboard-config.dto.ts:36
|
| options |
Type : Option[]
|
Decorators :
@IsOptional()
|
|
Defined in src/user/dto/onboard-config.dto.ts:42
|
| required |
Type : boolean
|
Decorators :
@IsBoolean()
|
|
Defined in src/user/dto/onboard-config.dto.ts:46
|
| section |
Type : string
|
Decorators :
@IsString()
|
|
Defined in src/user/dto/onboard-config.dto.ts:49
|
| type |
Type : string
|
Decorators :
@IsString()
|
|
Defined in src/user/dto/onboard-config.dto.ts:52
|
| validation |
Type : ValidationObject
|
Decorators :
@IsOptional()
|
|
Defined in src/user/dto/onboard-config.dto.ts:57
|
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[];
}