feat(apartado): ficha completa en Monday + estado visible en la app

- El alta (directa y progresiva) llena el Apartado con telefono, correo,
  curp, Precio Final, Enganche, Fecha Compra, Vendedor (el capturista
  con Monday vinculado) y Forma de Pago; el path webhook/cron hereda
  contacto, precio y asesor de la oportunidad.
- Bidireccional: Mis clientes en /hoy muestra el estado actual del
  Apartado leyendolo de Monday (si lo mueven en Monday, la app lo
  refleja en el siguiente refresh).
- getApartados con la correccion value-null al leer Estado.
- Test del mapa de Tipo propuesta del cotizador (los 502 del log eran
  de un proceso previo al fix 4f31d1c; queda cubierto).
This commit is contained in:
2026-09-04 07:34:57 +00:00
parent d81797c610
commit 42cfe937cf
13 changed files with 428 additions and 12 deletions

View File

@@ -112,3 +112,15 @@ describe('crearCotizacion (POST /api/cotizaciones) — match con el funnel', ()
expect(prismaMock.cotizacion.create).toHaveBeenCalledOnce()
})
})
describe('LABEL_PROPUESTA_MONDAY (códigos del cotizador → labels reales del board)', () => {
it('los 5 códigos del enum mapean a los labels sembrados en la columna "Tipo propuesta"', async () => {
const { LABEL_PROPUESTA_MONDAY } = await import('./cotizaciones.controller.js')
// Labels reales verificados en Monday (difieren en guiones/espacios)
expect(LABEL_PROPUESTA_MONDAY['BANCARIO']).toBe('CREDITO BANCARIO')
expect(LABEL_PROPUESTA_MONDAY['INFONAVIT']).toBe('INFONAVIT-COFINAVIT')
expect(LABEL_PROPUESTA_MONDAY['COFINAVIT']).toBe('INFONAVIT-COFINAVIT')
expect(LABEL_PROPUESTA_MONDAY['CONTADO']).toBe('CONTADO')
expect(LABEL_PROPUESTA_MONDAY['SEMI_CONTADO']).toBe('SEMI CONTADO')
})
})