Wallets — system description
Data model of wallets and their entries, the role of the central wallet service, rules of manual correction, content scope and permission keys.
Overview
List of money balances (wallets): balance, reserved amount and entries (journal) of a client's or user's wallet. A wallet is money, not a quota. Entries are kept by the system's central wallet service (top-up, payment, reservation, reversal, expiry); this module displays them and records manual corrections.
Data model
Table names carry the installation's own prefix in the database.
| Table | Purpose | Main fields |
|---|---|---|
wallet | the wallet | owner type (client or user), owner, currency, balance, reserved amount, status |
wallet_transaction | wallet entry (journal) | event, amount, currency, source type, reference, state, expiry, date, executing user |
company | name and company group of a client owner | filtering and display |
Process
- List: filter by company group, owner type, owner, currency, status; sort by owner, balance or currency; per row balance, reserved, negative flag, number of entries.
- Opening the entries: only for a permitted wallet.
- Manual correction: the correction method of the central service writes with event
MANUAL_ADJUSTMENT, sourcesource_type = manual, the given reference and the executing user; a negative amount goes through only if the balance covers it.
Permissions
- Layer 1: the manual correction does not check modify permission on the path.
- Layer 2:
list,topup(manual credit and debit),debug. The menu item is shown when thelistfunction is assigned. None of the keys is in the function catalogue, so in practice only the super admin gets them. - Layer 3: a non-super user sees only
clientwallets of permitted companies; user wallets are visible only to the super admin; entries and corrections also run only on permitted wallets.
Known limitations
- The manual correction endpoint checks the function permission and the content scope, but not the modify permission of the path.