66 lines
1.5 KiB
TypeScript
66 lines
1.5 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
import { Rol, Autorizacion } from '../../../common/enums/rol.enum.js';
|
|
import { EstadoGeneral } from '../../../common/enums/estados.enum.js';
|
|
|
|
export class PersonaDto {
|
|
@ApiProperty()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
nombres: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
apellidos: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
whatsapp: string;
|
|
|
|
@ApiProperty({ default: '591', required: false })
|
|
@IsString()
|
|
@IsOptional()
|
|
codPais?: string = '591';
|
|
|
|
@ApiProperty({ required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
photoUrl?: string;
|
|
|
|
@ApiProperty({ enum: Rol })
|
|
@IsEnum(Rol)
|
|
@IsNotEmpty()
|
|
rol: Rol;
|
|
|
|
@ApiProperty({ enum: Autorizacion, default: Autorizacion.Usuario, required: false })
|
|
@IsEnum(Autorizacion)
|
|
@IsOptional()
|
|
autorizacion?: Autorizacion = Autorizacion.Usuario;
|
|
|
|
@ApiProperty({ required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
fecNac?: string;
|
|
|
|
@ApiProperty({ required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
ci?: string;
|
|
|
|
@ApiProperty({ required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
complemento?: string;
|
|
|
|
@ApiProperty({ default: false, required: false })
|
|
@IsBoolean()
|
|
@IsOptional()
|
|
verificado?: boolean = false;
|
|
|
|
@ApiProperty({ enum: EstadoGeneral, default: EstadoGeneral.Activo, required: false })
|
|
@IsEnum(EstadoGeneral)
|
|
@IsOptional()
|
|
estado?: EstadoGeneral = EstadoGeneral.Activo;
|
|
}
|