This commit is contained in:
Your Name
2025-04-02 11:50:08 -06:00
parent bf7c0e93a8
commit a1f52daa8a
26 changed files with 1109 additions and 42 deletions
+36 -1
View File
@@ -1 +1,36 @@
export class CreatePreguntaDto {}
import { Type } from 'class-transformer';
import { IsArray, IsBoolean, IsNotEmpty, IsNumber, IsOptional, IsString, ValidateNested } from 'class-validator';
export class OpcionDto {
@IsNotEmpty()
@IsString()
valor: string;
}
export class CreatePreguntaDto {
@IsNotEmpty()
@IsString()
titulo: string;
@IsOptional()
@IsBoolean()
obligatoria?: boolean;
@IsNotEmpty()
@IsString()
tipo: string;
@IsOptional()
@IsNumber()
contador_opcion?: number;
@IsOptional()
@IsNumber()
id_opcion_dependiente?: number;
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => OpcionDto)
opciones?: OpcionDto[];
}