Class OfferRef
java.lang.Object
com.broadleafcommerce.order.common.domain.OfferRef
- All Implemented Interfaces:
Serializable
A reference to some external offer. Offers can be associated to carts, orders, fulfillment, or
their items. This reference could come from Broadleaf's Offer Microservice or some other source
entirely.
- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanDynamic attributes that are a part of the offer.A label for this offer typically used by the storefront.A description of what benefits the offer provides to a customer.The discount factor by which to discount a target.Determines the method used to apply the discount.getId()The ID of the offer.getName()The name of the offer.Determines how an offer's discount amount is distributed across the offer's related order item types.inthashCode()voidsetAttributes(Map<String, Object> attributes) Dynamic attributes that are a part of the offer.voidsetCartLabel(String cartLabel) A label for this offer typically used by the storefront.voidsetDescription(String description) A description of what benefits the offer provides to a customer.voidsetDiscountFactor(BigDecimal discountFactor) The discount factor by which to discount a target.voidsetDiscountMethodType(String discountMethodType) Determines the method used to apply the discount.voidThe ID of the offer.voidThe name of the offer.voidsetProrationType(String prorationType) Determines how an offer's discount amount is distributed across the offer's related order item types.toString()
-
Constructor Details
-
OfferRef
public OfferRef()
-
-
Method Details
-
getId
The ID of the offer.- Returns:
- The ID of the offer.
-
getName
The name of the offer. Often used to indicate to a customer what offers are applied to their cart.- Returns:
- The name of the offer.
-
getDescription
A description of what benefits the offer provides to a customer.- Returns:
- A description of benefits what the offer provides to a customer.
-
getCartLabel
A label for this offer typically used by the storefront.- Returns:
- A label for this offer typically used by the storefront.
-
getProrationType
Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items.This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.
- Returns:
- The type of order items that this discount is prorated across.
- See Also:
-
getDiscountMethodType
Determines the method used to apply the discount. This is recorded for audit and potentially for downstream systems that need to recalculate pricing such as for subscriptions.- Returns:
- The method to use to apply this discount.
- Since:
- Order Common 2.0.4
-
getDiscountFactor
The discount factor by which to discount a target. If the amount is10, then whether it is calculated as a percentage (10%) or a currency amount ($10) is determined bydiscountMethodType. This is recorded for audit and potentially for downstream systems that need to recalculate pricing such as for subscriptions. This does not represent that actual amount discounted from the target.- Returns:
- The amount of the discount to be applied.
- Since:
- Order Common 2.0.4
-
getAttributes
Dynamic attributes that are a part of the offer.- Returns:
- dynamic attributes that are a part of the offer
-
setId
The ID of the offer.- Parameters:
id- The ID of the offer.
-
setName
The name of the offer. Often used to indicate to a customer what offers are applied to their cart.- Parameters:
name- The name of the offer.
-
setDescription
A description of what benefits the offer provides to a customer.- Parameters:
description- A description of what benefits the offer provides to a customer.
-
setCartLabel
A label for this offer typically used by the storefront.- Parameters:
cartLabel- A label for this offer typically used by the storefront.
-
setProrationType
Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items.This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.
- Parameters:
prorationType- The type of order items that this discount is prorated across.- See Also:
-
setDiscountMethodType
Determines the method used to apply the discount. This is recorded for audit and potentially for downstream systems that need to recalculate pricing such as for subscriptions.- Parameters:
methodType- The method to use to apply this discount.- Since:
- Order Common 2.0.4
-
setDiscountFactor
The discount factor by which to discount a target. If the amount is10, then whether it is calculated as a percentage (10%) or a currency amount ($10) is determined bydiscountMethodType. This is recorded for audit and potentially for downstream systems that need to recalculate pricing such as for subscriptions. This does not represent that actual amount discounted from the target.- Parameters:
amount- The amount of the discount to be applied.- Since:
- Order Common 2.0.4
-
setAttributes
Dynamic attributes that are a part of the offer.- Parameters:
attributes- dynamic attributes that are a part of the offer
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-