Package | Description |
---|---|
com.neurosys.ecom.orders.domain | |
com.neurosys.ecom.orders.service | |
com.neurosys.ecom.strategy.service | |
com.neurosys.ecom.user.service.jaxrs |
Modifier and Type | Field and Description |
---|---|
protected Amount |
BaseOrderItem.amount
Amount spent on ordering quantity items.If a product is purchased with N units ; then amount is for all N units. |
protected Amount |
BaseOrderItem.packagingAmount
Amount spent on packaging quantity items.If a product is purchased with N units ; then amount is for all N units. |
protected Amount |
SubOrder.partialAmount
|
protected Amount |
BaseOrderItem.shippingAmount
Amount spent on shipping for ordering quantity items.If a product is purchased with N units ; then amount is for all N units. |
Modifier and Type | Method and Description |
---|---|
Amount |
Amount.add(Amount amt)
Will add the amount to the current amount and return the updated current amount;
parameter null values are skipped
|
Amount |
Amount.clone() |
Amount |
Amount.deduct(Amount amt)
Will deduct the amount to the current amount and return the updated current amount;
parameter null values are skipped
|
Amount |
BaseOrderItem.getAmount()
Amount spent on ordering quantity items.If a product is purchased with N units ; then amount is for all N units. |
Amount |
DeliveryDetails.getAmount()
Amount charged for Delivery/Shipping only |
Amount |
BaseOrderItem.getPackagingAmount()
Amount spent on packaging for ordering quantity items.If a product is purchased with N units ; then amount is for all N units. |
Amount |
SubOrder.getPartialAmount()
|
Amount |
BaseOrderItem.getShippingAmount()
Amount spent on shipping for ordering quantity items.If a product is purchased with N units ; then amount is for all N units. |
Modifier and Type | Method and Description |
---|---|
List<Amount> |
Amount.getSubAmounts()
A
Transient field, if NOT null, will also track any sub-calculations (AAmount) used in cumulative operations
while calculating this Amount. |
Modifier and Type | Method and Description |
---|---|
Amount |
Amount.add(Amount amt)
Will add the amount to the current amount and return the updated current amount;
parameter null values are skipped
|
Amount |
Amount.deduct(Amount amt)
Will deduct the amount to the current amount and return the updated current amount;
parameter null values are skipped
|
void |
BaseOrderItem.setAmount(Amount amount)
Amount spent on ordering quantity items.If a product is purchased with N units ; then amount is for all N units. |
void |
DeliveryDetails.setAmount(Amount amount)
Amount charged for Delivery/Shipping only |
void |
BaseOrderItem.setPackagingAmount(Amount packagingAmount)
Amount spent on packaging for ordering quantity items.If a product is purchased with N units ; then amount is for all N units. |
void |
SubOrder.setPartialAmount(Amount partialAmount)
|
void |
BaseOrderItem.setShippingAmount(Amount shippingAmount)
Amount spent on shipping for ordering quantity items.If a product is purchased with N units ; then amount is for all N units. |
Modifier and Type | Method and Description |
---|---|
void |
Amount.setSubAmounts(List<Amount> subAmounts)
A
Transient field, if NOT null, will also track any sub-calculations (AAmount) used in cumulative operations
while calculating this Amount. |
Constructor and Description |
---|
Order(GenericEcomUser user,
PaymentContext paymentContext,
PaymentMethod paymentMethod,
Amount amount,
Date purchaseDate) |
Order(GenericEcomUser user,
PaymentMethod paymentMethod,
Amount amount) |
Order(GenericEcomUser user,
PaymentMethod paymentMethod,
Amount amount,
Date purchaseDate) |
OrderItem(Order order,
P product,
Amount amount,
Double quantity) |
RelatedOrder(GenericEcomUser user,
PaymentContext paymentContext,
PaymentMethod paymentMethod,
Amount amount,
Date purchaseDate) |
RelatedOrder(GenericEcomUser user,
PaymentMethod paymentMethod,
Amount amount) |
RelatedOrder(GenericEcomUser user,
PaymentMethod paymentMethod,
Amount amount,
Date purchaseDate) |
SubOrder(GenericEcomUser user,
PaymentContext paymentContext,
PaymentMethod paymentMethod,
Amount amount,
Date purchaseDate) |
SubOrder(GenericEcomUser user,
PaymentMethod paymentMethod,
Amount amount) |
SubOrder(GenericEcomUser user,
PaymentMethod paymentMethod,
Amount amount,
Date purchaseDate) |
SubOrder(O root,
Amount partialAmount) |
SubOrder(SubOrder<O,I> previousOrRoot,
Amount partialAmount) |
Modifier and Type | Method and Description |
---|---|
Stack<Amount> |
DefaultSubOrderService.getAllPartialAmounts(O order,
boolean considerOnlyRealizedOrders)
For all Orders placed related to this order, return in sequence all the partial amounts, so far.<
|
Stack<Amount> |
SubOrderService.getAllPartialAmounts(O order,
boolean considerOnlyRealizedOrders)
For all Orders placed related to this order, return in sequence all the partial amounts, so far.<
|
Modifier and Type | Method and Description |
---|---|
<CONTEXT> Amount |
CumulativeChargeStrategy.calculate(Map<P,Number> productQtyMap,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number quantityTotal,
CONTEXT context)
Calculate raw amount for product(s)
|
<CONTEXT> Amount |
DefaultPromotionStrategy.calculate(Map<P,Number> productQtyMap,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number totalQuantity,
CONTEXT context) |
<CONTEXT> Amount |
PromotionStrategy.calculate(Map<P,Number> productQtyMap,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number totalQuantity,
CONTEXT context)
Note: Discounts are DEDUCTED in main / API calcs, so total can be (+), discount part (-) ...
|
<CONTEXT> Amount |
AbstractChargeStrategy.calculate(Map<P,Number> productQtyMap,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number quantityTotal,
CONTEXT context) |
<CONTEXT> Amount |
DefaultPromotionStrategy.calculate(P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context)
By default this Strategy does not do anything @ a product level.
|
<CONTEXT> Amount |
DefaultOrderStrategy.calculate(P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context)
Will add amount from
ChargeStrategy.calculate(Product, Number, User, String, List, Object) for each of the following strategies in order @ The product level.The rules of add(Amount) will apply while adding:
DefaultOrderStrategy.saleStrategy
DefaultOrderStrategy.discountStrategy
DefaultOrderStrategy.promotionStrategy
|
<CONTEXT> Amount |
ChargeStrategy.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
|
<CONTEXT> Amount |
DefaultSaleStrategy.calculate(P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context)
Calculate
Amount for product in the given context. |
<CONTEXT> Amount |
DefaultPackagingStrategy.calculate(P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context)
Return
Product.getPackagingData() as a Number |
<CONTEXT> Amount |
DefaultShippingStrategy.calculate(P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context)
Return
Product.getShippingData() as a Number |
<CONTEXT> Amount |
DefaultTaxStrategy.calculate(P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context)
Assumes tax data is represented in %, Number and the calculation is is a Tax% on (sale or regular price).
|
<CONTEXT> Amount |
DefaultDiscountStrategy.calculate(P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context) |
Amount |
DefaultSubOrderStrategy.calculateCumulativePartialAmountsSoFar(O order,
boolean considerOnlyRealizedOrders,
boolean validateRelations)
Sum all
SubOrder.getPartialAmount() . |
Amount |
CurrencyStrategy.convert(Amount amt,
String toCurrency)
Convert an Amount from one currency to another
|
protected Amount |
DefaultPromotionStrategy.discountForPromotion(PromotionForUser promotionForUser,
Map<P,Number> productQtyMap,
String currency,
Amount subTotal) |
protected Amount |
DefaultSaleStrategy.getDefaultAmtForMissingData(Price price)
If any amount is null due to data missing; then what should be returned.
|
Modifier and Type | Method and Description |
---|---|
protected <CONTEXT> void |
DefaultSaleStrategy.applyDiscount(Amount amt,
P product,
Number quantity,
U user,
List<PromotionForUser> promotions,
CONTEXT context)
Apply discount on product.
|
protected void |
AbstractChargeStrategy.applyTax(Amount amt,
P product)
Convenience method for applying tax over individual strategies
|
protected <CONTEXT> void |
DefaultSaleStrategy.applyTax(Amount amt,
P product,
Number quantity,
U user,
String currency,
List<PromotionForUser> promotions,
CONTEXT context) |
<CONTEXT> Amount |
CumulativeChargeStrategy.calculate(Map<P,Number> productQtyMap,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number quantityTotal,
CONTEXT context)
Calculate raw amount for product(s)
|
<CONTEXT> Amount |
DefaultPromotionStrategy.calculate(Map<P,Number> productQtyMap,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number totalQuantity,
CONTEXT context) |
<CONTEXT> Amount |
PromotionStrategy.calculate(Map<P,Number> productQtyMap,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number totalQuantity,
CONTEXT context)
Note: Discounts are DEDUCTED in main / API calcs, so total can be (+), discount part (-) ...
|
<CONTEXT> Amount |
AbstractChargeStrategy.calculate(Map<P,Number> productQtyMap,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number quantityTotal,
CONTEXT context) |
Amount |
CurrencyStrategy.convert(Amount amt,
String toCurrency)
Convert an Amount from one currency to another
|
protected I |
DefaultOrderStrategy.createOrderItem(O order,
P p,
Amount totalAmtForProduct,
Number quantity,
Map<String,Object> itemProperties)
Override for custom
OrderItem type |
protected Amount |
DefaultPromotionStrategy.discountForPromotion(PromotionForUser promotionForUser,
Map<P,Number> productQtyMap,
String currency,
Amount subTotal) |
<CONTEXT> List<PromotionForUser> |
DefaultPromotionStrategy.getPromotions(Map<P,Number> productQtyMap,
U user,
Amount subTotal,
Number quantityTotal,
CONTEXT context)
Note: Default implementation looks for any item not on SALE to grant the Discount.
|
<CONTEXT> List<PromotionForUser> |
PromotionStrategy.getPromotions(Map<P,Number> productQtyMap,
U user,
Amount subTotal,
Number quantityTotal,
CONTEXT context)
Get a List of
PromotionForUser for the Order of a user |
protected Double |
DefaultPromotionStrategy.includeProductPriceForDiscount(P p,
PromotionForUser promotionForUser,
String currency,
Amount subTotal)
If this returns a double then in cases where the Discount is variable on the Cart amount; this will contribute.
|
protected void |
DefaultPromotionStrategy.validate(PromotionForUser promotionForUser,
String currency,
Amount subTotal,
Number totalQuantity) |
Modifier and Type | Method and Description |
---|---|
protected PartialTransactionException |
StrategiesService._strategiesCalcData(Map<P,Number> productQtyMap,
List<CartItem> cartItems,
U user,
String currency,
List<PromotionForUser> promotions,
Amount subTotal,
Number totalQuantity,
Collection<String> paramNames,
EComSession session,
CONTEXT context,
PartialTransactionException pte)
Can override if there are any App specific Strategies not handled by this default service
|
protected void |
StrategiesService.logValidationError(String strategyName,
Amount subTotal,
List<CartItem> cartItems,
U user,
String currency,
Collection<String> paramNames,
EComSession session,
String contextStr,
Throwable e) |
Copyright © 2018. All rights reserved.