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
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
orderIdredeemspromotionforcustomerKey, unless a limit is reached -- the check and the record as one step.override -
redeemed(
String promotionId) → Future< int> -
Redemptions of
promotionIdby everybody.override -
redeemedBy(
String promotionId, String customerKey) → Future< int> -
Redemptions of
promotionIdbycustomerKey.override -
redeemedFor(
String promotionId, String orderId) → Future< bool> -
Whether
orderIdholds a redemption ofpromotionId.override -
release(
String promotionId, String orderId) → Future< void> -
Gives back
orderId's redemption ofpromotionId, if it holds one.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited