|
1 | | -import { MixedValue } from './../../../_common/types/mixed-value.type' |
2 | | -import { Mixed } from 'mongoose' |
3 | | -import { ApiProperty, PartialType } from '@nestjs/swagger' |
4 | | -import { IsString, IsEnum, IsObject, ValidateNested, IsOptional, IsMongoId } from 'class-validator' |
5 | | -import { ObjectId } from 'mongodb' |
6 | | -import { MixedValue } from '~/_common/types/mixed-value.type' |
7 | | -import { FormTypeList, FormTypes } from '../_enum/types' |
8 | | -import { MetadataDto } from '~/_common/abstracts/dto/metadata.dto' |
9 | | -import { forwardRef } from '@nestjs/common' |
10 | | -import { Type } from 'class-transformer' |
11 | | -import { FormSectionDto } from './parts/section.dto' |
| 1 | +import { ApiProperty, PartialType } from '@nestjs/swagger'; |
| 2 | +import { IsString, IsEnum, IsObject, ValidateNested, IsOptional } from 'class-validator'; |
| 3 | +import { MixedValue } from '~/_common/types/mixed-value.type'; |
| 4 | +import { FormTypeList, FormTypes } from '../_enum/types'; |
| 5 | +import { MetadataDto } from '~/_common/abstracts/dto/metadata.dto'; |
| 6 | +import { Type } from 'class-transformer'; |
| 7 | +import { FormSectionDto } from './parts/section.dto'; |
12 | 8 |
|
13 | 9 | export class FormCreateDto extends MetadataDto { |
14 | 10 | @IsString() |
15 | 11 | @ApiProperty() |
16 | | - title: string |
| 12 | + title: string; |
17 | 13 |
|
18 | 14 | @IsString() |
19 | 15 | @IsOptional() |
20 | 16 | @ApiProperty({ required: false }) |
21 | | - description?: string |
| 17 | + description?: string; |
22 | 18 |
|
23 | 19 | @IsEnum(FormTypeList) |
24 | 20 | @ApiProperty({ enum: FormTypeList }) |
25 | | - type: FormTypes |
| 21 | + type: FormTypes; |
26 | 22 |
|
27 | 23 | @IsObject() |
28 | 24 | @IsOptional() |
29 | 25 | @ApiProperty({ required: false }) |
30 | | - defaultValues: { [key: string]: MixedValue } |
| 26 | + defaultValues: { [key: string]: MixedValue }; |
31 | 27 |
|
32 | 28 | @ValidateNested({ each: true }) |
33 | 29 | @Type(() => FormSectionDto) |
34 | 30 | // @ApiProperty({ type: () => FormSectionDto, isArray: true }) |
35 | | - sections: { [key: string]: FormSectionDto } |
| 31 | + sections: { [key: string]: FormSectionDto }; |
36 | 32 |
|
37 | 33 | @IsString() |
38 | 34 | @ApiProperty() |
39 | | - submitButtonText: string |
| 35 | + submitButtonText: string; |
40 | 36 |
|
41 | 37 | @IsString() |
42 | 38 | @ApiProperty() |
43 | | - submitApiUrl: string |
| 39 | + submitApiUrl: string; |
44 | 40 |
|
45 | 41 | @IsObject() |
46 | 42 | @IsOptional() |
47 | 43 | @ApiProperty({ required: false }) |
48 | | - redirectUrl?: string |
| 44 | + redirectUrl?: string; |
49 | 45 | } |
50 | 46 |
|
51 | 47 | export class FormDto extends FormCreateDto {} |
52 | 48 |
|
53 | | - |
54 | 49 | export class FormUpdateDto extends PartialType(FormDto) {} |
0 commit comments