跳至主要内容

SBE Scenario 1: 查看待確認訂單列表

場景描述

店員進入店員工作台,查看所有待確認的訂單,訂單按配送日期排序顯示。


Given(前置條件)

系統狀態

  • 當前日期: 2025-12-01
  • 當前租戶: ABC (ABC 花店)
  • 已登入用戶: 張店員 (ROLE_SALES)

測試資料

現有訂單列表

[
{
"orderId": "ABC-20251201-0003",
"orderNumber": "ABC-20251201-0003",
"tenantId": "ABC",
"status": "pending_confirmation",
"customer": {
"name": "陳小美",
"phone": "0933-456-789"
},
"deliveryDate": "2025-12-03",
"totalAmount": 2800,
"createdAt": "2025-12-01T11:00:00Z"
},
{
"orderId": "ABC-20251201-0001",
"orderNumber": "ABC-20251201-0001",
"tenantId": "ABC",
"status": "pending_confirmation",
"customer": {
"name": "李大華",
"phone": "0912-345-678"
},
"deliveryDate": "2025-12-02",
"totalAmount": 2520,
"createdAt": "2025-12-01T09:00:00Z"
},
{
"orderId": "ABC-20251201-0002",
"orderNumber": "ABC-20251201-0002",
"tenantId": "ABC",
"status": "confirmed",
"customer": {
"name": "王小明"
},
"deliveryDate": "2025-12-04",
"totalAmount": 1500,
"createdAt": "2025-12-01T10:00:00Z"
}
]

When(執行操作)

步驟 1: 進入店員工作台

  • 店員在 Application Launcher 中點擊「Sales Workbench」
  • 系統導航至 /sales

Then(預期結果)

API 請求

端點: GET /api/v1/orders?status=pending_confirmation&sort=deliveryDate:asc

Response Body (200 OK)

{
"data": [
{
"orderId": "ABC-20251201-0001",
"orderNumber": "ABC-20251201-0001",
"status": "pending_confirmation",
"customer": {
"name": "李大華",
"phone": "0912-345-678"
},
"deliveryDate": "2025-12-02",
"totalAmount": 2520
},
{
"orderId": "ABC-20251201-0003",
"orderNumber": "ABC-20251201-0003",
"status": "pending_confirmation",
"customer": {
"name": "陳小美",
"phone": "0933-456-789"
},
"deliveryDate": "2025-12-03",
"totalAmount": 2800
}
],
"total": 2
}

UI 顯示

1. 頁面標題

[ClipboardCheck] 店員工作台 [Badge: 2]    [新增訂單] [刷新]

2. 訂單列表(按配送日期升序)

┌─ 待確認 (Pending Confirmation) ─────────────────────┐
│ │
│ ┌───────────────────────────────────────────────┐ │
│ │ 訂單 #ABC-20251201-0001 │ │
│ │ 客戶: 李大華 │ │
│ │ 配送日: 2025/12/02 │ │
│ │ 金額: NT$2,520 [確認訂單] │ │
│ └───────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────┐ │
│ │ 訂單 #ABC-20251201-0003 │ │
│ │ 客戶: 陳小美 │ │
│ │ 配送日: 2025/12/03 │ │
│ │ 金額: NT$2,800 [確認訂單] │ │
│ └───────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────┘

3. 過濾結果

  • 僅顯示 pending_confirmation 狀態的訂單
  • 不顯示 confirmed 狀態的訂單(ABC-20251201-0002)

4. 排序結果

  • 訂單 ABC-20251201-0001(配送日 12/02)排在第一位
  • 訂單 ABC-20251201-0003(配送日 12/03)排在第二位

驗證檢查清單

資料過濾

  • 僅顯示 pending_confirmation 狀態的訂單
  • 不顯示其他狀態的訂單

資料排序

  • 按配送日期升序排列
  • 最緊急的訂單優先顯示

UI 顯示

  • 頁面標題顯示正確
  • Badge 顯示正確的待處理數量
  • 每張卡片顯示訂單編號、客戶、配送日、金額
  • 「確認訂單」按鈕可見

最後更新: 2025-12-19