Add campos de urgencia, target, gustos y snapshot de preferencias a leads

This commit is contained in:
Carlos Narro
2026-05-31 16:17:33 +02:00
parent ccb83a3d20
commit 6e61cbe8e2
4 changed files with 1261 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
CREATE TYPE "public"."urgencia" AS ENUM('alta', 'media', 'baja');--> statement-breakpoint
ALTER TABLE "leads" ADD COLUMN "urgencia" "urgencia";--> statement-breakpoint
ALTER TABLE "leads" ADD COLUMN "presupuesto_target" integer;--> statement-breakpoint
ALTER TABLE "leads" ADD COLUMN "taste_text" text;--> statement-breakpoint
ALTER TABLE "leads" ADD COLUMN "preferences_snapshot" jsonb;

File diff suppressed because it is too large Load Diff

View File

@@ -36,6 +36,13 @@
"when": 1780170597963,
"tag": "0004_even_stranger",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1780237037524,
"tag": "0005_tearful_maverick",
"breakpoints": true
}
]
}

View File

@@ -47,6 +47,8 @@ export const tipoReforma = pgEnum('tipo_reforma', [
export const calidad = pgEnum('calidad', ['basica', 'media', 'premium']);
export const urgencia = pgEnum('urgencia', ['alta', 'media', 'baja']);
export const categoriaMaterial = pgEnum('categoria_material', [
'suelo',
'pared',
@@ -180,6 +182,12 @@ export const leads = pgTable(
.notNull()
.default({}),
desgloseSnapshot: jsonb('desglose_snapshot'),
// Preferencias del cliente capturadas en la llamada (agente de voz)
urgencia: urgencia('urgencia'),
presupuestoTarget: integer('presupuesto_target'), // céntimos
tasteText: text('taste_text'),
preferencesSnapshot: jsonb('preferences_snapshot'),
},
(table) => [
index('leads_tenant_created_idx').on(table.tenantId, table.createdAt),