public interface ChargeStrategy<P extends Product,U extends User> extends Strategy
Modifier and Type | Method and Description |
---|---|
<CONTEXT> Amount |
calculate(P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context)
Calculate raw amount for a product and any user making purchase
|
getVersion
<CONTEXT> Amount calculate(P product, Number quantity, U user, String currency, List<PromotionForUser> promotions, CONTEXT context)
product
- as Pquantity
- as Numberuser
- as U @NUllable truecurrency
- as String @nullable true. A null implies default currencyList
- of Promotion
s @nullable true - if Promotions do not apply then it can be nullCONTEXT
- (additional context)Copyright © 2018. All rights reserved.