Class OfferImpl
- All Implemented Interfaces:
Serializable,AdminMainEntity,MultiTenantCloneable<Offer>,Status,Offer,OfferAdminPresentation
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.broadleafcommerce.core.offer.domain.OfferAdminPresentation
OfferAdminPresentation.FieldOrder, OfferAdminPresentation.GroupName, OfferAdminPresentation.GroupOrder, OfferAdminPresentation.TabName, OfferAdminPresentation.TabOrder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Booleanprotected Booleanprotected ArchiveStatusprotected Booleanprotected BooleanDetermines if other offers of the same type can be combined with this offer.protected Stringprotected Stringprotected Datestatic final Stringprotected Longprotected Set<OfferItemCriteria>protected Set<OfferItemCriteria>protected Stringprotected Longprotected Integerprotected Stringprotected Longprotected Stringprotected Stringprotected Stringprotected List<OfferPriceData>protected BigDecimalprotected Integerprotected Set<OfferQualifyingCriteriaXref>protected BigDecimalprotected Booleanprotected Dateprotected Set<OfferTargetCriteriaXref>protected BigDecimalprotected Stringprotected Booleanprotected Stringprotected Booleanprotected BigDecimalFields inherited from interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
MAIN_ENTITY_NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<G extends Offer>
CreateResponse<G>booleanThis indicates how an Offer should be fulfilled to the customer, defaulting to order time discount.booleanReturns whether or not this offer should apply to anOrderItems child order itemsbooleangetId()Returns the maximum number of times that this offer can be used by the same customer.intReturns the maximum number of times that this offer can be used in the current order.Enum that allows implementations to vary how customer max uses will be interpreted.Sets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated byOffer.getMaxUsesPerCustomer().getName()Returns the offer codes that can be used to retrieve this Offer.intIndicates the amount of items that must be purchased for this offer to be considered for this order.getType()getValue()inthashCode()booleanisActive()booleanReturns true if the offer system should automatically add this offer for consideration (versus requiring a code or other delivery mechanism).booleanReturns true if this offer can be combined with other offers in the order.booleanFuture credit means that the associated adjustment will be discounted at a later time to the customer via a credit.booleanWhether or not this offer has limited use in an order.booleanWhether or not this offer has limited use in an order.booleanIndicates that there is no limit to how many times a customer can use this offer.booleanIndicates that there is no limit to how many times this offer can be applied to the order.voidsetAdjustmentType(OfferAdjustmentType adjustmentType) This indicates how an Offer should be fulfilled to the customer, defaulting to order time discount.voidsetApplyDiscountToSalePrice(boolean applyToSalePrice) voidsetApplyToChildItems(boolean applyToChildItems) Sets whether or not this offer should apply to anOrderItems child order itemsvoidsetArchived(Character archived) voidsetAutomaticallyAdded(boolean automaticallyAdded) Sets whether or not this offer should be automatically considered for consideration (versus requiring a code or other delivery mechanism).voidsetCombinableWithOtherOffers(boolean combinableWithOtherOffers) Sets the combinableWithOtherOffers value for this offer.voidsetDescription(String description) voidsetDiscountType(OfferDiscountType discountType) voidsetEndDate(Date endDate) voidvoidsetMarketingMessage(String marketingMessage) voidsetMaxUsesPerCustomer(Long maxUsesPerCustomer) Sets the maximum number of times that this offer can be used by the same customer.voidsetMaxUsesPerOrder(int maxUsesPerOrder) Sets the maximum number of times that this offer can be used in the current order.voidsetMaxUsesStrategyType(CustomerMaxUsesStrategyType strategyType) Sets the strategy for determining customer max uses.voidsetMinimumDaysPerUsage(Long minimumDaysPerUsage) Sets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated byOffer.getMaxUsesPerCustomer().voidvoidsetOfferCodes(List<OfferCode> offerCodes) Sets the offer codes that can be used to retrieve this Offer.voidsetOfferItemQualifierRuleType(OfferItemRestrictionRuleType restrictionRuleType) voidsetOfferItemTargetRuleType(OfferItemRestrictionRuleType restrictionRuleType) voidsetOfferMatchRulesXref(Map<String, OfferOfferRuleXref> offerMatchRulesXref) voidsetOfferPriceData(List<OfferPriceData> offerPriceData) voidsetOrderMinSubTotal(Money orderMinSubTotal) voidsetPriority(Integer priority) voidsetQualifyingItemCriteriaXref(Set<OfferQualifyingCriteriaXref> qualifyingItemCriteriaXref) voidsetQualifyingItemSubTotal(Money qualifyingItemSubTotal) voidsetRequiresRelatedTargetAndQualifiers(Boolean requiresRelatedTargetAndQualifiers) voidsetStartDate(Date startDate) voidsetTargetItemCriteriaXref(Set<OfferTargetCriteriaXref> targetItemCriteriaXref) voidsetTargetMinSubTotal(Money targetMinSubTotal) voidsetTargetSystem(String targetSystem) voidsetTotalitarianOffer(Boolean totalitarianOffer) voidvoidsetUseListForDiscounts(Boolean useListForDiscounts) voidsetValue(BigDecimal value)
-
Field Details
-
EXCLUDE_OFFERCODE_COPY_HINT
- See Also:
-
id
-
offerCodes
-
name
-
description
-
marketingMessage
-
type
-
discountType
-
value
-
priority
-
startDate
-
endDate
-
targetSystem
-
applyToSalePrice
-
applyToChildItems
-
combinableWithOtherOffers
Determines if other offers of the same type can be combined with this offer. -
automaticallyAdded
-
maxUsesPerOrder
-
maxUsesPerCustomer
-
maxUsesStrategy
-
minimumDaysPerUsage
-
offerItemQualifierRuleType
-
qualifyingItemSubTotal
-
orderMinSubTotal
-
targetMinSubTotal
-
offerItemTargetRuleType
-
qualifyingItemCriteria
-
legacyQualifyingItemCriteria
-
targetItemCriteria
-
legacyTargetItemCriteria
-
totalitarianOffer
-
requiresRelatedTargetAndQualifiers
-
adjustmentType
-
useListForDiscounts
-
offerPriceData
-
archiveStatus
-
-
Constructor Details
-
OfferImpl
public OfferImpl()
-
-
Method Details
-
getId
-
setId
-
getName
-
setName
-
getDescription
- Specified by:
getDescriptionin interfaceOffer
-
setDescription
- Specified by:
setDescriptionin interfaceOffer
-
getType
-
setType
-
getDiscountType
- Specified by:
getDiscountTypein interfaceOffer
-
setDiscountType
- Specified by:
setDiscountTypein interfaceOffer
-
getOfferItemQualifierRuleType
- Specified by:
getOfferItemQualifierRuleTypein interfaceOffer
-
setOfferItemQualifierRuleType
- Specified by:
setOfferItemQualifierRuleTypein interfaceOffer
-
getOfferItemTargetRuleType
- Specified by:
getOfferItemTargetRuleTypein interfaceOffer
-
setOfferItemTargetRuleType
- Specified by:
setOfferItemTargetRuleTypein interfaceOffer
-
getValue
-
setValue
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceOffer
-
setPriority
- Specified by:
setPriorityin interfaceOffer
-
getStartDate
- Specified by:
getStartDatein interfaceOffer
-
setStartDate
- Specified by:
setStartDatein interfaceOffer
-
getEndDate
- Specified by:
getEndDatein interfaceOffer
-
setEndDate
- Specified by:
setEndDatein interfaceOffer
-
getTargetSystem
- Specified by:
getTargetSystemin interfaceOffer
-
setTargetSystem
- Specified by:
setTargetSystemin interfaceOffer
-
getApplyDiscountToSalePrice
public boolean getApplyDiscountToSalePrice()- Specified by:
getApplyDiscountToSalePricein interfaceOffer
-
setApplyDiscountToSalePrice
public void setApplyDiscountToSalePrice(boolean applyToSalePrice) - Specified by:
setApplyDiscountToSalePricein interfaceOffer
-
getApplyToChildItems
Description copied from interface:OfferReturns whether or not this offer should apply to anOrderItems child order items- Specified by:
getApplyToChildItemsin interfaceOffer- Returns:
- applyToChildItems
-
setApplyToChildItems
public void setApplyToChildItems(boolean applyToChildItems) Description copied from interface:OfferSets whether or not this offer should apply to anOrderItems child order items- Specified by:
setApplyToChildItemsin interfaceOffer
-
isCombinableWithOtherOffers
public boolean isCombinableWithOtherOffers()Returns true if this offer can be combined with other offers in the order.- Specified by:
isCombinableWithOtherOffersin interfaceOffer- Returns:
- true if combinableWithOtherOffers, otherwise false
-
getCombinableWithOtherOffers
public boolean getCombinableWithOtherOffers() -
setCombinableWithOtherOffers
public void setCombinableWithOtherOffers(boolean combinableWithOtherOffers) Sets the combinableWithOtherOffers value for this offer.- Specified by:
setCombinableWithOtherOffersin interfaceOffer- Parameters:
combinableWithOtherOffers-
-
isAutomaticallyAdded
public boolean isAutomaticallyAdded()Description copied from interface:OfferReturns true if the offer system should automatically add this offer for consideration (versus requiring a code or other delivery mechanism). This does not guarantee that the offer will qualify. All rules associated with this offer must still pass. A true value here just means that the offer will be considered.Returns null if false
- Specified by:
isAutomaticallyAddedin interfaceOffer- Returns:
-
setAutomaticallyAdded
public void setAutomaticallyAdded(boolean automaticallyAdded) Description copied from interface:OfferSets whether or not this offer should be automatically considered for consideration (versus requiring a code or other delivery mechanism).- Specified by:
setAutomaticallyAddedin interfaceOffer- See Also:
-
getMaxUsesPerCustomer
Description copied from interface:OfferReturns the maximum number of times that this offer can be used by the same customer. This field tracks the number of times the offer can be used and not how many times it is applied.0 or null indicates unlimited usage per customer.
- Specified by:
getMaxUsesPerCustomerin interfaceOffer- Returns:
-
setMaxUsesPerCustomer
Description copied from interface:OfferSets the maximum number of times that this offer can be used by the same customer. Intended as a transient field that gets derived from the other persisted max uses fields including maxUsesPerOrder and maxUsesPerCustomer.0 or null indicates unlimited usage.
- Specified by:
setMaxUsesPerCustomerin interfaceOffer
-
getMaxUsesStrategyType
Description copied from interface:OfferEnum that allows implementations to vary how customer max uses will be interpreted. If null, the strategy will beCustomerMaxUsesStrategyType.CUSTOMER.- Specified by:
getMaxUsesStrategyTypein interfaceOffer- Returns:
-
setMaxUsesStrategyType
Description copied from interface:OfferSets the strategy for determining customer max uses.- Specified by:
setMaxUsesStrategyTypein interfaceOffer- See Also:
-
getMinimumDaysPerUsage
Description copied from interface:OfferSets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated byOffer.getMaxUsesPerCustomer().0 or null indicates that the offer will never reset usages.
- Specified by:
getMinimumDaysPerUsagein interfaceOffer- Returns:
-
setMinimumDaysPerUsage
Description copied from interface:OfferSets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated byOffer.getMaxUsesPerCustomer().0 or null indicates that the offer will never reset usages.
- Specified by:
setMinimumDaysPerUsagein interfaceOffer
-
isUnlimitedUsePerCustomer
public boolean isUnlimitedUsePerCustomer()Description copied from interface:OfferIndicates that there is no limit to how many times a customer can use this offer. By default this is true ifOffer.getMaxUsesPerCustomer()== 0- Specified by:
isUnlimitedUsePerCustomerin interfaceOffer
-
isLimitedUsePerCustomer
public boolean isLimitedUsePerCustomer()Description copied from interface:OfferWhether or not this offer has limited use in an order. By default this is true ifOffer.getMaxUsesPerCustomer()> 0- Specified by:
isLimitedUsePerCustomerin interfaceOffer
-
getMaxUsesPerOrder
public int getMaxUsesPerOrder()Description copied from interface:OfferReturns the maximum number of times that this offer can be used in the current order.0 indicates unlimited usage.
- Specified by:
getMaxUsesPerOrderin interfaceOffer
-
setMaxUsesPerOrder
public void setMaxUsesPerOrder(int maxUsesPerOrder) Description copied from interface:OfferSets the maximum number of times that this offer can be used in the current order.0 indicates unlimited usage.
- Specified by:
setMaxUsesPerOrderin interfaceOffer
-
isUnlimitedUsePerOrder
public boolean isUnlimitedUsePerOrder()Description copied from interface:OfferIndicates that there is no limit to how many times this offer can be applied to the order. By default this is true ifOffer.getMaxUsesPerOrder()== 0- Specified by:
isUnlimitedUsePerOrderin interfaceOffer
-
isLimitedUsePerOrder
public boolean isLimitedUsePerOrder()Description copied from interface:OfferWhether or not this offer has limited use in an order. By default this is true ifOffer.getMaxUsesPerOrder()> 0- Specified by:
isLimitedUsePerOrderin interfaceOffer
-
getMarketingMessage
- Specified by:
getMarketingMessagein interfaceOffer
-
setMarketingMessage
- Specified by:
setMarketingMessagein interfaceOffer
-
getQualifyingItemCriteriaXref
- Specified by:
getQualifyingItemCriteriaXrefin interfaceOffer
-
setQualifyingItemCriteriaXref
public void setQualifyingItemCriteriaXref(Set<OfferQualifyingCriteriaXref> qualifyingItemCriteriaXref) - Specified by:
setQualifyingItemCriteriaXrefin interfaceOffer
-
getTargetItemCriteriaXref
- Specified by:
getTargetItemCriteriaXrefin interfaceOffer
-
setTargetItemCriteriaXref
- Specified by:
setTargetItemCriteriaXrefin interfaceOffer
-
isTotalitarianOffer
- Specified by:
isTotalitarianOfferin interfaceOffer
-
setTotalitarianOffer
- Specified by:
setTotalitarianOfferin interfaceOffer
-
getOfferMatchRulesXref
- Specified by:
getOfferMatchRulesXrefin interfaceOffer
-
setOfferMatchRulesXref
- Specified by:
setOfferMatchRulesXrefin interfaceOffer
-
getUseListForDiscounts
- Specified by:
getUseListForDiscountsin interfaceOffer
-
setUseListForDiscounts
- Specified by:
setUseListForDiscountsin interfaceOffer
-
getOfferPriceData
- Specified by:
getOfferPriceDatain interfaceOffer
-
setOfferPriceData
- Specified by:
setOfferPriceDatain interfaceOffer
-
getArchived
- Specified by:
getArchivedin interfaceStatus
-
setArchived
- Specified by:
setArchivedin interfaceStatus
-
isActive
public boolean isActive() -
getQualifyingItemSubTotal
Description copied from interface:OfferIndicates the amount of items that must be purchased for this offer to be considered for this order.The system will find all qualifying items for the given offer and sum their prices before any discounts are applied to make the determination.
If the sum of the qualifying items is not greater than this value the offer is not considered by the offer processing algorithm.
- Specified by:
getQualifyingItemSubTotalin interfaceOffer- Returns:
-
setQualifyingItemSubTotal
- Specified by:
setQualifyingItemSubTotalin interfaceOffer
-
getOrderMinSubTotal
- Specified by:
getOrderMinSubTotalin interfaceOffer
-
setOrderMinSubTotal
- Specified by:
setOrderMinSubTotalin interfaceOffer
-
getTargetMinSubTotal
- Specified by:
getTargetMinSubTotalin interfaceOffer
-
setTargetMinSubTotal
- Specified by:
setTargetMinSubTotalin interfaceOffer
-
getOfferCodes
Description copied from interface:OfferReturns the offer codes that can be used to retrieve this Offer. These codes would be used in situations where this Offer is not automatically considered (meaningOffer.isAutomaticallyAdded()is false}- Specified by:
getOfferCodesin interfaceOffer
-
setOfferCodes
Description copied from interface:OfferSets the offer codes that can be used to retrieve this Offer. These codes would be used in situations where this Offer is not automatically considered (meaningOffer.isAutomaticallyAdded()is false}- Specified by:
setOfferCodesin interfaceOffer
-
getRequiresRelatedTargetAndQualifiers
- Specified by:
getRequiresRelatedTargetAndQualifiersin interfaceOffer
-
setRequiresRelatedTargetAndQualifiers
- Specified by:
setRequiresRelatedTargetAndQualifiersin interfaceOffer
-
getMainEntityName
- Specified by:
getMainEntityNamein interfaceAdminMainEntity
-
getAdjustmentType
Description copied from interface:OfferThis indicates how an Offer should be fulfilled to the customer, defaulting to order time discount. Currently, this enumeration can be ORDER_DISCOUNT or FUTURE_CREDIT. "Future credit" means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. The adjustment entities have a new "isFutureCredit" field used to determine if an adjustment originated from an offer marked as FUTURE_CREDIT. Order, OrderItem and FulfillmentGroup have new accessor methods for retrieving the future credit values when they are needed to be fulfilled.Out-of-box, this field is disabled from admin and must be manually enabled to view, since it is not a typical requirement to most implementations. To enable, add the following to AdminConfig.java:
- Specified by:
getAdjustmentTypein interfaceOffer- Returns:
-
setAdjustmentType
Description copied from interface:OfferThis indicates how an Offer should be fulfilled to the customer, defaulting to order time discount. Currently, this enumeration can be ORDER_DISCOUNT or FUTURE_CREDIT. "Future credit" means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. The adjustment entities have a new "isFutureCredit" field used to determine if an adjustment originated from an offer marked as FUTURE_CREDIT. Order, OrderItem and FulfillmentGroup have new accessor methods for retrieving the future credit values when they are needed to be fulfilled.Out-of-box, this field is disabled from admin and must be manually enabled to view, since it is not a typical requirement to most implementations. To enable, add the following to AdminConfig.java:
- Specified by:
setAdjustmentTypein interfaceOffer
-
isFutureCredit
public boolean isFutureCredit()Description copied from interface:OfferFuture credit means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. The adjustment entities have a new "isFutureCredit" field used to determine if an adjustment originated from an offer marked as FUTURE_CREDIT. Order, OrderItem and FulfillmentGroup have new accessor methods for retrieving the future credit values when they are needed to be fulfilled.See
Offer.getAdjustmentType()for more info- Specified by:
isFutureCreditin interfaceOffer- Returns:
-
hashCode
public int hashCode() -
equals
-
createOrRetrieveCopyInstance
public <G extends Offer> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException - Specified by:
createOrRetrieveCopyInstancein interfaceMultiTenantCloneable<Offer>- Throws:
CloneNotSupportedException
-