Test cases: POS & payments
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
Document control
Section titled “Document control”| Version | Date (UTC) | Summary |
|---|---|---|
| 1.0.0 | 2026-05-13 | Initial POS + webhook catalogue |
| 1.1.0 | 2026-05-13 | Expanded tenders, stock, discounts, webhooks, idempotency matrix |
- HTTP:
pos/*,pos/payments/*(POS payments & webhooks). - Rules: CRM customer for membership SKUs;
store_idmandatory on vendor POS HTTP (Point of Sale v2 shell). - UI contract: Vendor orders & checkout · Vendor POS workspace.
Scenario catalogue
Section titled “Scenario catalogue”Place order — core
Section titled “Place order — core”| ID | Class | Scenario | Automation |
|---|---|---|---|
| TC-POS-001 | Happy | Cash tender: place order, stock decrements, response includes receipt payload | Unit + E2E✓ (apps/vendor-web/e2e/pos-place-order-surfaces.spec.ts) |
| TC-POS-002 | Unhappy | Lane required but unset → guard before submit | Unit + E2E* |
| TC-POS-003 | Unhappy | Membership SKU without CRM customer context → rejection | Unit |
| TC-POS-004 | Happy | Walk-in customer + CRM resolution completes membership line | Unit + E2E* |
| TC-POS-005 | Unhappy | Empty cart submit → validation | Unit + E2E* |
| TC-POS-006 | Unhappy | Item quantity exceeds available stock → reject or cap per policy | Unit |
| TC-POS-007 | Happy | Mixed cart: taxable + exempt lines; totals match server | Unit |
Tenders & splits
Section titled “Tenders & splits”| ID | Class | Scenario | Automation |
|---|---|---|---|
| TC-POS-010 | Happy | Card tender initiates relay; await terminal result path | Manual + integration |
| TC-POS-011 | Happy | Split tender cash + card amounts sum to grand total | Manual + E2E* |
| TC-POS-012 | Unhappy | Split amounts do not match total → 400 | Unit |
| TC-POS-013 | Unhappy | Partial authorization then void (PSP-dependent) | Manual |
| TC-POS-014 | Happy | Change given calculated for cash overpay | E2E* |
Discounts & tax
Section titled “Discounts & tax”| ID | Class | Scenario | Automation |
|---|---|---|---|
| TC-POS-020 | Happy | Line-level discount applies; tax recomputed | Unit |
| TC-POS-021 | Unhappy | Coupon expired → remove or block per UX | Unit + E2E* |
| TC-POS-022 | Unhappy | Order-level discount exceeds subtotal guard | Unit |
| TC-POS-023 | Happy | Store default tax from settings applied when line tax absent | Unit |
Webhooks & security
Section titled “Webhooks & security”| ID | Class | Scenario | Automation |
|---|---|---|---|
| TC-POS-030 | Unhappy | Webhook signature invalid → 401/403; body not processed | Unit |
| TC-POS-031 | Happy | Valid webhook updates payment state exactly once | Unit |
| TC-POS-032 | Unhappy | Replay same event id → idempotent no-op (no duplicate ledger) | Unit |
| TC-POS-033 | Unhappy | Unknown event type → logged, no crash | Unit |
| TC-POS-034 | Unhappy | Amount mismatch vs order total → reject or quarantine | Unit |
Capture lifecycle (PSP)
Section titled “Capture lifecycle (PSP)”| ID | Class | Scenario | Automation |
|---|---|---|---|
| TC-POS-040 | Happy | Auth then capture within window | Manual |
| TC-POS-041 | Unhappy | Capture after expiry → failure path | Manual |
| TC-POS-042 | Happy | Partial capture then final capture totals match order | Manual |
| TC-POS-043 | Unhappy | Double capture attempt rejected | Manual |
Ops & resilience
Section titled “Ops & resilience”| ID | Class | Scenario | Automation |
|---|---|---|---|
| TC-POS-050 | Unhappy | DB timeout during place order → transactional rollback; client sees retryable error | Unit |
| TC-POS-051 | Happy | Idempotency-Key header (if API) prevents duplicate order on double POST | Unit |
Coverage checklist (this sheet)
Section titled “Coverage checklist (this sheet)”- Webhook matrix (provider × event type) filled in appendix row or linked runbook
- Bridge failures (timeout, LAN down) reviewed with Shared packages & desktop
- PAX vs CodePay paths: PAX · CodePay
Parent index: System test cases (index)