multivendor-wallet
v0.0.9
Published
Install-and-use wallet plugin with ledger engine, TypeORM store, lifecycle hooks, and HTTP routes for multi-vendor marketplaces
Maintainers
Readme
multivendor-wallet
Framework-agnostic wallet ledger engine for multi-vendor marketplaces.
Changelog
0.0.7
onOrderPaidcustomer debit is capped atorderTotalRupeeswhenwalletAmountRupeesover-reports.
0.0.6
- Customer checkout debit uses canonical key
wallet:order:{orderId}:customer_debitandmetadata.purpose=customer_checkout_debit. A second debit for the same order is a no-op (lock-then-lookup + unique generated column). - Unique-index migration
AddOrderCustomerDebitUniquethrows before DDL unless backfill sentinelcustomer_checkout_debit_backfillis complete and unreimbursed twin COUNT is 0. Runnpm run wallet:credit-duplicate-order-debitson the host before migrate. - Ledger
created_dateis written as server-local wall clock (not UTCtoISOString()). Existing UTC-naive rows stay as stored. onDuplicateOrderDebitplugin callback for idempotent retry vs cross-key collision.
Operations
credit/debit— adjust available balance (integer minor units / paise)hold/release/cancelHold— escrow lifecycletransfer— atomic debit + creditgetBalance—{ available, held, total }wheretotal = available + held
Host integration
Implement IWalletStore with your persistence layer (TypeORM adapter ships in Myownbazaar_server). Pass { nativeTx: entityManager } to join an existing database transaction.
Publish
pnpm run build && pnpm run test
# tag: wallet-v0.0.1