DVMemoryPromotionLedger class

Redemptions in memory, for tests and development.

redeem does not await, so on one isolate the check and the record cannot be interleaved.

Implemented types

Constructors

DVMemoryPromotionLedger()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redeem(DVPromotion promotion, {required String customerKey, required String orderId, required DateTime at}) → Future<DVRedeemOutcome>
Records that orderId redeems promotion for customerKey, unless a limit is reached -- the check and the record as one step.
override
redeemed(String promotionId) → Future<int>
Redemptions of promotionId by everybody.
override
redeemedBy(String promotionId, String customerKey) → Future<int>
Redemptions of promotionId by customerKey.
override
redeemedFor(String promotionId, String orderId) → Future<bool>
Whether orderId holds a redemption of promotionId.
override
release(String promotionId, String orderId) → Future<void>
Gives back orderId's redemption of promotionId, if it holds one.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited