Transaction Workflows
The accounting system uses immediate posting by default, with exception-based manual review for flagged transactions.
Entry States
| State | Usage | Description |
|---|---|---|
| POSTED | 95%+ of transactions | Immediate, immutable, industry standard |
| PENDING | <5% exceptions | Flagged for review, can be cancelled |
| CANCELLED | Exception flow | Aborted before posting |
| REVERSED | Corrections | Posted entry that was corrected |
Standard Flow (95%+ of transactions)
Transaction Created → POSTED (immediate)
↓
(if correction needed)
↓
REVERSEDDefault Behavior:
- Transactions are POSTED immediately when created
- No delays in transaction completion
- Users receive money instantly
- Matches user expectations
Characteristics:
- Ledger entries immediately immutable
- Cannot be edited or deleted
- Only correctable via reversal
- Audit log entry created instantly
Exception Flow (<5% of transactions)
Flagged Transaction → PENDING → POSTED (after review)
↓
(if rejected)
↓
CANCELLEDException Triggers:
autoPost: falseexplicitly set- AML system flags transaction
- Risk score exceeds threshold
- Manual admin hold
- High-value transactions (e.g., > E10,000)
Characteristics:
- Entries created but not yet immutable
- Can be cancelled without reversal
- Wallet balances already updated
- Appears in review queues
When to Use Each Flow
Standard (autoPost: true - default)
| Scenario | Reason |
|---|---|
| Normal P2P transfers | Low risk, expected behavior |
| Small payments | No compliance concern |
| Topups | Standard operation |
| Most withdrawals | Normal operations |
Exception (autoPost: false)
| Scenario | Reason |
|---|---|
| High-value payments | Compliance review threshold |
| AML flagged transactions | Suspicious activity detected |
| Refund processing | Requires admin approval |
| Manual adjustments | Finance team review |
| First-time user transactions | New user verification |
Posting Service Operations
| Operation | Description |
|---|---|
postEntry() | Manually post a pending entry |
cancelEntry() | Cancel a pending entry |
autoPostPendingEntries() | Auto-post old pending entries |
getEntriesForReview() | Get flagged entries needing review |
reviewEntry() | Approve or reject flagged entry |
Auto-Posting Logic
Daily reconciliation job (2 AM) auto-posts pending entries:
Criteria:
- Entry is PENDING
- Created more than 30 minutes ago
- Not flagged for manual review
- No AML/fraud flags
Review Queues
Transactions flagged for manual review:
| Flag Type | Description |
|---|---|
amlFlagged | AML system flagged |
highValue | Transactions ≥ threshold |
newUser | User registered < 7 days ago |
crossBorder | International transactions |
Immutability
Posted entries are protected at the database level:
- Cannot change status from POSTED back to PENDING
- Cannot modify posted ledger entries
- Any correction requires a reversal entry
Best Practices
- Use autoPost: true for low-value transactions (< E100)
- Use autoPost: false for high-value transactions (≥ E100)
- Flag suspicious transactions for manual review
- Never modify posted entries - use reversals
- Document reversal reasons in the audit trail
- Review pending queue daily to ensure nothing stuck