diff --git a/enrich_costco.py b/enrich_costco.py index 8129c64..1b254ea 100644 --- a/enrich_costco.py +++ b/enrich_costco.py @@ -213,9 +213,11 @@ def parse_costco_item(order_id, order_date, raw_path, line_no, item): def iter_costco_rows(raw_dir): for path in discover_json_files(raw_dir): - if path.name == "summary.json": + if path.name in {"summary.json", "summary_requests.json"}: continue payload = json.loads(path.read_text(encoding="utf-8")) + if not isinstance(payload, dict): + continue receipts = payload.get("data", {}).get("receiptsWithCounts", {}).get("receipts", []) for receipt in receipts: order_id = receipt["transactionBarcode"]