refactor(vendor): 抽出缺貨 API 查詢服務
All checks were successful
CD Pipeline / deploy (push) Successful in 2m11s

This commit is contained in:
OoO
2026-05-01 14:12:56 +08:00
parent b5de8d5d61
commit fbc85fcedc
8 changed files with 157 additions and 131 deletions

View File

@@ -64,6 +64,7 @@
- **Vendor Stockout V2 production default**: `/vendor-stockout` 預設渲染 `vendor_stockout_index_v2.html``?ui=legacy` 才回舊頁;統計來自正式 `VendorStockout/VendorList/VendorEmail/EmailSendLog` 查詢,不建立假資料。
- **Vendor Stockout List V2 production default**: `/vendor-stockout/list` 預設渲染 `vendor_stockout_list_v2.html``?ui=legacy` 才回舊頁;清單、批次、搜尋、分頁與狀態統計都從正式 `VendorStockout` 查詢組裝,並移除重複的 `web/templates/vendor_stockout_index_v2.html`
- **Vendor query service extraction**: Vendor V2 首頁統計與缺貨清單 query 移到 `services/vendor_stockout_query_service.py``routes/vendor_routes.py` 由約 1,821 行降至 1,675 行,回到 request parsing + template rendering避免巨型 Blueprint 繼續承接資料組裝邏輯。
- **Vendor stockout API query extraction**: `/vendor-stockout/api/stockout/list``/vendor-stockout/api/stockout/batches` 的 query/serialization 移入同一個 `services/vendor_stockout_query_service.py`,保留既有 JSON shape`routes/vendor_routes.py` 再降至約 1,565 行。
### 2026-04-28~29Phase 3e 重構大戰 + daily_sales cache 隱形 bug 根除
- **app.py 縮減 -10.8%**: 7,386 → 6,590 行11 commits 全綠零 502。