Skip to content

Domain model (the double-entry foundation)

Ported faithfully from Tonder's glossary — it is rail- and storage-agnostic and is the heart of correctness.

Account types

Standard double-entry. Sign rules:

Account typeDEBITCREDIT
ASSET+
EXPENSE+
LIABILITY+
REVENUE+
EQUITY+

REVERSAL inverts the sign regardless of type.

Entity types

ValueVecnet meaningKey prefix
BUSINESSVecnet client / merchant (e.g. the government entity / operator)ENT#{entity_id}
ACQUIRERA rail: tonder, menta, …ACQ#{acquirer}
PLATFORMVecnet itselfENT#V1

Account codes

Each code implies a canonical account_type and entity_type.

CodeTypeEntityPurpose
ACQUIRER_RECEIVABLEASSETACQUIRERFunds receivable from a rail after capture
BUSINESS_PAYABLELIABILITYBUSINESSNet owed to the merchant after fees
PLATFORM_CLEARINGLIABILITYPLATFORMTemporary platform-fee clearing
WITHDRAWAL_FUNDSASSETACQUIRERFunds held at a rail to settle withdrawals
BUSINESS_WITHDRAWAL_PAYABLELIABILITYBUSINESSWithdrawal amount owed to merchant
PROCESSING_FEES_REVENUEREVENUEPLATFORMRevenue from payin fees
WITHDRAWAL_FEES_REVENUEREVENUEPLATFORMRevenue from withdrawal fees
ACQUIRER_FEES_EXPENSEEXPENSEPLATFORMPayin fees charged by the rail
WITHDRAWAL_ACQUIRER_FEES_EXPENSEEXPENSEPLATFORMWithdrawal fees charged by the rail
WITHDRAWAL_ACQUIRER_FEES_PAYABLELIABILITYACQUIREROwed to a rail for withdrawal fees
VAT_PAYABLELIABILITYPLATFORMIVA collected, to remit
VAT_RECEIVABLEASSETPLATFORMIVA paid to rails, reclaimable
RESERVE_RECEIVABLEASSETACQUIRERRolling reserve a rail holds for the platform
RESERVE_PAYABLELIABILITYBUSINESSMerchant balance held as rolling reserve
BANKASSETPLATFORMBank settlement account
BUSINESS_SETTLEMENT_PENDINGLIABILITYBUSINESSFunds pending settlement disbursement
PRIOR_PERIOD_ADJUSTMENTEQUITYPLATFORMContra for historical loads / prior-period fixes

INFO

PLATFORM_CASH from Tonder is reserved/unused — omit it; use BANK for platform cash.

Entity → account-code map

Journals

Every transaction produces journals. journal_type ∈ {IN (rail side), OUT (business side)}.

journal_category:

  • IN + OUT pair: PAYMENT, VOID, REFUND, DISPUTE_WON, DISPUTE_IN_REVIEW, WITHDRAWAL, TOPUP.
  • Single journal: SETTLEMENT_APPROVE, SETTLEMENT_CONFIRM, ROUTING, ROLLING_RESERVE_RELEASE, ADJUSTMENT.

Other enums (port verbatim)

  • entry_type: DEBIT, CREDIT.
  • transaction_type: PAYMENT, PAYOUT, REFUND, DISPUTE, WITHDRAWAL, VOID.
  • transfer_typeadjustment_type mapping (internal transfers — see Internal transfers).
  • adjustment_type: full taxonomy — see the appendix.
  • fee_rule_status: active / inactive.
  • transaction_status: Success, PAID_FULL, Won, Needs Response, In Review, Liquidado, Lost.
  • Module flags: FEES_CALCULATION, LEDGER_ENTRIES, DAILY_BALANCES, JOURNALS_GENERATION (see Config flags).

Rail / detail-type note

Tonder's DetailType / EventBridge taxonomy is AWS-specific. Vecnet's Listener normalizes each rail notification into a clean internal transaction_event (orchestrator). Keep the semantic categories; drop the EventBridge naming.

Vecnet — Build Spec v0.2 · Obsidian Terminal