Test Cases: Commerce
| Module | CORE-03 | URD | Commerce URD |
|---|
1. Coverage Summary
| Area | URD reqs | Test cases | Covered |
|---|---|---|---|
Organization (ORG) | 13 | 17 | ✅ |
Merchant (MER) | 15 | 17 | ✅ |
Sale Channels (SC) | 7 | 8 | ✅ |
Categories (CAT) | 4 | 5 | ✅ |
Deletion Policy (DEL) | 4 | 3 | ✅ |
Configuration (CFG) | 3 | 0 | ⚠️ |
Access (ACC) | 12 | 13 | ✅ |
Configuration (
CFG) requirements are all Should priority and currently lack dedicated test cases — flagged in §3.
2. Test Cases
TC-<AREA>-NNNlines up withURD-<AREA>-NNN. Priority = P1 (critical) / P2 (major) / P3 (minor).
2.1 Onboarding
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-ORG-001 | URD-ORG-001, URD-ORG-002, URD-MER-001, URD-SC-001 | Happy-path onboarding | 1. Authenticated user with no org. 2. Complete onboarding with valid name + slug | Organization (Activated) + default merchant + default channel created; identifiers auto-generated for all three | P1 |
| TC-ORG-002 | URD-ORG-003 | Creator becomes Owner | 1. New user completes onboarding | User assigned as Owner with full control over the organization and its merchants | P1 |
| TC-ORG-003 | URD-ORG-004 | Onboarding requires name | 1. Attempt onboarding with no business name | Rejected; no org/merchant/channel created | P1 |
| TC-ORG-004 | URD-ORG-001, URD-ORG-002 | Atomic rollback | 1. Org created. 2. Default merchant/channel creation fails | Whole operation rolled back; nothing persisted | P1 |
| TC-ORG-005 | URD-ORG-004 | Slug auto-generated | 1. Onboard with name but no slug | Slug generated from name and is unique | P2 |
| TC-ORG-006 | URD-ORG-001 | One org per user | 1. User already has an org. 2. Attempt onboarding again | Rejected; error indicates org already exists | P2 |
2.2 Organization
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-ORG-007 | URD-ORG-004 | Create with optional fields empty | 1. Create org with name + slug only | Created; optional fields (tax, registration, contact, address) null | P1 |
| TC-ORG-008 | URD-ORG-004 | Multilingual name | 1. Provide name in EN + VI | All language versions stored and retrievable | P1 |
| TC-ORG-009 | URD-ORG-005 | System identifier | 1. Create org | Unique system identifier assigned, not user-editable | P1 |
| TC-ORG-010 | URD-ORG-007 | View details | 1. Owner/Admin views org | All info returned incl. status and identifier | P1 |
| TC-ORG-011 | URD-ORG-007 | Update profile | 1. Owner updates tax/contact/address | Updated; modifier tracked; merchants unaffected | P1 |
| TC-ORG-012 | URD-ORG-007 | Reject empty name | 1. Owner sets name empty | Rejected; original data preserved | P2 |
| TC-ORG-013 | URD-ORG-006 | Lookup by ID and slug | 1. Search by ID. 2. Search by slug | Org returned in both cases | P1 |
| TC-ORG-014 | URD-ORG-006 | Lookup not found | 1. Search by non-existent ID | Not found | P2 |
| TC-ORG-015 | URD-ORG-005 | Slug global uniqueness | 1. Org uses slug "x". 2. Another user tries "x" | Rejected; slug in use | P1 |
| TC-ORG-016 | URD-ORG-010 | Deactivate | 1. Owner deactivates active org | Status Deactivated; data preserved; reversible | P2 |
| TC-ORG-017 | URD-ORG-012 | Archive | 1. Owner archives org | Status Archived; data preserved; hidden from active lists | P2 |
| TC-ORG-018 | URD-ORG-011 | Headquarter merchant | 1. Owner designates a HQ merchant | Primary merchant referenced on org | P2 |
| TC-ORG-019 | URD-ORG-013 | Child organization | 1. Owner creates child org under parent | Child references parent; parent shows children | P3 |
2.3 Merchant
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-MER-001 | URD-MER-001 | Default merchant on onboarding | 1. Onboarding completes | Default merchant Activated with a default channel; identifiers generated | P1 |
| TC-MER-002 | URD-MER-002 | Create additional merchant | 1. Owner creates merchant with name/type/currency | Created and linked; org now has 2 merchants | P1 |
| TC-MER-003 | URD-MER-002 | Reject missing name | 1. Create merchant with no name | Rejected; name required | P2 |
| TC-MER-004 | URD-MER-003 | Batch create | 1. Owner batch-creates 3 merchants | All 3 created with unique identifiers/slugs, same org | P1 |
| TC-MER-005 | URD-MER-004, URD-CAT-001, URD-SC-002 | Aggregate create | 1. Create merchant with 2 categories + 2 channels | All created and linked atomically; identifiers generated | P1 |
| TC-MER-006 | URD-MER-004 | Aggregate create rollback | 1. Aggregate create with invalid category | Whole operation rejected; nothing created | P1 |
| TC-MER-007 | URD-MER-005 | Slug per-org uniqueness | 1. Two different orgs both create slug "store-a" | Both succeed; uniqueness scoped to org | P1 |
| TC-MER-008 | URD-MER-005 | Duplicate slug in same org | 1. Create second merchant with existing slug in same org | Rejected; slug in use within org | P1 |
| TC-MER-009 | URD-MER-006 | View merchant | 1. Owner/Admin views merchant | Name/type/currency/status returned; channels & categories accessible | P1 |
| TC-MER-010 | URD-MER-007 | Update merchant | 1. Owner updates name + currency | Updated; modifier tracked; channels/categories unaffected | P1 |
| TC-MER-011 | URD-MER-008, URD-CAT-002, URD-CAT-003, URD-SC-003 | Aggregate update mixed ops | 1. Rename a category. 2. Add a category. 3. Delete a channel. 4. Add a channel | All applied atomically | P1 |
| TC-MER-012 | URD-MER-008 | Smart-update key convention | 1. Child {id} only. 2. Child | First deleted; second updated | P1 |
| TC-MER-013 | URD-MER-015 | Explicit delete flag | 1. Aggregate update with explicit delete flag on a category | Category deleted; sending ID without delete flag does NOT delete | P1 |
| TC-MER-014 | URD-MER-008 | Aggregate update rollback | 1. Valid name change + invalid channel | Whole update fails; original data preserved | P1 |
| TC-MER-015 | URD-MER-009 | Lookup by ID and slug | 1. Search by ID. 2. Search by slug | Merchant returned in both cases | P1 |
| TC-MER-016 | URD-MER-012 | Deactivate / reactivate | 1. Deactivate then reactivate | Status transitions; channels/categories intact | P2 |
| TC-MER-017 | URD-MER-014 | Merchant hierarchy | 1. Create child merchant under parent | Child references parent; parent shows children | P3 |
2.4 Sale Channels
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-SC-001 | URD-SC-001 | Default channel on onboarding | 1. Onboarding completes | Default channel Activated under default merchant; identifier generated | P1 |
| TC-SC-002 | URD-SC-002 | Channels via aggregate create | 1. Create merchant with 2 channels | Both created/linked; accessible on merchant | P1 |
| TC-SC-003 | URD-SC-003 | Batch-add to existing merchant | 1. Add multiple channels to an existing merchant | All created and linked | P1 |
| TC-SC-004 | URD-SC-002 | Rename via aggregate update | 1. Rename one channel | Renamed; other channels unchanged | P2 |
| TC-SC-005 | URD-SC-004 | Duplicate slug in merchant | 1. Create channel with existing slug in same merchant | Rejected; slug in use within merchant | P1 |
| TC-SC-006 | URD-SC-004 | Slug per-merchant uniqueness | 1. Two merchants both use channel slug "counter" | Both succeed; uniqueness scoped to merchant | P2 |
| TC-SC-007 | URD-SC-005 | Channel identifier | 1. Create channel | Unique system identifier, not editable | P2 |
| TC-SC-008 | URD-SC-006 | Channel hierarchy | 1. Create child channel under parent | Child references parent; parent shows children | P3 |
2.5 Categories
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-CAT-001 | URD-CAT-001 | Categories via aggregate create | 1. Create merchant with 2 categories | Both created/linked; accessible on merchant | P1 |
| TC-CAT-002 | URD-CAT-002 | Rename category | 1. Aggregate update renames a category | Renamed; products under it unaffected | P1 |
| TC-CAT-003 | URD-CAT-003 | Delete category | 1. Aggregate update deletes a category | Soft-deleted; other categories unchanged | P1 |
| TC-CAT-004 | URD-CAT-004 | Mark add-on | 1. Mark a category as add-on | Flagged; its products treated as add-ons | P2 |
| TC-CAT-005 | URD-CAT-004 | Un-mark add-on | 1. Remove add-on flag | No longer add-on; products revert | P2 |
2.6 Deletion Policy
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-DEL-001 | URD-DEL-001, URD-DEL-004 | View / update policy | 1. Owner views then updates deletion policy | Current values returned; update persisted | P2 |
| TC-DEL-002 | URD-DEL-002 | Strict category deletion | 1. strictCategoryDeletion true. 2. Delete category with products | Blocked | P2 |
| TC-DEL-003 | URD-DEL-003 | Cascade product deletion | 1. cascadeProductDeletion true. 2. Delete category | Its products also deleted | P2 |
2.7 Access
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-ACC-001 | URD-ACC-001 | Org-level assignment | 1. Owner assigns employee at org level | Employee can access all merchants under the org | P1 |
| TC-ACC-002 | URD-ACC-002 | Merchant-level assignment | 1. Owner assigns employee to Merchant A only | Employee accesses A, not B | P1 |
| TC-ACC-003 | URD-ACC-002 | Multi-merchant assignment | 1. Employee assigned to A and C | Accesses A and C, not B | P1 |
| TC-ACC-004 | URD-ACC-003 | Multi-org access | 1. User granted access to Orgs X and Y | Sees data from both orgs | P1 |
| TC-ACC-005 | URD-ACC-004 | Owner data isolation | 1. Owner A requests data | Only Org X visible; Org Y hidden | P1 |
| TC-ACC-006 | URD-ACC-005 | Role-filtered list & count | 1. Admin/Owner/Employee each request list and count | Admin all; Owner own; Employee assigned; count matches list | P1 |
| TC-ACC-007 | URD-ACC-006 | Owner org capabilities | 1. Owner creates/views/updates org | All succeed; changes tracked | P1 |
| TC-ACC-008 | URD-ACC-007 | Owner merchant capabilities | 1. Owner creates, updates, deactivates merchant | All succeed; status transitions | P1 |
| TC-ACC-009 | URD-ACC-008 | Owner channel/category management | 1. Owner creates/updates/deletes channels & categories via aggregate | All reflected on merchant | P1 |
| TC-ACC-010 | URD-ACC-009 | Assign employee to merchant | 1. Owner assigns employee to a merchant | Mapping created; employee scoped to that merchant | P1 |
| TC-ACC-011 | URD-ACC-010 | Employee merchant list | 1. Employee assigned to X requests list | Only X returned | P1 |
| TC-ACC-012 | URD-ACC-011 | Employee denied unassigned | 1. Employee accesses Merchant Y | Access denied | P1 |
| TC-ACC-013 | URD-ACC-012 | Unrecognized role | 1. User with unhandled role requests list | Denied (403 or explicit insufficient-permission) — never a silent empty list | P1 |
QE Assessment Finding
The role-based switch default branch in the organizer/merchant controllers historically returned empty data with no error — indistinguishable from "no data". TC-ACC-013 guards against this silent failure.
QE Assessment Finding
The aggregate-update "single-key means delete" convention (a child sent as { id } only) is brittle: a client intending to leave a record unchanged would trigger a delete. TC-MER-013 mandates an explicit delete flag instead.
3. Traceability
Every Must requirement maps to ≥1 test case. Gaps are flagged.
| URD requirement | Test case(s) | Status |
|---|---|---|
| URD-ORG-001 | TC-ORG-001, TC-ORG-004, TC-ORG-006 | ✅ Covered |
| URD-ORG-002 | TC-ORG-001, TC-ORG-004 | ✅ Covered |
| URD-ORG-003 | TC-ORG-002 | ✅ Covered |
| URD-ORG-004 | TC-ORG-003, TC-ORG-005, TC-ORG-007, TC-ORG-008, TC-ORG-012 | ✅ Covered |
| URD-ORG-005 | TC-ORG-009, TC-ORG-015 | ✅ Covered |
| URD-ORG-006 | TC-ORG-013, TC-ORG-014 | ✅ Covered |
| URD-ORG-007 | TC-ORG-010, TC-ORG-011 | ✅ Covered |
| URD-ORG-008 | — | ⚠️ Uncovered (file attachments) |
| URD-ORG-009 | TC-ACC-006 | ✅ Covered |
| URD-ORG-010 | TC-ORG-016 | ✅ Covered |
| URD-ORG-011 | TC-ORG-018 | ✅ Covered |
| URD-ORG-012 | TC-ORG-017 | ✅ Covered |
| URD-ORG-013 | TC-ORG-019 | ✅ Covered |
| URD-MER-001 | TC-MER-001, TC-ORG-001 | ✅ Covered |
| URD-MER-002 | TC-MER-002, TC-MER-003 | ✅ Covered |
| URD-MER-003 | TC-MER-004 | ✅ Covered |
| URD-MER-004 | TC-MER-005, TC-MER-006 | ✅ Covered |
| URD-MER-005 | TC-MER-007, TC-MER-008 | ✅ Covered |
| URD-MER-006 | TC-MER-009 | ✅ Covered |
| URD-MER-007 | TC-MER-010 | ✅ Covered |
| URD-MER-008 | TC-MER-011, TC-MER-012, TC-MER-014 | ✅ Covered |
| URD-MER-009 | TC-MER-015 | ✅ Covered |
| URD-MER-010 | TC-ACC-006, TC-ACC-011 | ✅ Covered |
| URD-MER-011 | TC-ACC-006 | ✅ Covered |
| URD-MER-012 | TC-MER-016 | ✅ Covered |
| URD-MER-013 | TC-ORG-017 (shared lifecycle) | ✅ Covered |
| URD-MER-014 | TC-MER-017 | ✅ Covered |
| URD-MER-015 | TC-MER-013 | ✅ Covered |
| URD-SC-001 | TC-SC-001, TC-ORG-001 | ✅ Covered |
| URD-SC-002 | TC-SC-002, TC-SC-004 | ✅ Covered |
| URD-SC-003 | TC-SC-003 | ✅ Covered |
| URD-SC-004 | TC-SC-005, TC-SC-006 | ✅ Covered |
| URD-SC-005 | TC-SC-007 | ✅ Covered |
| URD-SC-006 | TC-SC-008 | ✅ Covered |
| URD-SC-007 | TC-MER-011 (channel delete) | ✅ Covered |
| URD-CAT-001 | TC-CAT-001, TC-MER-005 | ✅ Covered |
| URD-CAT-002 | TC-CAT-002 | ✅ Covered |
| URD-CAT-003 | TC-CAT-003 | ✅ Covered |
| URD-CAT-004 | TC-CAT-004, TC-CAT-005 | ✅ Covered |
| URD-DEL-001 | TC-DEL-001 | ✅ Covered |
| URD-DEL-002 | TC-DEL-002 | ✅ Covered |
| URD-DEL-003 | TC-DEL-003 | ✅ Covered |
| URD-DEL-004 | TC-DEL-001 | ✅ Covered |
| URD-CFG-001 | — | ⚠️ Uncovered (Should) |
| URD-CFG-002 | — | ⚠️ Uncovered (Should) |
| URD-CFG-003 | — | ⚠️ Uncovered (Should) |
| URD-ACC-001 | TC-ACC-001, TC-ACC-002 | ✅ Covered |
| URD-ACC-002 | TC-ACC-002, TC-ACC-003 | ✅ Covered |
| URD-ACC-003 | TC-ACC-004 | ✅ Covered |
| URD-ACC-004 | TC-ACC-005 | ✅ Covered |
| URD-ACC-005 | TC-ACC-006, TC-ACC-013 | ✅ Covered |
| URD-ACC-006 | TC-ACC-007 | ✅ Covered |
| URD-ACC-007 | TC-ACC-008 | ✅ Covered |
| URD-ACC-008 | TC-ACC-009 | ✅ Covered |
| URD-ACC-009 | TC-ACC-010 | ✅ Covered |
| URD-ACC-010 | TC-ACC-011 | ✅ Covered |
| URD-ACC-011 | TC-ACC-012 | ✅ Covered |
| URD-ACC-012 | TC-ACC-013 | ✅ Covered |
Gaps: URD-ORG-008 (file attachments, Must) and URD-CFG-001..003 (Should) have no dedicated test cases yet.