DVMemoryPayoutLedger class
The payout ledger in memory, for tests and development.
Its checks and writes do not await, so on one isolate nothing interleaves between reading a balance and debiting it.
- Implemented types
Constructors
Properties
-
entries
→ List<
DVPayoutEntry> -
Every entry, oldest first.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
balance(
String accountId, String currency, {bool available = false}) → Future< int> -
The sum of
accountId's entries incurrency; withavailable, leaving out entries of sales on hold.override -
completePayout(
String payoutId, String transferReference) → Future< void> -
override
-
findPayout(
String payoutId) → Future< DVPayoutRecord?> -
override
-
hold(
String saleId, String reason) → Future< void> -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordReversal(
{required String saleId, required String reference, required int amount, required List< DVPayoutEntry> entries(DVPayoutSaleRecord sale, int before)}) → Future<bool?> -
Records a reversal of
amountofsaleIdunderreference, unless one is recorded under it (false).entriesis given the sale and how much was reversed before, and returns the entries. Returns null whenamountis more than is left, recording nothing.override -
recordSale(
DVPayoutSaleRecord sale, List< DVPayoutEntry> credits) → Future<bool> -
Records
saleand itscreditsunless the sale is recorded. False when it is.override -
release(
String saleId) → Future< void> -
override
-
removePayout(
String payoutId) → Future< void> -
override
-
reservePayout(
{required String accountId, required String currency, required String payoutId, required DateTime at}) → Future< DVPayoutReservation> -
Reserves everything available to
accountIdincurrencyas payoutpayoutId, debiting it, as one step with reading the balance. Returns the existing record whenpayoutIdis already reserved.override -
sale(
String saleId) → Future< DVPayoutSaleRecord?> -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited