Mejora Transacción y Historial: estado por fila, envío individual y filtros avanzados
- Transacción: tabla con estado Enviado/Pendiente/Error por IDRECEPCION, botón enviar fila a fila o masivo, modal con JSON + respuesta TNS por registro
- Historial: filtros por fecha, tipo, IDRECEPCION/contrato; paginación 50 por página; modal con 3 tabs (JSON enviado / Respuesta TNS / Mensaje)
- DB: migración automática para agregar columnas idrecepcion, contrato, mensaje_tns a tabla envios
- Logs route: nuevo endpoint /logs/detalle/{id} para cargar detalle completo vía JS
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ef71a1db56
commit
7699303a53
@@ -13,6 +13,17 @@ def get_connection():
|
||||
return conn
|
||||
|
||||
|
||||
def _migrate(conn):
|
||||
cols = {r[1] for r in conn.execute("PRAGMA table_info(envios)")}
|
||||
if "idrecepcion" not in cols:
|
||||
conn.execute("ALTER TABLE envios ADD COLUMN idrecepcion INTEGER")
|
||||
if "contrato" not in cols:
|
||||
conn.execute("ALTER TABLE envios ADD COLUMN contrato TEXT")
|
||||
if "mensaje_tns" not in cols:
|
||||
conn.execute("ALTER TABLE envios ADD COLUMN mensaje_tns TEXT")
|
||||
conn.commit()
|
||||
|
||||
|
||||
def init_db():
|
||||
conn = get_connection()
|
||||
conn.executescript("""
|
||||
@@ -67,4 +78,5 @@ def init_db():
|
||||
);
|
||||
""")
|
||||
conn.commit()
|
||||
_migrate(conn)
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user