27 lines
833 B
TypeScript
27 lines
833 B
TypeScript
import { IsString, IsNotEmpty, IsDate, IsOptional } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class CreateEventoDto {
|
|
@IsString()
|
|
@IsNotEmpty({ message: 'El tipo de evento es obligatorio.' })
|
|
tipo_evento: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty({ message: 'El nombre del evento es obligatorio.' })
|
|
nombre_evento: string;
|
|
|
|
@IsOptional()
|
|
@IsNotEmpty({ message: 'La descripción del evento es obligatoria.' })
|
|
descripcion_evento: string;
|
|
|
|
@Type(() => Date)
|
|
@IsDate({ message: 'La fecha de inicio debe ser una fecha válida.' })
|
|
@IsNotEmpty({ message: 'La fecha de inicio es obligatoria.' })
|
|
fecha_inicio: Date;
|
|
|
|
@Type(() => Date)
|
|
@IsDate({ message: 'La fecha de fin debe ser una fecha válida.' })
|
|
@IsNotEmpty({ message: 'La fecha de fin es obligatoria.' })
|
|
fecha_fin: Date;
|
|
}
|