org.broadleafcommerce.core.offer.domain
Interface Offer

All Superinterfaces:
Serializable
All Known Implementing Classes:
OfferImpl

public interface Offer
extends Serializable


Method Summary
 String getAppliesToCustomerRules()
          Deprecated. 
 String getAppliesToOrderRules()
          Deprecated. 
 boolean getApplyDiscountToSalePrice()
           
 OfferDeliveryType getDeliveryType()
          Deprecated. Replaced by isAutomaticallyApplied property. In prior versions of Broadleaf deliveryType was used to differentiate "automatic" orders from those requiring a code. If the underlying property is null, this method will return a delivery type based on the isAutomatic property.
 String getDescription()
           
 OfferDiscountType getDiscountType()
           
 Date getEndDate()
           
 Long getId()
           
 String getMarketingMessage()
           
 int getMaxUses()
          Deprecated. use getMaxUsesPerOrder() directly instead
 Long getMaxUsesPerCustomer()
          Returns the maximum number of times that this offer can be used by the same customer.
 int getMaxUsesPerOrder()
          Returns the maximum number of times that this offer can be used in the current order.
 String getName()
           
 List<OfferCode> getOfferCodes()
          Returns the offer codes that can be used to retrieve this Offer.
 OfferItemRestrictionRuleType getOfferItemQualifierRuleType()
           
 OfferItemRestrictionRuleType getOfferItemTargetRuleType()
           
 Map<String,OfferRule> getOfferMatchRules()
           
 int getPriority()
           
 Set<OfferItemCriteria> getQualifyingItemCriteria()
           
 Money getQualifyingItemSubTotal()
          Indicates the amount of items that must be purchased for this offer to be considered for this order.
 Date getStartDate()
           
 Set<OfferItemCriteria> getTargetItemCriteria()
           
 String getTargetSystem()
           
 Boolean getTreatAsNewFormat()
           
 OfferType getType()
           
 int getUses()
          Deprecated. replaced by the OfferAudit table
 BigDecimal getValue()
           
 boolean isApplyDiscountToMarkedItems()
          Deprecated. 
 boolean isAutomaticallyAdded()
          Returns true if the offer system should automatically add this offer for consideration (versus requiring a code or other delivery mechanism).
 boolean isCombinableWithOtherOffers()
          Returns false if this offer is not combinable with other offers of the same type.
 boolean isLimitedUsePerCustomer()
          Whether or not this offer has limited use in an order.
 boolean isLimitedUsePerOrder()
          Whether or not this offer has limited use in an order.
 boolean isStackable()
          Deprecated. Use isCombinable instead.
 Boolean isTotalitarianOffer()
           
 boolean isUnlimitedUsePerCustomer()
          Indicates that there is no limit to how many times a customer can use this offer.
 boolean isUnlimitedUsePerOrder()
          Indicates that there is no limit to how many times this offer can be applied to the order.
 void setAppliesToCustomerRules(String appliesToCustomerRules)
          Deprecated. 
 void setAppliesToOrderRules(String appliesToRules)
          Deprecated. 
 void setApplyDiscountToMarkedItems(boolean applyDiscountToMarkedItems)
          Deprecated. 
 void setApplyDiscountToSalePrice(boolean applyToSalePrice)
           
 void setAutomaticallyAdded(boolean automaticallyAdded)
          Sets whether or not this offer should be automatically considered for consideration (versus requiring a code or other delivery mechanism).
 void setCombinableWithOtherOffers(boolean combinableWithOtherOffers)
           
 void setDeliveryType(OfferDeliveryType deliveryType)
          Deprecated. Replaced by setAutomaticallyApplied(boolean val).
 void setDescription(String description)
           
 void setDiscountType(OfferDiscountType type)
           
 void setEndDate(Date endDate)
           
 void setId(Long id)
           
 void setMarketingMessage(String marketingMessage)
           
 void setMaxUses(int maxUses)
          Deprecated. use setMaxUsesPerOrder(int) directly instead
 void setMaxUsesPerCustomer(Long maxUses)
          Sets the maximum number of times that this offer can be used by the same customer.
 void setMaxUsesPerOrder(int maxUsesPerOrder)
          Sets the maximum number of times that this offer can be used in the current order.
 void setName(String name)
           
 void setOfferCodes(List<OfferCode> offerCodes)
          Sets the offer codes that can be used to retrieve this Offer.
 void setOfferItemQualifierRuleType(OfferItemRestrictionRuleType restrictionRuleType)
           
 void setOfferItemTargetRuleType(OfferItemRestrictionRuleType restrictionRuleType)
           
 void setOfferMatchRules(Map<String,OfferRule> offerMatchRules)
           
 void setPriority(int priority)
           
 void setQualifyingItemCriteria(Set<OfferItemCriteria> qualifyingItemCriteria)
           
 void setQualifyingItemSubTotal(Money qualifyingItemSubtotal)
           
 void setStackable(boolean stackable)
          Deprecated. calls setCombinableWithOtherOffers(boolean)
 void setStartDate(Date startDate)
           
 void setTargetItemCriteria(Set<OfferItemCriteria> targetItemCriteria)
           
 void setTargetSystem(String targetSystem)
           
 void setTotalitarianOffer(Boolean totalitarianOffer)
           
 void setTreatAsNewFormat(Boolean treatAsNewFormat)
           
 void setType(OfferType offerType)
           
 void setUses(int uses)
          Deprecated. replaced by the OfferAudit table
 void setValue(BigDecimal value)
           
 

