Class EnhancedOrder
java.lang.Object
com.broadleafcommerce.promotion.offer.web.context.EnhancedOrder
- All Implemented Interfaces:
com.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
,EnhancedFulfillmentGroup> Serializable
public class EnhancedOrder
extends Object
implements com.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,EnhancedFulfillmentGroup>, Serializable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addChildrenForItem
(EnhancedOrderLineItem parent, Collection<EnhancedOrderLineItem> allPotentialChildren) protected void
buildFulfillmentLineItem
(EnhancedFulfillmentLineItem enhancedFulfillmentLineItem, EnhancedOrderLineItem orderLineItem, int remainingQty) void
javax.money.MonetaryAmount
calculateItemAdjustmentsTotal
(boolean isForFulfillment) javax.money.MonetaryAmount
calculateItemAdjustmentsValue
(boolean isForFulfillment, boolean useSaleAdjustments) javax.money.MonetaryAmount
javax.money.MonetaryAmount
protected int
calculateRemainingQuantity
(EnhancedOrderLineItem orderItem) javax.money.MonetaryAmount
javax.money.MonetaryAmount
calculateSubtotalWithAdjustments
(boolean isForFulfillment) javax.money.MonetaryAmount
javax.money.MonetaryAmount
protected boolean
protected Optional<EnhancedFulfillmentGroup>
protected int
determinePossibleNumberOfCodesUsedPerOffer
(List<OfferCode> codeList, int timesUsed) boolean
void
javax.money.MonetaryAmount
javax.money.MonetaryAmount
javax.money.MonetaryAmount
javax.money.MonetaryAmount
Returns the adjusted subtotal of the order by adding the adjusted subtotal with the adjusted fulfillment total.javax.money.MonetaryAmount
Map of codes and reasons they were not applied.com.broadleafcommerce.promotion.offer.client.web.context.Codes
getCodes()
javax.money.CurrencyUnit
com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext
javax.money.MonetaryAmount
getFinalItemAdjustmentsValue
(boolean isForFulfillment) List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem>
protected javax.money.MonetaryAmount
javax.money.MonetaryAmount
getItemFutureCredits
(boolean isForFulfillment) getLineItemOfferDetails
(boolean isForFulfillment) getLineItems
(boolean isForFulfillment) List<com.broadleafcommerce.promotion.offer.client.web.context.OfferCodeDto>
getOrderLineItemsForOfferSegment
(String segment) javax.money.MonetaryAmount
double
javax.money.MonetaryAmount
javax.money.MonetaryAmount
javax.money.MonetaryAmount
javax.money.MonetaryAmount
javax.money.MonetaryAmount
List<com.broadleafcommerce.promotion.offer.client.web.context.info.Voucher>
int
hashCode()
void
initializeFulfillmentItemOfferDetails
(com.broadleafcommerce.common.extension.TypeFactory offerFactory) void
initializeFulfillmentItems
(com.broadleafcommerce.common.extension.TypeFactory offerFactory) void
initializeOrderItemOfferDetails
(com.broadleafcommerce.common.extension.TypeFactory offerFactory) protected boolean
boolean
Whether Offers of typeDiscountTargetType.FULFILLMENT_GROUP
orDiscountTargetType.FULFILLMENT_GROUP_ITEM
should be run against this order's fulfillment groups and fulfillment items.boolean
boolean
boolean
Whether any adjustment for this order or it's items is a result of a totalitarian offer, such that it'sOffer.getCombinabilityType()
isCombinabilityType.NONE
.boolean
void
Populate each of theorder's
EnhancedFulfillmentGroup.getFulfillmentItems()
fulfillment group's fulfillment items} with the correspondingorder's order items
usingEnhancedFulfillmentLineItem.getRelatedOrderLineItemNumber()
.void
void
void
Remove allEnhancedFulfillmentGroup.getGroupAdjustments()
for allfulfillment groups
.void
removeAllItemOfferAdjustments
(boolean isForFulfillment) Remove all adjustments for allorder items
.void
removeCodeResponse
(String code) void
removeCodesResponses
(Offer offer) void
removeCodesResponses
(Offer offer, int timesUsed) void
void
setAdjustedSubtotal
(javax.money.MonetaryAmount adjustedSubtotal) void
setAttributes
(Map<String, Object> attributes) void
setCartSubtotal
(javax.money.MonetaryAmount cartSubtotal) void
setCodeResponseMap
(Map<String, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse> codeResponseMap) Map of codes and reasons they were not applied.void
setCodes
(com.broadleafcommerce.promotion.offer.client.web.context.Codes codes) void
setCurrency
(javax.money.CurrencyUnit currency) void
setCustomerContext
(com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext) void
setFreeGiftItems
(List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> freeGiftItems) void
setFulfillmentGroups
(List<EnhancedFulfillmentGroup> fulfillmentGroups) void
void
setOfferCodeData
(OfferCodeData offerCodeData) void
setOfferCodes
(List<com.broadleafcommerce.promotion.offer.client.web.context.OfferCodeDto> offerCodes) void
setOrderAdjustments
(List<OrderOfferAdjustment> orderAdjustments) void
setOrderLineItems
(List<EnhancedOrderLineItem> orderLineItems) void
setOrderNumber
(String orderNumber) void
setOrderSubmitDate
(Instant orderSubmitDate) void
setRunOrderAndItemOffers
(boolean runOrderAndItemOffers) void
setSegmentLineItemsMap
(Map<String, List<EnhancedOrderLineItem>> segmentLineItemsMap) void
setSegments
(Set<String> segments) void
setTimeOfRequest
(Instant timeOfRequest) void
setTotalFufillmentCharges
(javax.money.MonetaryAmount totalFufillmentCharges) void
setVouchers
(List<com.broadleafcommerce.promotion.offer.client.web.context.info.Voucher> vouchers) toString()
void
updateCodeResponse
(String code, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse response) void
updateCodesResponses
(Offer offer, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse response) void
updateCodesResponses
(Offer offer, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse response, Set<String> immutableOfferCodes)
-
Constructor Details
-
EnhancedOrder
public EnhancedOrder()
-
-
Method Details
-
getTimeOfRequest
- Specified by:
getTimeOfRequest
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getFulfillmentLineItems
-
getSubtotalAsDouble
public double getSubtotalAsDouble() -
getSubtotal
public javax.money.MonetaryAmount getSubtotal() -
getAdjustedSubtotalWithoutFutureCredits
public javax.money.MonetaryAmount getAdjustedSubtotalWithoutFutureCredits() -
getLineItems
- Parameters:
isForFulfillment
- determines whether to getfulfillmentLineItems
instead oforderLineItems
- Returns:
- the line items of the specified type: Fulfillment or Order
-
getLineItemOfferDetails
-
getAllLineItemOfferDetails
-
initializeFulfillmentItems
public void initializeFulfillmentItems(com.broadleafcommerce.common.extension.TypeFactory offerFactory) -
buildFulfillmentLineItem
protected void buildFulfillmentLineItem(EnhancedFulfillmentLineItem enhancedFulfillmentLineItem, EnhancedOrderLineItem orderLineItem, int remainingQty) -
calculateRemainingQuantity
-
determineFulfillmentGroupForOrderItem
protected Optional<EnhancedFulfillmentGroup> determineFulfillmentGroupForOrderItem(EnhancedOrderLineItem orderItem) -
populateFulfillmentItemsWithOrderItems
public void populateFulfillmentItemsWithOrderItems()Populate each of theorder's
EnhancedFulfillmentGroup.getFulfillmentItems()
fulfillment group's fulfillment items} with the correspondingorder's order items
usingEnhancedFulfillmentLineItem.getRelatedOrderLineItemNumber()
. -
populateItemCurrencies
public void populateItemCurrencies() -
buildOrderItemHierarchies
public void buildOrderItemHierarchies() -
initializeOrderItemOfferDetails
public void initializeOrderItemOfferDetails(@NonNull com.broadleafcommerce.common.extension.TypeFactory offerFactory) -
initializeFulfillmentItemOfferDetails
public void initializeFulfillmentItemOfferDetails(@NonNull com.broadleafcommerce.common.extension.TypeFactory offerFactory) -
calculateSubtotalWithAdjustments
public javax.money.MonetaryAmount calculateSubtotalWithAdjustments() -
calculateSubtotalWithAdjustmentsForSegment
-
calculateSubtotalWithAdjustments
public javax.money.MonetaryAmount calculateSubtotalWithAdjustments(boolean isForFulfillment) -
calculateItemAdjustmentsTotal
public javax.money.MonetaryAmount calculateItemAdjustmentsTotal(boolean isForFulfillment) -
calculateSubtotalWithoutAdjustments
public javax.money.MonetaryAmount calculateSubtotalWithoutAdjustments() -
getTotalAdjustmentsValue
public javax.money.MonetaryAmount getTotalAdjustmentsValue() -
getTotalFulfillmentGroupAdjustments
public javax.money.MonetaryAmount getTotalFulfillmentGroupAdjustments() -
getTotalFulfillmentAdjustments
public javax.money.MonetaryAmount getTotalFulfillmentAdjustments() -
getTotalFutureCredits
public javax.money.MonetaryAmount getTotalFutureCredits() -
getFulfillmentGroupFutureCredits
protected javax.money.MonetaryAmount getFulfillmentGroupFutureCredits() -
getFinalItemAdjustmentsValue
public javax.money.MonetaryAmount getFinalItemAdjustmentsValue(boolean isForFulfillment) -
getItemFutureCredits
public javax.money.MonetaryAmount getItemFutureCredits(boolean isForFulfillment) -
calculateItemAdjustmentsValue
public javax.money.MonetaryAmount calculateItemAdjustmentsValue(boolean isForFulfillment, boolean useSaleAdjustments) -
setAdjustedSubtotal
public void setAdjustedSubtotal() -
calculateOrderAdjustmentTotal
public javax.money.MonetaryAmount calculateOrderAdjustmentTotal() -
calculateOrderFutureCredits
public javax.money.MonetaryAmount calculateOrderFutureCredits() -
isTotalitarianItemOfferApplied
public boolean isTotalitarianItemOfferApplied() -
isTotalitarianOrderOfferApplied
public boolean isTotalitarianOrderOfferApplied() -
isTotalitarianOfferApplied
public boolean isTotalitarianOfferApplied()Whether any adjustment for this order or it's items is a result of a totalitarian offer, such that it'sOffer.getCombinabilityType()
isCombinabilityType.NONE
.- Returns:
- Whether any adjustment for this order or it's items is a result of a totalitarian
offer, such that it's
Offer.getCombinabilityType()
isCombinabilityType.NONE
.
-
finalizeOrderItemPrices
public void finalizeOrderItemPrices() -
addChildrenForItem
protected void addChildrenForItem(EnhancedOrderLineItem parent, Collection<EnhancedOrderLineItem> allPotentialChildren) -
isNonCombinableOrderOfferApplied
protected boolean isNonCombinableOrderOfferApplied() -
removeAllFulfillmentOfferAdjustments
public void removeAllFulfillmentOfferAdjustments()Remove allEnhancedFulfillmentGroup.getGroupAdjustments()
for allfulfillment groups
. -
removeAllItemOfferAdjustments
public void removeAllItemOfferAdjustments(boolean isForFulfillment) Remove all adjustments for allorder items
. -
isRunFulfillmentAndItemOffers
public boolean isRunFulfillmentAndItemOffers()Whether Offers of typeDiscountTargetType.FULFILLMENT_GROUP
orDiscountTargetType.FULFILLMENT_GROUP_ITEM
should be run against this order's fulfillment groups and fulfillment items.- Returns:
- Whether Offers of type
DiscountTargetType.FULFILLMENT_GROUP
orDiscountTargetType.FULFILLMENT_GROUP_ITEM
should be run against this order's fulfillment groups and fulfillment items.
-
getAllLineItems
-
getAdjustedTotalWithoutFutureCredits
public javax.money.MonetaryAmount getAdjustedTotalWithoutFutureCredits()Returns the adjusted subtotal of the order by adding the adjusted subtotal with the adjusted fulfillment total.- Returns:
- the adjusted subtotal of the order
-
getAdjustedFulfillmentTotalWithoutFutureCredits
public javax.money.MonetaryAmount getAdjustedFulfillmentTotalWithoutFutureCredits() -
populateLineItemsBySegment
public void populateLineItemsBySegment() -
getOrderLineItemsForOfferSegment
-
removeCodesResponses
-
removeCodesResponses
-
determinePossibleNumberOfCodesUsedPerOffer
-
removeCodeResponse
-
updateCodesResponses
public void updateCodesResponses(Offer offer, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse response) -
updateCodesResponses
-
updateCodeResponse
public void updateCodeResponse(String code, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse response) -
getOrderNumber
- Specified by:
getOrderNumber
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getOrderLineItems
- Specified by:
getOrderLineItems
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getFulfillmentGroups
- Specified by:
getFulfillmentGroups
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getFreeGiftItems
public List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> getFreeGiftItems() -
getVouchers
-
getCodes
public com.broadleafcommerce.promotion.offer.client.web.context.Codes getCodes()- Specified by:
getCodes
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getOfferCodes
-
getCodeResponseMap
public Map<String,com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse> getCodeResponseMap()Map of codes and reasons they were not applied. -
getSegmentLineItemsMap
-
getSegments
-
getOfferCodeData
-
isRunOrderAndItemOffers
public boolean isRunOrderAndItemOffers()- Specified by:
isRunOrderAndItemOffers
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getAttributes
- Specified by:
getAttributes
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getLocale
- Specified by:
getLocale
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getCurrency
public javax.money.CurrencyUnit getCurrency()- Specified by:
getCurrency
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getCustomerContext
public com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext getCustomerContext()- Specified by:
getCustomerContext
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
getOrderSubmitDate
-
getCartSubtotal
public javax.money.MonetaryAmount getCartSubtotal() -
getAdjustedSubtotal
public javax.money.MonetaryAmount getAdjustedSubtotal() -
getOrderAdjustments
-
getTotalFufillmentCharges
public javax.money.MonetaryAmount getTotalFufillmentCharges() -
setOrderNumber
- Specified by:
setOrderNumber
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setOrderLineItems
- Specified by:
setOrderLineItems
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setFulfillmentGroups
- Specified by:
setFulfillmentGroups
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setFreeGiftItems
public void setFreeGiftItems(List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> freeGiftItems) -
setVouchers
public void setVouchers(List<com.broadleafcommerce.promotion.offer.client.web.context.info.Voucher> vouchers) -
setCodes
public void setCodes(com.broadleafcommerce.promotion.offer.client.web.context.Codes codes) - Specified by:
setCodes
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setOfferCodes
public void setOfferCodes(List<com.broadleafcommerce.promotion.offer.client.web.context.OfferCodeDto> offerCodes) -
setCodeResponseMap
public void setCodeResponseMap(Map<String, com.broadleafcommerce.promotion.offer.client.web.context.discounts.CodeResponse> codeResponseMap) Map of codes and reasons they were not applied. -
setSegmentLineItemsMap
-
setSegments
-
setOfferCodeData
-
setRunOrderAndItemOffers
public void setRunOrderAndItemOffers(boolean runOrderAndItemOffers) - Specified by:
setRunOrderAndItemOffers
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setAttributes
- Specified by:
setAttributes
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setLocale
- Specified by:
setLocale
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) - Specified by:
setCurrency
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setCustomerContext
public void setCustomerContext(com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext) - Specified by:
setCustomerContext
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setTimeOfRequest
- Specified by:
setTimeOfRequest
in interfacecom.broadleafcommerce.promotion.offer.client.web.context.Order<EnhancedOrderLineItem,
EnhancedFulfillmentGroup>
-
setOrderSubmitDate
-
setCartSubtotal
public void setCartSubtotal(javax.money.MonetaryAmount cartSubtotal) -
setAdjustedSubtotal
public void setAdjustedSubtotal(javax.money.MonetaryAmount adjustedSubtotal) -
setOrderAdjustments
-
setTotalFufillmentCharges
public void setTotalFufillmentCharges(javax.money.MonetaryAmount totalFufillmentCharges) -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-