Class ProratedOfferAdjustmentDto
java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustmentDto
- All Implemented Interfaces:
ProratedOfferAdjustment
,Serializable
public class ProratedOfferAdjustmentDto
extends Object
implements ProratedOfferAdjustment, Serializable
DTO containing prorated price adjustment information for a
EnhancedLineItem
caused by an
order-level or fulfillment group-level offer.
If there's an order-level offer applied to the order, the offer adjustment would be spread across
all the discountable EnhancedLineItems
.
Practically, this information is only needed for downstream services since the total discount is
the same for the EnhancedLineItem
.
- Author:
- Sunny Yu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
javax.money.MonetaryAmount
The amount of the prorated adjustment for the item.The code used (if any) that triggered the application of the offer for this adjustment.The details about how this prorated adjustment on a per-quantity basis.TheLineItemRef
of theLineItem
that gets this adjustment.getOffer()
TheOfferRef
for the offer where this prorated adjustment is from.int
The quantity of merchandising items from theEnhancedLineItem
to which this adjustment applies.int
hashCode()
void
setAmount
(javax.money.MonetaryAmount amount) The amount of the prorated adjustment for the item.void
setCodeUsed
(String codeUsed) The code used (if any) that triggered the application of the offer for this adjustment.void
setItemProrationDetails
(List<ItemProrationDetail> itemProrationDetails) The details about how this prorated adjustment on a per-quantity basis.void
setLineItem
(LineItemRef lineItem) TheLineItemRef
of theLineItem
that gets this adjustment.void
TheOfferRef
for the offer where this prorated adjustment is from.void
setQuantity
(int quantity) The quantity of merchandising items from theEnhancedLineItem
to which this adjustment applies.toString()
-
Constructor Details
-
ProratedOfferAdjustmentDto
public ProratedOfferAdjustmentDto()
-
-
Method Details
-
getLineItem
TheLineItemRef
of theLineItem
that gets this adjustment.- Specified by:
getLineItem
in interfaceProratedOfferAdjustment
- Returns:
- The
LineItemRef
of theLineItem
that gets this adjustment.
-
getOffer
TheOfferRef
for the offer where this prorated adjustment is from.- Specified by:
getOffer
in interfaceProratedOfferAdjustment
- Returns:
- The
OfferRef
for the offer where this prorated adjustment is from.
-
getAmount
public javax.money.MonetaryAmount getAmount()The amount of the prorated adjustment for the item.- Specified by:
getAmount
in interfaceProratedOfferAdjustment
- Returns:
- The amount of the prorated adjustment for the item.
-
getQuantity
public int getQuantity()The quantity of merchandising items from theEnhancedLineItem
to which this adjustment applies.- Specified by:
getQuantity
in interfaceProratedOfferAdjustment
- Returns:
- The quantity of merchandising items from the
EnhancedLineItem
to which this adjustment applies.
-
getCodeUsed
The code used (if any) that triggered the application of the offer for this adjustment.- Specified by:
getCodeUsed
in interfaceProratedOfferAdjustment
- Returns:
- The code used (if any) that triggered the application of the offer for this adjustment.
-
getItemProrationDetails
The details about how this prorated adjustment on a per-quantity basis.For example, if the prorated adjustment for this item is $5 and this item has a quantity of 3, there should be one detail with quantity of 2 and amount of $1.67, and one detail with quantity of 1 and amount of $1.66, totaling to $5
- Specified by:
getItemProrationDetails
in interfaceProratedOfferAdjustment
- Returns:
- The details about how this prorated adjustment on a per-quantity basis.
-
setLineItem
TheLineItemRef
of theLineItem
that gets this adjustment.- Specified by:
setLineItem
in interfaceProratedOfferAdjustment
-
setOffer
TheOfferRef
for the offer where this prorated adjustment is from.- Specified by:
setOffer
in interfaceProratedOfferAdjustment
-
setAmount
public void setAmount(javax.money.MonetaryAmount amount) The amount of the prorated adjustment for the item.- Specified by:
setAmount
in interfaceProratedOfferAdjustment
-
setQuantity
public void setQuantity(int quantity) The quantity of merchandising items from theEnhancedLineItem
to which this adjustment applies.- Specified by:
setQuantity
in interfaceProratedOfferAdjustment
- Parameters:
quantity
- The quantity of merchandising items from theEnhancedLineItem
to which this adjustment applies.
-
setCodeUsed
The code used (if any) that triggered the application of the offer for this adjustment.- Specified by:
setCodeUsed
in interfaceProratedOfferAdjustment
- Parameters:
codeUsed
- The code used (if any) that triggered the application of the offer for this adjustment.
-
setItemProrationDetails
The details about how this prorated adjustment on a per-quantity basis.For example, if the prorated adjustment for this item is $5 and this item has a quantity of 3, there should be one detail with quantity of 2 and amount of $1.67, and one detail with quantity of 1 and amount of $1.66, totaling to $5
- Specified by:
setItemProrationDetails
in interfaceProratedOfferAdjustment
- Parameters:
itemProrationDetails
- The details about how this prorated adjustment on a per-quantity basis.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-