Proeycto de images-worker creado
This commit is contained in:
97
mvp/image-worker/src/webhook/webhook.dto.ts
Normal file
97
mvp/image-worker/src/webhook/webhook.dto.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
import { IsString, IsOptional, IsNumber, IsBoolean, IsArray, ValidateNested, IsIn, IsUUID } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
class ClienteDto {
|
||||
@IsString()
|
||||
nombre: string;
|
||||
|
||||
@IsString()
|
||||
telefono: string;
|
||||
|
||||
@IsString()
|
||||
email: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
provincia?: string;
|
||||
}
|
||||
|
||||
class ReformaDto {
|
||||
@IsString()
|
||||
@IsIn(['cocina', 'bano', 'salon', 'comedor', 'integral', 'otro'])
|
||||
tipo: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
m2Suelo?: number;
|
||||
|
||||
@IsString()
|
||||
@IsIn(['basica', 'media', 'premium'])
|
||||
calidad: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
estructural?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsIn(['alta', 'media', 'baja'])
|
||||
urgencia?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
presupuestoTarget?: number;
|
||||
}
|
||||
|
||||
class EmpresaDto {
|
||||
@IsUUID()
|
||||
tenantId: string;
|
||||
|
||||
@IsString()
|
||||
nombre: string;
|
||||
}
|
||||
|
||||
class FotosDto {
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
antes: string[];
|
||||
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
despues: string[];
|
||||
}
|
||||
|
||||
class ZonaDto {
|
||||
@IsString()
|
||||
zona: string;
|
||||
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
notas: string[];
|
||||
|
||||
@ValidateNested()
|
||||
@Type(() => FotosDto)
|
||||
fotos: FotosDto;
|
||||
}
|
||||
|
||||
export class PerfilCompletoDto {
|
||||
@IsUUID()
|
||||
leadId: string;
|
||||
|
||||
@ValidateNested()
|
||||
@Type(() => ClienteDto)
|
||||
cliente: ClienteDto;
|
||||
|
||||
@ValidateNested()
|
||||
@Type(() => ReformaDto)
|
||||
reforma: ReformaDto;
|
||||
|
||||
@ValidateNested()
|
||||
@Type(() => EmpresaDto)
|
||||
empresa: EmpresaDto;
|
||||
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => ZonaDto)
|
||||
zonas: ZonaDto[];
|
||||
}
|
||||
Reference in New Issue
Block a user