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

@@ -54,6 +54,7 @@ class OrderData:
items: list = field(default_factory=list) # list of OrderItem
billing: OrderBilling = field(default_factory=OrderBilling)
shipping: Optional[OrderShipping] = None
total: float = 0.0
payment_name: str = ""
delivery_name: str = ""
source_file: str = ""
@@ -163,6 +164,7 @@ def _parse_order(order_id: str, data: dict, source_file: str) -> OrderData:
items=items,
billing=billing,
shipping=shipping,
total=float(data.get("total", 0) or 0),
payment_name=str(payment.get("name", "")) if isinstance(payment, dict) else "",
delivery_name=str(delivery.get("name", "")) if isinstance(delivery, dict) else "",
source_file=source_file