Interface ProrationService
- All Known Implementing Classes:
DefaultProrationService
public interface ProrationService
- Author:
- Nathan Moore (nathanmoore).
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddProratedItemOfferAdjustmentsToParentOfferDetails(Collection<? extends EnhancedProratedItemOfferAdjustment> proratedAdjustments) Adds theProratedItemOfferAdjustmentsto their parentLineItemOfferDetailsbuildProratedOrderAdjustments(OrderOfferAdjustment offerAdjustment, List<? extends EnhancedLineItem> lineItems, DiscountableItemInfo discountableItemInfo) Builds a list ofEnhancedProratedOfferAdjustmentsthat prorates the adjustment value of the passed inOrderOfferAdjustmentto the passed in list of relevantEnhancedLineItemsFor anyOfferthat has aDiscount.prorationTypeofProrationType.TARGET_AND_QUALIFIER, this will populate all of theProratedItemOfferAdjustmentson theLineItemOfferDetailsmostly for the sake of reporting instruments.voidPopulates all of theEnhancedProratedOfferAdjustmentsfor anyOfferthat has aDiscount.getTargetType()ofDiscountTargetType.FULFILLMENT_GROUPand add them onto the individual discountablefulfillment items, as well as populatingEnhancedFulfillmentGroup.getProratedFulfillmentAdjustments().voidpopulateProratedOrderAdjustments(EnhancedOrder order, OfferProcessingContext context) Populates all of theEnhancedProratedOfferAdjustmentsfor anyOfferthat has aDiscount.getTargetType()ofDiscountTargetType.ORDERand add them onto the individual discountablefulfillment items, as well as populatingEnhancedFulfillmentGroup.getProratedFulfillmentAdjustments().
-
Method Details
-
calculateProratedItemAdjustments
@NonNull Set<EnhancedProratedItemOfferAdjustment> calculateProratedItemAdjustments(@NonNull EnhancedOrder order) For anyOfferthat has aDiscount.prorationTypeofProrationType.TARGET_AND_QUALIFIER, this will populate all of theProratedItemOfferAdjustmentson theLineItemOfferDetailsmostly for the sake of reporting instruments.- Parameters:
order- theEnhancedOrderwhose items may needProratedItemOfferAdjustments- Returns:
- all of the
ProratedItemOfferAdjustmentsfor thisOrder'sorder and fulfillmentLineItems.
-
buildProratedOrderAdjustments
@NonNull Set<EnhancedProratedOfferAdjustment> buildProratedOrderAdjustments(@NonNull OrderOfferAdjustment offerAdjustment, @NonNull List<? extends EnhancedLineItem> lineItems, DiscountableItemInfo discountableItemInfo) Builds a list ofEnhancedProratedOfferAdjustmentsthat prorates the adjustment value of the passed inOrderOfferAdjustmentto the passed in list of relevantEnhancedLineItems- Parameters:
offerAdjustment- theOrderOfferAdjustmentto prorate.lineItems- the list of relevantEnhancedLineItemstodiscountableItemInfo-- Returns:
- the list of
EnhancedProratedOfferAdjustments
-
populateProratedOrderAdjustments
@NonNull void populateProratedOrderAdjustments(@NonNull EnhancedOrder order, OfferProcessingContext context) Populates all of theEnhancedProratedOfferAdjustmentsfor anyOfferthat has aDiscount.getTargetType()ofDiscountTargetType.ORDERand add them onto the individual discountablefulfillment items, as well as populatingEnhancedFulfillmentGroup.getProratedFulfillmentAdjustments().- Parameters:
order- theEnhancedOrderto populate the fulfillment group offer adjustment prorations
-
populateProratedFulfillmentGroupAdjustments
Populates all of theEnhancedProratedOfferAdjustmentsfor anyOfferthat has aDiscount.getTargetType()ofDiscountTargetType.FULFILLMENT_GROUPand add them onto the individual discountablefulfillment items, as well as populatingEnhancedFulfillmentGroup.getProratedFulfillmentAdjustments().- Parameters:
order- theEnhancedOrderto populate the fulfillment group offer adjustment prorations
-
addProratedItemOfferAdjustmentsToParentOfferDetails
void addProratedItemOfferAdjustmentsToParentOfferDetails(@NonNull Collection<? extends EnhancedProratedItemOfferAdjustment> proratedAdjustments) Adds theProratedItemOfferAdjustmentsto their parentLineItemOfferDetails- Parameters:
proratedAdjustments-ProratedItemOfferAdjustmentsto be added
-