fix: handle Firebird Decimal and datetime types in JSON serialization
- PRECIO and VALORTOTAL are Decimal from fdb driver; convert via _safe_num() - HORAINICIORECEPCION is a datetime object; use _fmt_hora_str() for HH:MM:SS - _parse_hora() now handles datetime objects directly (no str() roundtrip) - Same fixes applied to pacientes.py exam builder - sync-now endpoint catches exceptions and returns traceback as JSON Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
fc18acc761
commit
863e012c12
@@ -33,5 +33,9 @@ async def erp_sync_now(
|
||||
ventana_min: int = Query(default=30, ge=1, le=1440),
|
||||
user: dict = Depends(get_current_user),
|
||||
):
|
||||
resultado = await sync_recientes(ventana_min=ventana_min)
|
||||
return JSONResponse(resultado)
|
||||
import traceback as tb
|
||||
try:
|
||||
resultado = await sync_recientes(ventana_min=ventana_min)
|
||||
return JSONResponse(resultado)
|
||||
except Exception as e:
|
||||
return JSONResponse({"ok": False, "error": str(e), "traceback": tb.format_exc()}, status_code=200)
|
||||
|
||||
Reference in New Issue
Block a user