fix(auditoria completa): bloqueos de Mi Dia, cobranza (saldos y fechas), captura (departamento y rol), contactos (privacidad), cotizador (QR) y validaciones de API

This commit is contained in:
2026-09-21 07:18:39 +00:00
parent 75956a709f
commit 5e9b2ac456
16 changed files with 259 additions and 71 deletions

View File

@@ -35,7 +35,7 @@ describe('getUnidades', () => {
const resultado = await getUnidades()
expect(fetchMock).toHaveBeenCalledWith('http://192.168.10.123:3000/api/unidades', {})
expect(fetchMock).toHaveBeenCalledWith('/api/unidades', {})
expect(resultado.usandoSeed).toBe(false)
expect(resultado.unidades).toEqual([unidadApi])
})

View File

@@ -91,9 +91,16 @@ export interface GuardarCotizacionPayload {
oportunidadId?: string
}
/** URL pública de una cotización (destino del QR del PDF) */
/**
* URL pública de una cotización (destino del QR del PDF). Debe ser ABSOLUTA:
* un QR con ruta relativa ("/api/...") no es navegable al escanearlo desde el
* teléfono del cliente. Se arma con el origen actual cuando API_URL es relativa.
*/
export function urlPublicaCotizacion(id: string): string {
return `${API_URL}/cotizaciones/${id}/publico`
const base = API_URL.startsWith('http')
? API_URL
: `${typeof window !== 'undefined' ? window.location.origin : ''}${API_URL}`
return `${base}/cotizaciones/${id}/publico`
}
/** POST /cotizaciones — persiste y liga la oportunidad del cliente */