Interface ProrationService
- All Known Implementing Classes:
DefaultProrationService
public interface ProrationService
- Author:
- Nathan Moore (nathanmoore).
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addProratedItemOfferAdjustmentsToParentOfferDetails
(Collection<? extends EnhancedProratedItemOfferAdjustment> proratedAdjustments) Adds theProratedItemOfferAdjustments
to their parentLineItemOfferDetails
buildProratedOrderAdjustments
(OrderOfferAdjustment offerAdjustment, List<? extends EnhancedLineItem> lineItems, DiscountableItemInfo discountableItemInfo) Builds a list ofEnhancedProratedOfferAdjustments
that prorates the adjustment value of the passed inOrderOfferAdjustment
to the passed in list of relevantEnhancedLineItem
sFor anyOffer
that has aDiscount.prorationType
ofProrationType.TARGET_AND_QUALIFIER
, this will populate all of theProratedItemOfferAdjustments
on theLineItemOfferDetails
mostly for the sake of reporting instruments.void
Populates all of theEnhancedProratedOfferAdjustments
for anyOffer
that has aDiscount.getTargetType()
ofDiscountTargetType.FULFILLMENT_GROUP
and add them onto the individual discountablefulfillment items
, as well as populatingEnhancedFulfillmentGroup.getProratedFulfillmentAdjustments()
.void
populateProratedOrderAdjustments
(EnhancedOrder order, OfferProcessingContext context) Populates all of theEnhancedProratedOfferAdjustments
for anyOffer
that has aDiscount.getTargetType()
ofDiscountTargetType.ORDER
and add them onto the individual discountablefulfillment items
, as well as populatingEnhancedFulfillmentGroup.getProratedFulfillmentAdjustments()
.
-
Method Details
-
calculateProratedItemAdjustments
@NonNull Set<EnhancedProratedItemOfferAdjustment> calculateProratedItemAdjustments(@NonNull EnhancedOrder order) For anyOffer
that has aDiscount.prorationType
ofProrationType.TARGET_AND_QUALIFIER
, this will populate all of theProratedItemOfferAdjustments
on theLineItemOfferDetails
mostly for the sake of reporting instruments.- Parameters:
order
- theEnhancedOrder
whose items may needProratedItemOfferAdjustments
- Returns:
- all of the
ProratedItemOfferAdjustments
for thisOrder's
order and fulfillmentLineItems
.
-
buildProratedOrderAdjustments
@NonNull Set<EnhancedProratedOfferAdjustment> buildProratedOrderAdjustments(@NonNull OrderOfferAdjustment offerAdjustment, @NonNull List<? extends EnhancedLineItem> lineItems, DiscountableItemInfo discountableItemInfo) Builds a list ofEnhancedProratedOfferAdjustments
that prorates the adjustment value of the passed inOrderOfferAdjustment
to the passed in list of relevantEnhancedLineItem
s- Parameters:
offerAdjustment
- theOrderOfferAdjustment
to prorate.lineItems
- the list of relevantEnhancedLineItems
todiscountableItemInfo
-- Returns:
- the list of
EnhancedProratedOfferAdjustments
-
populateProratedOrderAdjustments
@NonNull void populateProratedOrderAdjustments(@NonNull EnhancedOrder order, OfferProcessingContext context) Populates all of theEnhancedProratedOfferAdjustments
for anyOffer
that has aDiscount.getTargetType()
ofDiscountTargetType.ORDER
and add them onto the individual discountablefulfillment items
, as well as populatingEnhancedFulfillmentGroup.getProratedFulfillmentAdjustments()
.- Parameters:
order
- theEnhancedOrder
to populate the fulfillment group offer adjustment prorations
-
populateProratedFulfillmentGroupAdjustments
Populates all of theEnhancedProratedOfferAdjustments
for anyOffer
that has aDiscount.getTargetType()
ofDiscountTargetType.FULFILLMENT_GROUP
and add them onto the individual discountablefulfillment items
, as well as populatingEnhancedFulfillmentGroup.getProratedFulfillmentAdjustments()
.- Parameters:
order
- theEnhancedOrder
to populate the fulfillment group offer adjustment prorations
-
addProratedItemOfferAdjustmentsToParentOfferDetails
void addProratedItemOfferAdjustmentsToParentOfferDetails(@NonNull Collection<? extends EnhancedProratedItemOfferAdjustment> proratedAdjustments) Adds theProratedItemOfferAdjustments
to their parentLineItemOfferDetails
- Parameters:
proratedAdjustments
-ProratedItemOfferAdjustments
to be added
-