Test Cases: Tax & Invoice
| Module | CORE-10 | URD | Tax & Invoice URD |
|---|
1. Coverage Summary
| Area | URD reqs | Test cases | Covered |
|---|---|---|---|
Tax Identity (TAX) | 3 | 4 | ✅ |
Tax Groups (GRP) | 4 | 4 | ✅ |
Invoice Configuration (CFG) | 7 | 7 | ✅ |
Invoice Lifecycle (INV) | 9 | 10 | ✅ |
Invoice Request & Buyer Claim (REQ) | 5 | 5 | ✅ |
Issuance Modes (MOD) | 4 | 4 | ✅ |
All Must requirements are covered. Provider-dependent expectations (issuance, tax-authority submission, webhooks) are verified against the current provider set — VNPAY / VNIS via iiapi plus T-VAN.
2. Test Cases
TC-<AREA>-NNNlines up withURD-<AREA>-NNN. Priority = P1 (critical) / P2 (major) / P3 (minor).
2.1 Tax Identity (TAX)
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-TAX-001 | URD-TAX-001 | Register seller tax identity | 1. Owner opens tax settings. 2. Enters MST, business name, address. | The tax identity is saved and used as the seller on issued invoices | P1 |
| TC-TAX-002 | URD-TAX-002 | VN address lookup | 1. Owner enters an address. 2. Picks province then ward. | Province / ward / unit options load and the selection is stored | P2 |
| TC-TAX-003 | URD-TAX-003 | Reject malformed tax code | 1. Owner enters a tax code with letters or the wrong length. | The tax code is rejected with a clear format error | P2 |
| TC-TAX-004 | URD-TAX-003 | Accept valid tax code with leading zeros | 1. Owner enters a valid tax code beginning with zeros. | The code is accepted and the leading zeros are preserved | P3 |
2.2 Tax Groups (GRP)
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-GRP-001 | URD-GRP-001 | Define a tax group | 1. Owner creates a tax group with its rule items. | The tax group is saved and available to apply | P1 |
| TC-GRP-002 | URD-GRP-002 | Provision tax onto products | 1. A tax group matches a product. 2. The product is created/updated. | The correct tax is applied onto the matching product | P1 |
| TC-GRP-003 | URD-GRP-003 | Reconcile on product removal | 1. A product with applied tax is removed. | Its applied tax is reconciled away; no orphaned tax remains | P2 |
| TC-GRP-004 | URD-GRP-004 | Block incompatible tax method | 1. Owner applies a tax group whose method conflicts with the merchant's. | The group is rejected with a method-incompatibility message | P2 |
2.3 Invoice Configuration (CFG)
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-CFG-001 | URD-CFG-001 | Create invoice profile | 1. Owner creates a merchant invoice profile linked to the tax identity. | The profile is saved and active for the merchant | P1 |
| TC-CFG-002 | URD-CFG-002 | Connect provider with encrypted credentials | 1. Owner enters provider credentials and saves. | Credentials are stored encrypted; the provider connection is usable | P1 |
| TC-CFG-003 | URD-CFG-003 | Configure invoice type policy | 1. Owner sets serial, category, tax method, and issuance mode per invoice type. | The configuration is saved and applied to future issuance | P1 |
| TC-CFG-004 | URD-CFG-004 | Route a sale channel | 1. Owner maps a sale channel to a provider config. | The channel issues through the mapped config | P1 |
| TC-CFG-005 | URD-CFG-005 | Reject a second active mapping | 1. A channel already has an active mapping. 2. Owner adds another active one. | The duplicate active mapping is rejected (one active per channel) | P2 |
| TC-CFG-006 | URD-CFG-006 | Share a profile across branches | 1. Owner sets sharing to all-branches / whitelist. | Enrolled branch merchants can use the shared profile | P2 |
| TC-CFG-007 | URD-CFG-007 | Guided onboarding | 1. Owner runs the onboarding wizard end to end. | The provider is configured and ready to issue at the end | P3 |
2.4 Invoice Lifecycle (INV)
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-INV-001 | URD-INV-001 | Queue on payment success | 1. A payment for an order succeeds. | An invoice is queued for issuance | P1 |
| TC-INV-002 | URD-INV-002 | Successful issuance | 1. A queued invoice is processed by the provider. | An invoice number and tax-authority code are recorded; status is success | P1 |
| TC-INV-003 | URD-INV-003 | Status transitions | 1. Track an invoice from queued to issued. | Status moves pending → processing → success without skipping states | P1 |
| TC-INV-004 | URD-INV-004 | Retry on provider failure | 1. The provider returns an error during issuance. | A retry is scheduled per the configured policy | P1 |
| TC-INV-005 | URD-INV-004 | Fail after max retries | 1. Every retry fails up to the configured maximum. | Status becomes failed and the failure is in the audit trail | P2 |
| TC-INV-006 | URD-INV-005 | Submit to tax authority | 1. Submission is enabled. 2. An invoice is issued. | The invoice is submitted to CQT via T-VAN and its response status is tracked | P1 |
| TC-INV-007 | URD-INV-005 | Tax-authority rejection recorded | 1. CQT rejects a submitted invoice. | The rejection reason is recorded against the invoice | P2 |
| TC-INV-008 | URD-INV-006 | Immutable audit trail | 1. An invoice goes through several state changes. | Each event is recorded; existing entries cannot be altered | P1 |
| TC-INV-009 | URD-INV-007, URD-INV-008 | Adjust / cancel issued invoice | 1. Owner adjusts then cancels an issued invoice with a reason. | An adjustment links to the original; the cancellation records its reason | P2 |
| TC-INV-010 | URD-INV-009 | Reject unsigned webhook | 1. An inbound provider webhook arrives with an invalid signature. | The webhook is rejected; no status change is applied | P2 |
2.5 Invoice Request & Buyer Claim (REQ)
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-REQ-001 | URD-REQ-001 | Capture buyer info | 1. Buyer info (name, tax code, address, email) is entered for an invoice. | The buyer details are saved against the invoice request | P1 |
| TC-REQ-002 | URD-REQ-002 | Cashier direct flow | 1. Cashier collects buyer info at the counter and issues. | The invoice is issued with the collected buyer details | P1 |
| TC-REQ-003 | URD-REQ-003 | Claim before deadline | 1. Buyer scans the receipt QR before the deadline and submits info. | The invoice is issued with the buyer's submitted details | P2 |
| TC-REQ-004 | URD-REQ-004 | Claim expires | 1. Buyer opens the claim link after the deadline. | The claim is expired and no invoice is issued | P2 |
| TC-REQ-005 | URD-REQ-005 | Delivery channel | 1. An invoice / claim link is delivered. | It is delivered by the configured channel (receipt QR, email, or SMS) | P3 |
2.6 Issuance Modes (MOD)
| TC ID | URD ref | Scenario | Steps | Expected | P |
|---|---|---|---|---|---|
| TC-MOD-001 | URD-MOD-001 | Real-time issuance | 1. A payment succeeds with real-time mode configured. | The invoice is issued immediately | P1 |
| TC-MOD-002 | URD-MOD-002 | Manual issuance | 1. Cashier triggers issuance for an order on demand. | The invoice is issued when the cashier initiates it | P2 |
| TC-MOD-003 | URD-MOD-003 | Scheduled batch issuance | 1. The scheduled job runs with pending invoices. | The batch is issued by the scheduled job | P2 |
| TC-MOD-004 | URD-MOD-004 | Buyer self-service issuance | 1. Buyer completes a QR claim. | The invoice is issued through the buyer self-service path | P2 |
3. Traceability
Every Must requirement maps to ≥1 test case. No gaps.
| URD requirement | Test case(s) | Status |
|---|---|---|
| URD-TAX-001 | TC-TAX-001 | ✅ Covered |
| URD-TAX-002 | TC-TAX-002 | ✅ Covered |
| URD-TAX-003 | TC-TAX-003, TC-TAX-004 | ✅ Covered |
| URD-GRP-001 | TC-GRP-001 | ✅ Covered |
| URD-GRP-002 | TC-GRP-002 | ✅ Covered |
| URD-GRP-003 | TC-GRP-003 | ✅ Covered |
| URD-GRP-004 | TC-GRP-004 | ✅ Covered |
| URD-CFG-001 | TC-CFG-001 | ✅ Covered |
| URD-CFG-002 | TC-CFG-002 | ✅ Covered |
| URD-CFG-003 | TC-CFG-003 | ✅ Covered |
| URD-CFG-004 | TC-CFG-004 | ✅ Covered |
| URD-CFG-005 | TC-CFG-005 | ✅ Covered |
| URD-CFG-006 | TC-CFG-006 | ✅ Covered |
| URD-CFG-007 | TC-CFG-007 | ✅ Covered |
| URD-INV-001 | TC-INV-001 | ✅ Covered |
| URD-INV-002 | TC-INV-002 | ✅ Covered |
| URD-INV-003 | TC-INV-003 | ✅ Covered |
| URD-INV-004 | TC-INV-004, TC-INV-005 | ✅ Covered |
| URD-INV-005 | TC-INV-006, TC-INV-007 | ✅ Covered |
| URD-INV-006 | TC-INV-008 | ✅ Covered |
| URD-INV-007 | TC-INV-009 | ✅ Covered |
| URD-INV-008 | TC-INV-009 | ✅ Covered |
| URD-INV-009 | TC-INV-010 | ✅ Covered |
| URD-REQ-001 | TC-REQ-001 | ✅ Covered |
| URD-REQ-002 | TC-REQ-002 | ✅ Covered |
| URD-REQ-003 | TC-REQ-003 | ✅ Covered |
| URD-REQ-004 | TC-REQ-004 | ✅ Covered |
| URD-REQ-005 | TC-REQ-005 | ✅ Covered |
| URD-MOD-001 | TC-MOD-001 | ✅ Covered |
| URD-MOD-002 | TC-MOD-002 | ✅ Covered |
| URD-MOD-003 | TC-MOD-003 | ✅ Covered |
| URD-MOD-004 | TC-MOD-004 | ✅ Covered |