Skip to content

Test Cases: Expenses

ModuleCORE-12URDExpenses URD

Status honesty: automatic posting (P1) is verified in code. Account management, the manual draft→issue lifecycle, transfers, and several safeguards (amount validation, transaction-level access control, shift cash movements) are partially built or pending. Cases for those areas are marked accordingly and called out in §3 Traceability.

1. Coverage Summary

AreaURD reqsTest casesCovered
Accounts (WAL)66⚠️ partial
Vouchers & posting (VCH)1212⚠️ partial
Ledger lines (TXN)44
Categories (CAT)44

2. Test Cases

TC-<AREA>-NNN lines up with URD-<AREA>-NNN. Priority = P1 (critical) / P2 (major) / P3 (minor).

2.1 Accounts (WAL)

TC IDURD refScenarioStepsExpectedP
TC-WAL-001URD-WAL-001Create accounts of each type1. Create a Cash, Bank, QR, and Mobile-POS accountAll four accounts exist, owned by the merchantP1
TC-WAL-002URD-WAL-002One default per type1. Mark a Bank account as default 2. Mark a second Bank account as defaultOnly one Bank account stays default for the merchantP1
TC-WAL-003URD-WAL-003New merchant gets accounts1. Create a new merchantDefault accounts plus internal Inventory and Cost-of-Goods-Sold accounts are seededP1
TC-WAL-004URD-WAL-004Balance moves with postings1. Note an account balance 2. Issue a receipt voucher to itBalance increases by the voucher amountP1
TC-WAL-005URD-WAL-005Account currency1. Create an account without specifying currencyAccount currency defaults to VNDP3
TC-WAL-006URD-WAL-006Merchant-scoped visibility1. As an owner of Merchant B, list accountsOnly Merchant B's accounts are returned; Merchant A's are notP1

2.2 Vouchers & posting (VCH)

TC IDURD refScenarioStepsExpectedP
TC-VCH-001URD-VCH-001Voucher types1. Issue a receipt, a payment, a transfer, and an adjustmentAll four voucher types are recordedP1
TC-VCH-002URD-VCH-002Balanced voucher1. Issue a transfer voucherTotal debit equals total creditP1
TC-VCH-003URD-VCH-003Auto receipt on paid sale1. Pay a sale orderA receipt voucher is issued, classified Sale, linked to the order; account balance upP1
TC-VCH-004URD-VCH-004Auto payment on PO receipt1. Receive a purchase orderA payment voucher is issued to the vendor, linked to the POP1
TC-VCH-005URD-VCH-005Auto stock posting1. Sell stock (cost basis > 0) 2. Adjust stockCost-of-goods and adjustment vouchers post to internal control accountsP1
TC-VCH-006URD-VCH-006Idempotent re-delivery1. Replay the same sale-payment eventNo duplicate voucher is createdP1
TC-VCH-007URD-VCH-007Source linkage1. Inspect an auto-issued voucherIt references its source document (sale order / PO / stock movement)P1
TC-VCH-008URD-VCH-008Voucher numbering1. Issue several vouchers of one type in a monthEach gets a sequential number per merchant/type/monthP2
TC-VCH-009URD-VCH-009Draft then issue1. Create a draft voucher 2. Approve/issue itDraft becomes issued; a draft can be deleted before issueP2
TC-VCH-010URD-VCH-010Transfer between accounts1. Transfer amount A → BA goes down, B goes up by the same amount; one balanced transfer voucherP2
TC-VCH-011URD-VCH-011Void by reversal1. Void an issued voucherA balanced reversal posts; original preserved; balances restoredP2
TC-VCH-012URD-VCH-012Shift attribution1. Record a pay-in/out against a POS sessionVoucher is attributed to the shift sessionP3

2.3 Ledger lines (TXN)

