[FEAT] 銷售訂單管理:補齊欄位、即時搜尋、篩選與來源自動判定

This commit is contained in:
2026-03-19 15:00:33 +08:00
parent 0b4aeacb55
commit 60f5f00a9e
11 changed files with 269 additions and 63 deletions

View File

@@ -231,8 +231,11 @@ Star ERP 系統提供外部整合 API (Integration API) 供電商前台、POS
| 欄位名稱 | 型態 | 必填 | 說明 |
| :--- | :--- | :---: | :--- |
| `external_order_id` | String | **是** | 第三方系統中的唯一訂單編號,不可重複 (Unique) |
| `name` | String | **是** | 訂單名稱或客戶名稱 (最多 255 字元) |
| `warehouse_code` | String | **是** | 指定扣除庫存的倉庫代碼 (例如:`api-test-01` 測試倉)。若找不到對應倉庫將直接拒絕請求 |
| `payment_method` | String | 否 | 付款方式,僅接受:`cash`, `credit_card`, `line_pay`, `ecpay`, `transfer`, `other`。預設為 `cash` |
| `total_amount` | Number | **是** | 整筆訂單的總交易金額 (例如500) |
| `total_qty` | Number | **是** | 整筆訂單的商品總數量 (例如5) |
| `sold_at` | String(Date) | 否 | 交易發生時間,預設為當下時間 (格式: YYYY-MM-DD HH:mm:ss) |
| `items` | Array | **是** | 訂單明細陣列,至少需包含一筆商品 |
@@ -250,10 +253,13 @@ Star ERP 系統提供外部整合 API (Integration API) 供電商前台、POS
**請求範例:**
```json
{
"external_order_id": "ORD-20240320-0001",
"warehouse_code": "api-test-01",
"external_order_id": "ORD-20231024-001",
"name": "陳小明-干貝醬訂購",
"warehouse_code": "STORE-01",
"payment_method": "credit_card",
"sold_at": "2024-03-20 14:30:00",
"total_amount": 1050,
"total_qty": 3,
"sold_at": "2023-10-24 15:30:00",
"items": [
{
"product_id": 15,