Method Detail

setId

void setId(Long id)

getId

Long getId()

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(int priority)

getStartDate

Date getStartDate()

setStartDate

void setStartDate(Date startDate)

getEndDate

Date getEndDate()

setEndDate

void setEndDate(Date endDate)

isStackable

@Deprecated
boolean isStackable()
Deprecated. Use isCombinable instead.

Returns:

setStackable

@Deprecated
void setStackable(boolean stackable)
Deprecated. calls setCombinableWithOtherOffers(boolean)

Parameters:
stackable -

getTargetSystem

String getTargetSystem()

setTargetSystem

void setTargetSystem(String targetSystem)

getApplyDiscountToSalePrice

boolean getApplyDiscountToSalePrice()

setApplyDiscountToSalePrice

void setApplyDiscountToSalePrice(boolean applyToSalePrice)

getAppliesToOrderRules

@Deprecated
String getAppliesToOrderRules()
Deprecated. 


setAppliesToOrderRules

@Deprecated
void setAppliesToOrderRules(String appliesToRules)
Deprecated. 


getAppliesToCustomerRules

@Deprecated
String getAppliesToCustomerRules()
Deprecated. 


setAppliesToCustomerRules

@Deprecated
void setAppliesToCustomerRules(String appliesToCustomerRules)
Deprecated. 


isApplyDiscountToMarkedItems

@Deprecated
boolean isApplyDiscountToMarkedItems()
Deprecated. 


setApplyDiscountToMarkedItems

@Deprecated
void setApplyDiscountToMarkedItems(boolean applyDiscountToMarkedItems)
Deprecated. 


getOfferItemQualifierRuleType

OfferItemRestrictionRuleType getOfferItemQualifierRuleType()

setOfferItemQualifierRuleType

void setOfferItemQualifierRuleType(OfferItemRestrictionRuleType restrictionRuleType)

getOfferItemTargetRuleType

OfferItemRestrictionRuleType getOfferItemTargetRuleType()

setOfferItemTargetRuleType

void setOfferItemTargetRuleType(OfferItemRestrictionRuleType restrictionRuleType)

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. For backwards compatibility, if the underlying property is null, this method will check the getDeliveryType() method and return true if that value is set to AUTOMATIC. If still null, this value will return 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:
isAutomaticallyAdded()

getDeliveryType

@Deprecated
OfferDeliveryType getDeliveryType()
Deprecated. Replaced by isAutomaticallyApplied property. In prior versions of Broadleaf deliveryType was used to differentiate "automatic" orders from those requiring a code. If the underlying property is null, this method will return a delivery type based on the isAutomatic property.

Returns:

setDeliveryType

@Deprecated
void setDeliveryType(OfferDeliveryType deliveryType)
Deprecated. Replaced by setAutomaticallyApplied(boolean val).

Parameters:
deliveryType -

getMaxUsesPerCustomer

@Nonnull
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 -

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


getMaxUses

@Deprecated
int getMaxUses()
Deprecated. use getMaxUsesPerOrder() directly instead

Returns the maximum number of times that this offer can be used in the current order. 0 indicates unlimited usage.


setMaxUses

@Deprecated
void setMaxUses(int maxUses)
Deprecated. use setMaxUsesPerOrder(int) directly instead

Sets the maximum number of times that this offer can be used in the current order. 0 indicates unlimited usage.


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:
maxUses -

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


getUses

@Deprecated
int getUses()
Deprecated. replaced by the OfferAudit table


setUses

@Deprecated
void setUses(int uses)
Deprecated. replaced by the OfferAudit table


getQualifyingItemCriteria

Set<OfferItemCriteria> getQualifyingItemCriteria()

setQualifyingItemCriteria

void setQualifyingItemCriteria(Set<OfferItemCriteria> qualifyingItemCriteria)

getTargetItemCriteria

Set<OfferItemCriteria> getTargetItemCriteria()

setTargetItemCriteria

void setTargetItemCriteria(Set<OfferItemCriteria> targetItemCriteria)

isTotalitarianOffer

Boolean isTotalitarianOffer()

setTotalitarianOffer

void setTotalitarianOffer(Boolean totalitarianOffer)

getOfferMatchRules

Map<String,OfferRule> getOfferMatchRules()

setOfferMatchRules

void setOfferMatchRules(Map<String,OfferRule> offerMatchRules)

getTreatAsNewFormat

Boolean getTreatAsNewFormat()

setTreatAsNewFormat

void setTreatAsNewFormat(Boolean treatAsNewFormat)

getQualifyingItemSubTotal

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(Money qualifyingItemSubtotal)

setMarketingMessage

void setMarketingMessage(String marketingMessage)

getMarketingMessage

String getMarketingMessage()

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}



Copyright © 2013. All Rights Reserved.