Interface Offer

All Superinterfaces:
org.broadleafcommerce.common.copy.MultiTenantCloneable<Offer>, Serializable, org.broadleafcommerce.common.persistence.Status
All Known Implementing Classes:
OfferImpl

public interface Offer extends org.broadleafcommerce.common.persistence.Status, Serializable, org.broadleafcommerce.common.copy.MultiTenantCloneable<Offer>
  • Method Details

    • getId

      Long getId()
    • setId

      void setId(Long id)
    • getName

      String getName()
    • setName

      void setName(String name)
    • getDescription

      String getDescription()
    • setDescription

      void setDescription(String description)
    • getType

      OfferType getType()
    • setType

      void setType(OfferType offerType)
    • getDiscountType

      OfferDiscountType getDiscountType()
    • setDiscountType

      void setDiscountType(OfferDiscountType type)
    • getValue

      BigDecimal getValue()
    • setValue

      void setValue(BigDecimal value)
    • getPriority

      int getPriority()
    • setPriority

      void setPriority(Integer priority)
    • getStartDate

      Date getStartDate()
    • setStartDate

      void setStartDate(Date startDate)
    • getEndDate

      Date getEndDate()
    • setEndDate

      void setEndDate(Date endDate)
    • getTargetSystem

      String getTargetSystem()
    • setTargetSystem

      void setTargetSystem(String targetSystem)
    • getApplyDiscountToSalePrice

      boolean getApplyDiscountToSalePrice()
    • setApplyDiscountToSalePrice

      void setApplyDiscountToSalePrice(boolean applyToSalePrice)
    • getOfferItemQualifierRuleType

      OfferItemRestrictionRuleType getOfferItemQualifierRuleType()
    • setOfferItemQualifierRuleType

      void setOfferItemQualifierRuleType(OfferItemRestrictionRuleType restrictionRuleType)
    • getOfferItemTargetRuleType

      OfferItemRestrictionRuleType getOfferItemTargetRuleType()
    • setOfferItemTargetRuleType

      void setOfferItemTargetRuleType(OfferItemRestrictionRuleType restrictionRuleType)
    • getApplyToChildItems

      Boolean getApplyToChildItems()
      Returns whether or not this offer should apply to an OrderItems child order items
      Returns:
      applyToChildItems
    • setApplyToChildItems

      void setApplyToChildItems(boolean applyToChildItems)
      Sets whether or not this offer should apply to an OrderItems child order items
      Parameters:
      applyToChildItems -
    • isCombinableWithOtherOffers

      boolean isCombinableWithOtherOffers()
      Returns false if this offer is not combinable with other offers of the same type. For example, if this is an Item offer it could be combined with other Order or FG offers but it cannot be combined with other Item offers.
      Returns:
    • setCombinableWithOtherOffers

      void setCombinableWithOtherOffers(boolean combinableWithOtherOffers)
    • isAutomaticallyAdded

      boolean isAutomaticallyAdded()
      Returns 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

      Returns:
    • setAutomaticallyAdded

      void setAutomaticallyAdded(boolean automaticallyAdded)
      Sets whether or not this offer should be automatically considered for consideration (versus requiring a code or other delivery mechanism).
      See Also:
    • getMaxUsesPerCustomer

      Long getMaxUsesPerCustomer()
      Returns 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.

      Returns:
    • setMaxUsesPerCustomer

      void setMaxUsesPerCustomer(Long maxUses)
      Sets 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.

      Parameters:
      maxUses -
    • getMaxUsesStrategyType

      CustomerMaxUsesStrategyType getMaxUsesStrategyType()
      Enum that allows implementations to vary how customer max uses will be interpreted. If null, the strategy will be CustomerMaxUsesStrategyType.CUSTOMER.
      Returns:
    • setMaxUsesStrategyType

      void setMaxUsesStrategyType(CustomerMaxUsesStrategyType strategyType)
      Sets the strategy for determining customer max uses.
      Parameters:
      strategyType -
      See Also:
    • getMinimumDaysPerUsage

      Long getMinimumDaysPerUsage()
      Sets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated by getMaxUsesPerCustomer().

      0 or null indicates that the offer will never reset usages.

      Returns:
    • setMinimumDaysPerUsage

      void setMinimumDaysPerUsage(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 by getMaxUsesPerCustomer().

      0 or null indicates that the offer will never reset usages.

      Parameters:
      minimumDaysPerUsage -
    • isUnlimitedUsePerCustomer

      boolean isUnlimitedUsePerCustomer()
      Indicates that there is no limit to how many times a customer can use this offer. By default this is true if getMaxUsesPerCustomer() == 0
    • isLimitedUsePerCustomer

      boolean isLimitedUsePerCustomer()
      Whether or not this offer has limited use in an order. By default this is true if getMaxUsesPerCustomer() > 0
    • getMaxUsesPerOrder

      int getMaxUsesPerOrder()
      Returns the maximum number of times that this offer can be used in the current order.

      0 indicates unlimited usage.

    • setMaxUsesPerOrder

      void setMaxUsesPerOrder(int maxUsesPerOrder)
      Sets the maximum number of times that this offer can be used in the current order.

      0 indicates unlimited usage.

      Parameters:
      maxUsesPerOrder -
    • isUnlimitedUsePerOrder

      boolean isUnlimitedUsePerOrder()
      Indicates that there is no limit to how many times this offer can be applied to the order. By default this is true if getMaxUsesPerOrder() == 0
    • isLimitedUsePerOrder

      boolean isLimitedUsePerOrder()
      Whether or not this offer has limited use in an order. By default this is true if getMaxUsesPerOrder() > 0
    • getQualifyingItemCriteriaXref

      Set<OfferQualifyingCriteriaXref> getQualifyingItemCriteriaXref()
    • setQualifyingItemCriteriaXref

      void setQualifyingItemCriteriaXref(Set<OfferQualifyingCriteriaXref> qualifyingItemCriteriaXref)
    • getTargetItemCriteriaXref

      Set<OfferTargetCriteriaXref> getTargetItemCriteriaXref()
    • setTargetItemCriteriaXref

      void setTargetItemCriteriaXref(Set<OfferTargetCriteriaXref> targetItemCriteriaXref)
    • isTotalitarianOffer

      Boolean isTotalitarianOffer()
    • setTotalitarianOffer

      void setTotalitarianOffer(Boolean totalitarianOffer)
    • getOfferMatchRulesXref

      Map<String,OfferOfferRuleXref> getOfferMatchRulesXref()
    • setOfferMatchRulesXref

      void setOfferMatchRulesXref(Map<String,OfferOfferRuleXref> offerMatchRulesXref)
    • getUseListForDiscounts

      Boolean getUseListForDiscounts()
    • setUseListForDiscounts

      void setUseListForDiscounts(Boolean useListForDiscounts)
    • getOfferPriceData

      List<OfferPriceData> getOfferPriceData()
    • setOfferPriceData

      void setOfferPriceData(List<OfferPriceData> offerPriceData)
    • getQualifyingItemSubTotal

      org.broadleafcommerce.common.money.Money getQualifyingItemSubTotal()
      Indicates 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.

      Returns:
    • setQualifyingItemSubTotal

      void setQualifyingItemSubTotal(org.broadleafcommerce.common.money.Money qualifyingItemSubtotal)
    • getOrderMinSubTotal

      org.broadleafcommerce.common.money.Money getOrderMinSubTotal()
    • setOrderMinSubTotal

      void setOrderMinSubTotal(org.broadleafcommerce.common.money.Money orderMinSubTotal)
    • getMarketingMessage

      String getMarketingMessage()
    • setMarketingMessage

      void setMarketingMessage(String marketingMessage)
    • getTargetMinSubTotal

      org.broadleafcommerce.common.money.Money getTargetMinSubTotal()
    • setTargetMinSubTotal

      void setTargetMinSubTotal(org.broadleafcommerce.common.money.Money targetMinSubTotal)
    • getOfferCodes

      List<OfferCode> getOfferCodes()
      Returns 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 (meaning isAutomaticallyAdded() is false}
    • setOfferCodes

      void setOfferCodes(List<OfferCode> offerCodes)
      Sets 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 (meaning isAutomaticallyAdded() is false}
    • getRequiresRelatedTargetAndQualifiers

      Boolean getRequiresRelatedTargetAndQualifiers()
    • setRequiresRelatedTargetAndQualifiers

      void setRequiresRelatedTargetAndQualifiers(Boolean requiresRelatedTargetAndQualifiers)
    • getAdjustmentType

      OfferAdjustmentType getAdjustmentType()
      This 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:

      Returns:
    • setAdjustmentType

      void setAdjustmentType(OfferAdjustmentType adjustmentType)
      This 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:

      Parameters:
      adjustmentType -
    • isFutureCredit

      boolean isFutureCredit()
      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.

      See getAdjustmentType() for more info

      Returns: