Class JpaOffer
java.lang.Object
com.broadleafcommerce.promotion.offer.provider.jpa.domain.JpaOffer
- All Implemented Interfaces:
com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
,com.broadleafcommerce.data.tracking.core.ApplicationTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
,com.broadleafcommerce.data.tracking.core.filtering.ActiveAware
,com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
,com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
,com.broadleafcommerce.data.tracking.core.Trackable
,com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
,com.broadleafcommerce.translation.domain.Translatable
,Serializable
@Entity
public class JpaOffer
extends Object
implements com.broadleafcommerce.data.tracking.core.ApplicationTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, Serializable, com.broadleafcommerce.translation.domain.Translatable, com.broadleafcommerce.data.tracking.core.filtering.ActiveAware
Persistent counter-part to a
Offer
for use with a Jpa datastore.- Author:
- Nathan Moore (nathanmoore).
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static org.modelmapper.Converter<CombinabilityOverride,
JpaCombinabilityOverride> boolean
org.modelmapper.ModelMapper
fromMe()
get_id()
Class<?>
javax.money.MonetaryAmount
javax.money.CurrencyUnit
Note that this is different from the transientresolvedCurrency
.protected javax.money.CurrencyUnit
getCurrencyFromLocale
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Estimated value for this offer, used in scoring the best offer permutation for voucher and free gift offers.javax.money.MonetaryAmount
javax.money.MonetaryAmount
javax.money.MonetaryAmount
int
int
int
int
javax.money.MonetaryAmount
javax.money.MonetaryAmount
getName()
javax.money.CurrencyUnit
Transient property that holds the currency used to convert price to a MonetaryAmount.Deprecated.com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking
int
hashCode()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
static org.modelmapper.Converter<OfferCode,
JpaOfferCode> void
preFromMe
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Object businessDomain) SetsresolvedCurrency
fromcurrency
, resolves fromContextInfo
if not provided.void
void
setActiveEndDate
(Instant activeEndDate) void
setActiveStartDate
(Instant activeStartDate) void
setApplyDiscountToAllTargets
(Boolean applyDiscountToAllTargets) void
setApplyRemainderToFulfillment
(Boolean applyRemainderToFulfillment) void
setApplyToFuturePeriods
(boolean applyToFuturePeriods) void
setAttributes
(Map<String, JpaAttribute> attributes) void
setAutomaticallyConsidered
(boolean automaticallyConsidered) void
setBeginPeriod
(Integer beginPeriod) void
setCampaignTrackingIds
(Set<JpaCampaignTracking> campaignTrackingIds) void
setCartLabel
(String cartLabel) void
setCartSubtotal
(javax.money.MonetaryAmount cartSubtotal) void
setCombinabilityOverrides
(Set<JpaCombinabilityOverride> combinabilityOverrides) void
setCombinabilityType
(String combinabilityType) void
setContextId
(String contextId) void
setCurrency
(javax.money.CurrencyUnit currency) Note that this is different from the transientresolvedCurrency
.void
setDescription
(String description) void
setDiscountAmount
(BigDecimal discountAmount) void
setDiscountApplicableToDependentItems
(boolean discountApplicableToDependentItems) void
setDiscountApplicableToSalesPrice
(boolean discountApplicableToSalesPrice) void
setDiscountCurrentOrder
(boolean discountCurrentOrder) void
setDiscountMethodType
(String discountMethodType) void
setDiscountProrationType
(String discountProrationType) void
setDiscountTargetType
(String discountTargetType) void
setDiscountTiers
(List<JpaDiscountTier> discountTiers) void
setDiscountTimingType
(String discountTimingType) void
setDistributeOfferAmountToTargets
(boolean distributeOfferAmountToTargets) void
setEndPeriod
(Integer endPeriod) void
setEstimatedValue
(BigDecimal estimatedValue) Estimated value for this offer, used in scoring the best offer permutation for voucher and free gift offers.void
setExcludeDiscountedItemsFromTotals
(Boolean excludeDiscountedItemsFromTotals) void
setExternalId
(String externalId) void
setFgItemSubtotal
(javax.money.MonetaryAmount fgItemSubtotal) void
setFreeGift
(boolean freeGift) void
setFreeProduct
(String freeProduct) void
setFulfillmentGroupCriteria
(String fulfillmentGroupCriteria) void
setFulfillmentServiceLevel
(String fulfillmentServiceLevel) void
setGeneralMaxUsageStatus
(String generalMaxUsageStatus) void
setMaxSavingsPerOrder
(javax.money.MonetaryAmount maxSavingsPerOrder) void
setMaxTotalDiscount
(javax.money.MonetaryAmount maxTotalDiscount) void
setMaxUses
(int maxUses) void
setMaxUsesPerOrder
(int maxUsesPerOrder) void
setMaxUsesPerUser
(int maxUsesPerUser) void
setMaxUsesPerUserFrequency
(int maxUsesPerUserFrequency) void
setMaxUsesPerUserStrategy
(String maxUsesPerUserStrategy) void
setMinTotalOfQualifierPrices
(javax.money.MonetaryAmount minTotalOfQualifierPrices) void
setMinTotalOfTargetPrices
(javax.money.MonetaryAmount minTotalOfTargetPrices) void
void
setOfferDiscountStrategy
(String offerDiscountStrategy) void
setOrderCriteria
(String orderCriteria) void
setPreferCartBundling
(boolean preferCartBundling) void
setPriority
(Long priority) void
setQualifierItemCriteriaConnectiveOperator
(String qualifierItemCriteriaConnectiveOperator) void
setQualifierItemCriteriaRules
(Set<ItemCriteriaRule> qualifierItemCriteriaRules) void
setQualifiersCanBeQualifiers
(boolean qualifiersCanBeQualifiers) void
setQualifiersCanBeTargets
(boolean qualifiersCanBeTargets) void
setQualifyFulfillmentAcrossAllItems
(boolean qualifyFulfillmentAcrossAllItems) void
setRequiresRelatedTargetAndQualifiers
(boolean requiresRelatedTargetAndQualifiers) void
setResolvedCurrency
(javax.money.CurrencyUnit resolvedCurrency) Transient property that holds the currency used to convert price to a MonetaryAmount.void
setSegment
(String segment) void
setStackable
(boolean stackable) void
setTargetGroupingStrategy
(String targetGroupingStrategy) void
setTargetItemCriteriaConnectiveOperator
(String targetItemCriteriaConnectiveOperator) void
setTargetItemCriteriaRules
(Set<ItemCriteriaRule> targetItemCriteriaRules) void
setTieredDiscount
(Boolean tieredDiscount) Deprecated.void
setTimeCriteria
(String timeCriteria) void
setTracking
(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking) void
setUseQtyOnlyTierCalculation
(boolean useQtyOnlyTierCalculation) void
setUserTargets
(Set<JpaUserTarget> userTargets) void
setVoucher
(boolean voucher) void
setVoucherCampaign
(String voucherCampaign) org.modelmapper.ModelMapper
toMe()
toString()
static org.modelmapper.Converter<String,
JpaCampaignTracking> static org.modelmapper.Converter<UserTarget,
JpaUserTarget> Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preToMe
Methods inherited from interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
findNotificationState
Methods inherited from interface com.broadleafcommerce.data.tracking.core.Trackable
getNotificationStates, getNotificationStates, setNotificationStates
Methods inherited from interface com.broadleafcommerce.data.tracking.core.TypedTrackable
setTracking
-
Constructor Details
-
JpaOffer
public JpaOffer()
-
-
Method Details
-
fromMe
@NonNull public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
getGeneralMaxUsageStatus
-
toMe
@NonNull public org.modelmapper.ModelMapper toMe()- Specified by:
toMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
combinabilityOverrideValuesToCombinabilityOverrideEntities
public static org.modelmapper.Converter<CombinabilityOverride,JpaCombinabilityOverride> combinabilityOverrideValuesToCombinabilityOverrideEntities() -
offerCodeValuesToOfferCodeEntities
public static org.modelmapper.Converter<OfferCode,JpaOfferCode> offerCodeValuesToOfferCodeEntities() -
userTargetValuesToUserTargetEntities
public static org.modelmapper.Converter<UserTarget,JpaUserTarget> userTargetValuesToUserTargetEntities() -
trackingValuesToTrackingEntities
public static org.modelmapper.Converter<String,JpaCampaignTracking> trackingValuesToTrackingEntities() -
getBusinessDomainType
- Specified by:
getBusinessDomainType
in interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getDisplay
- Specified by:
getDisplay
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
-
preFromMe
public void preFromMe(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Object businessDomain) SetsresolvedCurrency
fromcurrency
, resolves fromContextInfo
if not provided.- Specified by:
preFromMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
- Parameters:
contextInfo
- theContextInfo
to resolve the currency frombusinessDomain
- the business domain
-
getCurrencyFromLocale
protected javax.money.CurrencyUnit getCurrencyFromLocale(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getMinTotalOfQualifierPrices
public javax.money.MonetaryAmount getMinTotalOfQualifierPrices() -
getMaxTotalDiscount
public javax.money.MonetaryAmount getMaxTotalDiscount() -
setMaxTotalDiscount
public void setMaxTotalDiscount(javax.money.MonetaryAmount maxTotalDiscount) -
getMinTotalOfTargetPrices
public javax.money.MonetaryAmount getMinTotalOfTargetPrices() -
setMinTotalOfTargetPrices
public void setMinTotalOfTargetPrices(javax.money.MonetaryAmount minTotalOfTargetPrices) -
getCartSubtotal
public javax.money.MonetaryAmount getCartSubtotal() -
setCartSubtotal
public void setCartSubtotal(javax.money.MonetaryAmount cartSubtotal) -
getFgItemSubtotal
public javax.money.MonetaryAmount getFgItemSubtotal() -
setFgItemSubtotal
public void setFgItemSubtotal(javax.money.MonetaryAmount fgItemSubtotal) -
setMinTotalOfQualifierPrices
public void setMinTotalOfQualifierPrices(javax.money.MonetaryAmount minTotalOfQualifierPrices) -
getMaxSavingsPerOrder
public javax.money.MonetaryAmount getMaxSavingsPerOrder() -
setMaxSavingsPerOrder
public void setMaxSavingsPerOrder(javax.money.MonetaryAmount maxSavingsPerOrder) -
get_id
-
getContextId
- Specified by:
getContextId
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
- Specified by:
getContextId
in interfacecom.broadleafcommerce.translation.domain.Translatable
- See Also:
-
getExternalId
-
getCurrency
public javax.money.CurrencyUnit getCurrency()Note that this is different from the transientresolvedCurrency
. The transientresolvedCurrency
is used to convert fields such ascartSubtotal
fromBigDecimal
intoMonetaryAmount
, whereas this currency specifies which currency the offer can be applied to.- See Also:
-
getResolvedCurrency
public javax.money.CurrencyUnit getResolvedCurrency()Transient property that holds the currency used to convert price to a MonetaryAmount.Same as
currency
if it is provided, otherwise it's resolved fromContextInfo
-
getName
- See Also:
-
getDescription
- See Also:
-
getCartLabel
- See Also:
-
getTieredDiscount
Deprecated.- See Also:
-
getDiscountTiers
- See Also:
-
getDiscountAmount
-
getDiscountTargetType
-
getDiscountMethodType
-
getDiscountTimingType
-
getDiscountProrationType
-
isDiscountApplicableToSalesPrice
public boolean isDiscountApplicableToSalesPrice() -
isDiscountApplicableToDependentItems
public boolean isDiscountApplicableToDependentItems() -
getPriority
- See Also:
-
getActiveStartDate
- Specified by:
getActiveStartDate
in interfacecom.broadleafcommerce.data.tracking.core.filtering.ActiveAware
- See Also:
-
getActiveEndDate
- Specified by:
getActiveEndDate
in interfacecom.broadleafcommerce.data.tracking.core.filtering.ActiveAware
- See Also:
-
getCombinabilityOverrides
- See Also:
-
getCampaignTrackingIds
- See Also:
-
getCombinabilityType
- See Also:
-
isStackable
public boolean isStackable()- See Also:
-
isAutomaticallyConsidered
public boolean isAutomaticallyConsidered()- See Also:
-
isPreferCartBundling
public boolean isPreferCartBundling() -
isDistributeOfferAmountToTargets
public boolean isDistributeOfferAmountToTargets() -
isRequiresRelatedTargetAndQualifiers
public boolean isRequiresRelatedTargetAndQualifiers() -
getQualifierItemCriteriaConnectiveOperator
- See Also:
-
getQualifierItemCriteriaRules
- See Also:
-
isQualifiersCanBeQualifiers
public boolean isQualifiersCanBeQualifiers()- See Also:
-
isQualifiersCanBeTargets
public boolean isQualifiersCanBeTargets()- See Also:
-
getApplyDiscountToAllTargets
- See Also:
-
getExcludeDiscountedItemsFromTotals
-
getApplyRemainderToFulfillment
- See Also:
-
getTargetItemCriteriaConnectiveOperator
- See Also:
-
getTargetItemCriteriaRules
- See Also:
-
getMaxUses
public int getMaxUses()- See Also:
-
getMaxUsesPerOrder
public int getMaxUsesPerOrder()- See Also:
-
getMaxUsesPerUser
public int getMaxUsesPerUser()- See Also:
-
getMaxUsesPerUserFrequency
public int getMaxUsesPerUserFrequency()- See Also:
-
getMaxUsesPerUserStrategy
- See Also:
-
getOrderCriteria
- See Also:
-
getSegment
- See Also:
-
getFulfillmentGroupCriteria
- See Also:
-
getTimeCriteria
- See Also:
-
isUseQtyOnlyTierCalculation
public boolean isUseQtyOnlyTierCalculation()- See Also:
-
isQualifyFulfillmentAcrossAllItems
public boolean isQualifyFulfillmentAcrossAllItems() -
getUserTargets
- See Also:
-
getTracking
public com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking getTracking()- Specified by:
getTracking
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
-
isApplyToFuturePeriods
public boolean isApplyToFuturePeriods() -
isDiscountCurrentOrder
public boolean isDiscountCurrentOrder() -
getBeginPeriod
-
getEndPeriod
-
getTargetGroupingStrategy
-
getOfferDiscountStrategy
-
isFreeGift
public boolean isFreeGift()- See Also:
-
getFreeProduct
- See Also:
-
isVoucher
public boolean isVoucher()- See Also:
-
getVoucherCampaign
- See Also:
-
getEstimatedValue
Estimated value for this offer, used in scoring the best offer permutation for voucher and free gift offers.- See Also:
-
getAttributes
-
getFulfillmentServiceLevel
- See Also:
-
set_id
-
setContextId
- Specified by:
setContextId
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
- See Also:
-
setExternalId
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) Note that this is different from the transientresolvedCurrency
. The transientresolvedCurrency
is used to convert fields such ascartSubtotal
fromBigDecimal
intoMonetaryAmount
, whereas this currency specifies which currency the offer can be applied to.- See Also:
-
setResolvedCurrency
public void setResolvedCurrency(javax.money.CurrencyUnit resolvedCurrency) Transient property that holds the currency used to convert price to a MonetaryAmount.Same as
currency
if it is provided, otherwise it's resolved fromContextInfo
-
setName
- See Also:
-
setDescription
- See Also:
-
setCartLabel
- See Also:
-
setTieredDiscount
Deprecated.- See Also:
-
setDiscountTiers
- See Also:
-
setDiscountAmount
-
setDiscountTargetType
-
setDiscountMethodType
-
setDiscountTimingType
-
setDiscountProrationType
-
setDiscountApplicableToSalesPrice
public void setDiscountApplicableToSalesPrice(boolean discountApplicableToSalesPrice) -
setDiscountApplicableToDependentItems
public void setDiscountApplicableToDependentItems(boolean discountApplicableToDependentItems) -
setPriority
- See Also:
-
setActiveStartDate
- See Also:
-
setActiveEndDate
- See Also:
-
setCombinabilityOverrides
- See Also:
-
setCampaignTrackingIds
- See Also:
-
setCombinabilityType
- See Also:
-
setStackable
public void setStackable(boolean stackable) - See Also:
-
setAutomaticallyConsidered
public void setAutomaticallyConsidered(boolean automaticallyConsidered) - See Also:
-
setPreferCartBundling
public void setPreferCartBundling(boolean preferCartBundling) -
setDistributeOfferAmountToTargets
public void setDistributeOfferAmountToTargets(boolean distributeOfferAmountToTargets) -
setRequiresRelatedTargetAndQualifiers
public void setRequiresRelatedTargetAndQualifiers(boolean requiresRelatedTargetAndQualifiers) -
setQualifierItemCriteriaConnectiveOperator
public void setQualifierItemCriteriaConnectiveOperator(String qualifierItemCriteriaConnectiveOperator) - See Also:
-
setQualifierItemCriteriaRules
- See Also:
-
setQualifiersCanBeQualifiers
public void setQualifiersCanBeQualifiers(boolean qualifiersCanBeQualifiers) - See Also:
-
setQualifiersCanBeTargets
public void setQualifiersCanBeTargets(boolean qualifiersCanBeTargets) - See Also:
-
setApplyDiscountToAllTargets
- See Also:
-
setExcludeDiscountedItemsFromTotals
-
setApplyRemainderToFulfillment
- See Also:
-
setTargetItemCriteriaConnectiveOperator
- See Also:
-
setTargetItemCriteriaRules
- See Also:
-
setMaxUses
public void setMaxUses(int maxUses) - See Also:
-
setGeneralMaxUsageStatus
- See Also:
-
setMaxUsesPerOrder
public void setMaxUsesPerOrder(int maxUsesPerOrder) - See Also:
-
setMaxUsesPerUser
public void setMaxUsesPerUser(int maxUsesPerUser) - See Also:
-
setMaxUsesPerUserFrequency
public void setMaxUsesPerUserFrequency(int maxUsesPerUserFrequency) - See Also:
-
setMaxUsesPerUserStrategy
- See Also:
-
setOrderCriteria
- See Also:
-
setSegment
- See Also:
-
setFulfillmentGroupCriteria
- See Also:
-
setTimeCriteria
- See Also:
-
setUseQtyOnlyTierCalculation
public void setUseQtyOnlyTierCalculation(boolean useQtyOnlyTierCalculation) - See Also:
-
setQualifyFulfillmentAcrossAllItems
public void setQualifyFulfillmentAcrossAllItems(boolean qualifyFulfillmentAcrossAllItems) -
setUserTargets
- See Also:
-
setTracking
public void setTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking) - Specified by:
setTracking
in interfacecom.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
-
setApplyToFuturePeriods
public void setApplyToFuturePeriods(boolean applyToFuturePeriods) -
setDiscountCurrentOrder
public void setDiscountCurrentOrder(boolean discountCurrentOrder) -
setBeginPeriod
-
setEndPeriod
-
setTargetGroupingStrategy
-
setOfferDiscountStrategy
-
setFreeGift
public void setFreeGift(boolean freeGift) - See Also:
-
setFreeProduct
- See Also:
-
setVoucher
public void setVoucher(boolean voucher) - See Also:
-
setVoucherCampaign
- See Also:
-
setEstimatedValue
Estimated value for this offer, used in scoring the best offer permutation for voucher and free gift offers.- See Also:
-
setAttributes
-
setFulfillmentServiceLevel
- See Also:
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-