public interface SaleStrategy<P extends Product,U extends User> extends CumulativeChargeStrategy<P,U>
Modifier and Type | Method and Description |
---|---|
void |
actionOnPurchase(List<P> product,
U user,
String sessionId)
On an event where a User made a purchase
|
void |
actionOnRating(P product,
U user,
String sessionId)
On user Rating; if there is rating ability then any custom action
|
void |
actionOnVisit(P product,
U user,
String sessionId)
On an event where a User visited the products
|
<CONTEXT> List<Boolean> |
areProductsAvailableToBeSold(List<P> products,
U user,
String sessionId,
CONTEXT context)
Are these products for Sale
|
LockStrategy<P,U> |
getLockStrategy()
Is there any
LockStrategy behind the SaleStrategy |
Number |
getUnitsInStock(P product,
U user,
String sessionId)
Get the number of units in Stock available for
purchase.
|
<CONTEXT> Boolean |
isProductAvailableToBeSold(P product,
U user,
String sessionId,
CONTEXT context)
Is Product available to be sold
|
calculate
calculate
getVersion
<CONTEXT> Boolean isProductAvailableToBeSold(P product, U user, String sessionId, CONTEXT context)
product
- as Puser
- as U @nullable true<CONTEXT> List<Boolean> areProductsAvailableToBeSold(List<P> products, U user, String sessionId, CONTEXT context)
products
- as List of Puser
- as U @nullable trueNumber getUnitsInStock(P product, U user, String sessionId)
product
- as Puser
- as U @nullable truesessionId
- as String @nullable truevoid actionOnPurchase(List<P> product, U user, String sessionId)
void actionOnVisit(P product, U user, String sessionId)
product
- as Puser
- as Uvoid actionOnRating(P product, U user, String sessionId)
product
- as Puser
- as ULockStrategy<P,U> getLockStrategy()
LockStrategy
behind the SaleStrategy
LockStrategy
@Nulable trueCopyright © 2018. All rights reserved.