From 11d78e4f696885b364a02b84c3be8ea7ff457513 Mon Sep 17 00:00:00 2001 From: Carlos Narro Date: Sun, 31 May 2026 16:18:39 +0200 Subject: [PATCH] Add captura de urgencia, target, estructural y gustos en el form de fotos --- mvp/b2c/src/app/solicitud/actions.ts | 14 +++++ .../src/components/funnel/FotosUploader.tsx | 56 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/mvp/b2c/src/app/solicitud/actions.ts b/mvp/b2c/src/app/solicitud/actions.ts index 7060dcb..2333738 100644 --- a/mvp/b2c/src/app/solicitud/actions.ts +++ b/mvp/b2c/src/app/solicitud/actions.ts @@ -101,6 +101,16 @@ export async function guardarDetallesYFotos(leadId: string, formData: FormData): : 'media'; const m2Suelo = Number.isFinite(m2Raw) && m2Raw > 0 ? m2Raw : null; + const urgenciaRaw = String(formData.get('urgencia') ?? ''); + const urgencia = (['alta', 'media', 'baja'] as const).includes(urgenciaRaw as 'alta') + ? (urgenciaRaw as 'alta' | 'media' | 'baja') + : null; + const targetEuros = Number(formData.get('presupuestoTarget')); + const presupuestoTarget = + Number.isFinite(targetEuros) && targetEuros > 0 ? Math.round(targetEuros * 100) : null; + const estructural = formData.get('estructural') === 'on'; + const tasteText = String(formData.get('tasteText') ?? '').trim() || null; + const archivos = formData.getAll('fotos').filter((f): f is File => f instanceof File); const dataUris: string[] = []; for (const file of archivos.slice(0, MAX_FOTOS)) { @@ -121,6 +131,10 @@ export async function guardarDetallesYFotos(leadId: string, formData: FormData): calidadGlobal, m2Suelo, provincia, + urgencia, + presupuestoTarget, + estructural, + tasteText, pipelineStage: 'fotos_subidas', updatedAt: new Date(), }) diff --git a/mvp/b2c/src/components/funnel/FotosUploader.tsx b/mvp/b2c/src/components/funnel/FotosUploader.tsx index 4114ea5..f3273c1 100644 --- a/mvp/b2c/src/components/funnel/FotosUploader.tsx +++ b/mvp/b2c/src/components/funnel/FotosUploader.tsx @@ -10,6 +10,11 @@ const CALIDADES = [ { value: 'media', label: 'Media' }, { value: 'premium', label: 'Premium' }, ] as const; +const URGENCIAS = [ + { value: 'alta', label: 'Cuanto antes' }, + { value: 'media', label: 'En unos meses' }, + { value: 'baja', label: 'Sin prisa' }, +] as const; const MAX_FOTOS = 4; @@ -144,6 +149,57 @@ export default function FotosUploader({ /> + {/* Urgencia + presupuesto objetivo */} +
+
+ + +
+
+ + +
+
+ + {/* Cambios estructurales */} + + + {/* Bloque abierto de gustos */} +
+ +