跳至主要内容

Scenario 3: 組合搜尋與過濾(企業客戶 + 日期範圍)

User Story: US-302: 客戶列表與搜尋

When: 執行操作

API 請求

GET /api/v1/customers?type=corporate&registeredDateFrom=2025-10-01&registeredDateTo=2025-10-31&page=1&limit=20
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Then: 預期結果

{
"customers": [
{
"customerNumber": "ABC-CUST-000003",
"type": "corporate",
"companyName": "XX 科技公司",
"tier": "vvip",
"createdAt": "2025-10-15T10:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"totalPages": 1,
"totalItems": 1
}
}

業務規則驗證

  • ✅ 僅返回 type = "corporate" 的客戶
  • ✅ 註冊日期在 2025-10-01 ~ 2025-10-31 範圍內
  • ✅ 不包含個人客戶或其他日期的客戶

相關場景