39 lines
698 B
TypeScript
39 lines
698 B
TypeScript
import {
|
|
IsString,
|
|
IsBoolean,
|
|
IsOptional,
|
|
IsArray,
|
|
IsEnum,
|
|
IsUUID,
|
|
} from 'class-validator';
|
|
import { BaseDto } from '../../_core/dto/base.dto';
|
|
|
|
export class CreateQuestionDto extends BaseDto {
|
|
@IsString()
|
|
text: string;
|
|
|
|
@IsEnum(['multiple-choice', 'single-choice', 'text'])
|
|
type: 'multiple-choice' | 'single-choice' | 'text';
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isRequired?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isConfidential?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
validationRules?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsUUID('4', { each: true })
|
|
optionIds?: string[];
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsUUID('4', { each: true })
|
|
attachmentIds?: string[];
|
|
} |