feat(sync): add order_total field to SQLite tracking

Parse order total from GoMag JSON, store in SQLite orders table,
and expose via sync run API. Enables total display in mobile flat rows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-15 21:20:57 +00:00
parent 9a6bec33ff
commit c4fa643eca
6 changed files with 22 additions and 8 deletions

View File

@@ -103,7 +103,8 @@ CREATE TABLE IF NOT EXISTS orders (
factura_total_fara_tva REAL,
factura_total_tva REAL,
factura_total_cu_tva REAL,
invoice_checked_at TEXT
invoice_checked_at TEXT,
order_total REAL
);
CREATE INDEX IF NOT EXISTS idx_orders_status ON orders(status);
CREATE INDEX IF NOT EXISTS idx_orders_date ON orders(order_date);
@@ -301,6 +302,7 @@ def init_sqlite():
("factura_total_tva", "REAL"),
("factura_total_cu_tva", "REAL"),
("invoice_checked_at", "TEXT"),
("order_total", "REAL"),
]:
if col not in order_cols:
conn.execute(f"ALTER TABLE orders ADD COLUMN {col} {typedef}")