TC IDURD refScenarioStepsExpectedP
TC-TXN-001URD-TXN-001Debit/credit lines1. Inspect a voucher's linesLines are debit or credit against accountsP1
TC-TXN-002URD-TXN-002Line carries balance snapshot1. Inspect a posted lineIt carries account, optional category, amount, and balance-before/afterP1
TC-TXN-003URD-TXN-003Currency consistency1. Inspect a voucher's linesAll lines share the voucher's currencyP2
TC-TXN-004URD-TXN-004Line source reference1. Inspect an auto-posted lineIt references its source documentP3

2.4 Categories (CAT)

TC IDURD refScenarioStepsExpectedP
TC-CAT-001URD-CAT-001Seeded categories1. List system categories14 seeded categories exist across income and expenseP1
TC-CAT-002URD-CAT-002Category typing1. Inspect categoriesEach is typed income or expenseP1
TC-CAT-003URD-CAT-003Auto category on auto voucher1. Pay a sale 2. Receive a POReceipt is classified Sale; PO payment uses the Purchase categoryP1
TC-CAT-004URD-CAT-004Custom child category1. Add a custom category under a parentCustom category is created, nested under the parent, scoped to the merchantP2

3. Traceability

Every Must requirement must map to ≥1 test case. Status reflects what is verified in code today versus pending.

URD requirementTest case(s)Status
URD-WAL-001TC-WAL-001⚠️ Account types verified in model; create-UI emerging
URD-WAL-002TC-WAL-002✅ Covered (unique default index)
URD-WAL-003TC-WAL-003✅ Covered (merchant-CDC reconciliation)
URD-WAL-004TC-WAL-004✅ Covered (balance maintained per posting)
URD-WAL-005TC-WAL-005✅ Covered (currency defaults to VND)
URD-WAL-006TC-WAL-006⚠️ Enforced on accounts; transactions/categories controllers less restricted
URD-VCH-001TC-VCH-001✅ Covered
URD-VCH-002TC-VCH-002✅ Covered (balance assertion, 1e-4 tolerance)
URD-VCH-003TC-VCH-003✅ Covered
URD-VCH-004TC-VCH-004✅ Covered
URD-VCH-005TC-VCH-005✅ Covered
URD-VCH-006TC-VCH-006✅ Covered (per-event / per-source dedup indexes)
URD-VCH-007TC-VCH-007✅ Covered
URD-VCH-008TC-VCH-008✅ Covered (per merchant/type/month sequence)
URD-VCH-009TC-VCH-009⚠️ Engine supports draft→issue; merchant UI emerging
URD-VCH-010TC-VCH-010⚠️ Transfer voucher type supported; transfer UI emerging
URD-VCH-011TC-VCH-011✅ Covered (void = balanced reversal)
URD-VCH-012TC-VCH-012⚠️ Pending — shift cash movements not yet wired
URD-TXN-001TC-TXN-001✅ Covered
URD-TXN-002TC-TXN-002✅ Covered
URD-TXN-003TC-TXN-003✅ Covered
URD-TXN-004TC-TXN-004✅ Covered
URD-CAT-001TC-CAT-001✅ Covered (14 seeded)
URD-CAT-002TC-CAT-002✅ Covered
URD-CAT-003TC-CAT-003✅ Covered
URD-CAT-004TC-CAT-004✅ Covered

Known limitations (from QE assessment)

Verified against code; folded here instead of being described as shipped behavior.

AreaGap
Amount validationThe ledger does not constrain amount sign/zero at the persistence layer; UI-level validation is the safeguard
Access control depthAccount listing is merchant-scoped; transaction and category endpoints are less restricted than accounts
Shift cash movementsPay-in / pay-out / safe-drop attribution (URD-VCH-012) is not yet wired end to end
Status-history auditVoucher lifecycle has issue/void audit fields, but a full status-change history table is not provided

The older module test-cases described a "Draft → Finalized → Voided expense" lifecycle and URD-ENT/LIF/REC/AUD requirement codes that never matched the built finance model. Those have been retired in favour of the verified accounts / vouchers / ledger / categories model above.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.