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 Details

    • JpaOffer

      public JpaOffer()
  • Method Details

    • fromMe

      @NonNull public org.modelmapper.ModelMapper fromMe()
      Specified by:
      fromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • getGeneralMaxUsageStatus

      public String getGeneralMaxUsageStatus()
    • toMe

      @NonNull public org.modelmapper.ModelMapper toMe()
      Specified by:
      toMe in interface com.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

      public Class<?> getBusinessDomainType()
      Specified by:
      getBusinessDomainType in interface com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
    • getDisplay

      public Optional<String> getDisplay()
      Specified by:
      getDisplay in interface com.broadleafcommerce.data.tracking.core.Trackable
    • preFromMe

      public void preFromMe(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Object businessDomain)
      Sets resolvedCurrency from currency, resolves from ContextInfo if not provided.
      Specified by:
      preFromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
      Parameters:
      contextInfo - the ContextInfo to resolve the currency from
      businessDomain - 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

      public String get_id()
    • getContextId

      public String getContextId()
      Specified by:
      getContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
      Specified by:
      getContextId in interface com.broadleafcommerce.translation.domain.Translatable
      See Also:
    • getExternalId

      public String getExternalId()
    • getCurrency

      public javax.money.CurrencyUnit getCurrency()
      Note that this is different from the transient resolvedCurrency. The transient resolvedCurrency is used to convert fields such as cartSubtotal from BigDecimal into MonetaryAmount, 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 from ContextInfo

    • getName

      public String getName()
      See Also:
    • getDescription

      public String getDescription()
      See Also:
    • getCartLabel

      public String getCartLabel()
      See Also:
    • getTieredDiscount

      @Deprecated public Boolean getTieredDiscount()
      Deprecated.
      See Also:
    • getDiscountTiers

      public List<JpaDiscountTier> getDiscountTiers()
      See Also:
    • getDiscountAmount

      public BigDecimal getDiscountAmount()
    • getDiscountTargetType

      public String getDiscountTargetType()
    • getDiscountMethodType

      public String getDiscountMethodType()
    • getDiscountTimingType

      public String getDiscountTimingType()
    • getDiscountProrationType

      public String getDiscountProrationType()
    • isDiscountApplicableToSalesPrice

      public boolean isDiscountApplicableToSalesPrice()
    • isDiscountApplicableToDependentItems

      public boolean isDiscountApplicableToDependentItems()
    • getPriority

      public Long getPriority()
      See Also:
    • getActiveStartDate

      public Instant getActiveStartDate()
      Specified by:
      getActiveStartDate in interface com.broadleafcommerce.data.tracking.core.filtering.ActiveAware
      See Also:
    • getActiveEndDate

      public Instant getActiveEndDate()
      Specified by:
      getActiveEndDate in interface com.broadleafcommerce.data.tracking.core.filtering.ActiveAware
      See Also:
    • getCombinabilityOverrides

      public Set<JpaCombinabilityOverride> getCombinabilityOverrides()
      See Also:
    • getCampaignTrackingIds

      public Set<JpaCampaignTracking> getCampaignTrackingIds()
      See Also:
    • getCombinabilityType

      public String getCombinabilityType()
      See Also:
    • isStackable

      public boolean isStackable()
      See Also:
    • isAutomaticallyConsidered

      public boolean isAutomaticallyConsidered()
      See Also:
    • isPreferCartBundling

      public boolean isPreferCartBundling()
      See Also:
    • isDistributeOfferAmountToTargets

      public boolean isDistributeOfferAmountToTargets()
    • isRequiresRelatedTargetAndQualifiers

      public boolean isRequiresRelatedTargetAndQualifiers()
      See Also:
    • getQualifierItemCriteriaConnectiveOperator

      public String getQualifierItemCriteriaConnectiveOperator()
      See Also:
    • getQualifierItemCriteriaRules

      public Set<ItemCriteriaRule> getQualifierItemCriteriaRules()
      See Also:
    • isQualifiersCanBeQualifiers

      public boolean isQualifiersCanBeQualifiers()
      See Also:
    • isQualifiersCanBeTargets

      public boolean isQualifiersCanBeTargets()
      See Also:
    • getApplyDiscountToAllTargets

      public Boolean getApplyDiscountToAllTargets()
      See Also:
    • getExcludeDiscountedItemsFromTotals

      public Boolean getExcludeDiscountedItemsFromTotals()
      See Also:
    • getApplyRemainderToFulfillment

      public Boolean getApplyRemainderToFulfillment()
      See Also:
    • getTargetItemCriteriaConnectiveOperator

      public String getTargetItemCriteriaConnectiveOperator()
      See Also:
    • getTargetItemCriteriaRules

      public Set<ItemCriteriaRule> 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

      public String getMaxUsesPerUserStrategy()
      See Also:
    • getOrderCriteria

      public String getOrderCriteria()
      See Also:
    • getSegment

      public String getSegment()
      See Also:
    • getFulfillmentGroupCriteria

      public String getFulfillmentGroupCriteria()
      See Also:
    • getTimeCriteria

      public String getTimeCriteria()
      See Also:
    • isUseQtyOnlyTierCalculation

      public boolean isUseQtyOnlyTierCalculation()
      See Also:
    • isQualifyFulfillmentAcrossAllItems

      public boolean isQualifyFulfillmentAcrossAllItems()
      See Also:
    • getUserTargets

      public Set<JpaUserTarget> getUserTargets()
      See Also:
    • getTracking

      public com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking getTracking()
      Specified by:
      getTracking in interface com.broadleafcommerce.data.tracking.core.Trackable
    • isApplyToFuturePeriods

      public boolean isApplyToFuturePeriods()
    • isDiscountCurrentOrder

      public boolean isDiscountCurrentOrder()
    • getBeginPeriod

      public Integer getBeginPeriod()
    • getEndPeriod

      public Integer getEndPeriod()
    • getTargetGroupingStrategy

      public String getTargetGroupingStrategy()
    • getOfferDiscountStrategy

      public String getOfferDiscountStrategy()
    • isFreeGift

      public boolean isFreeGift()
      See Also:
    • getFreeProduct

      public String getFreeProduct()
      See Also:
    • isVoucher

      public boolean isVoucher()
      See Also:
    • getVoucherCampaign

      public String getVoucherCampaign()
      See Also:
    • getEstimatedValue

      public BigDecimal getEstimatedValue()
      Estimated value for this offer, used in scoring the best offer permutation for voucher and free gift offers.
      See Also:
    • getAttributes

      public Map<String,JpaAttribute> getAttributes()
    • getFulfillmentServiceLevel

      public String getFulfillmentServiceLevel()
      See Also:
    • set_id

      public void set_id(String _id)
    • setContextId

      public void setContextId(String contextId)
      Specified by:
      setContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
      See Also:
    • setExternalId

      public void setExternalId(String externalId)
    • setCurrency

      public void setCurrency(javax.money.CurrencyUnit currency)
      Note that this is different from the transient resolvedCurrency. The transient resolvedCurrency is used to convert fields such as cartSubtotal from BigDecimal into MonetaryAmount, 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 from ContextInfo

    • setName

      public void setName(String name)
      See Also:
    • setDescription

      public void setDescription(String description)
      See Also:
    • setCartLabel

      public void setCartLabel(String cartLabel)
      See Also:
    • setTieredDiscount

      @Deprecated public void setTieredDiscount(Boolean tieredDiscount)
      Deprecated.
      See Also:
    • setDiscountTiers

      public void setDiscountTiers(List<JpaDiscountTier> discountTiers)
      See Also:
    • setDiscountAmount

      public void setDiscountAmount(BigDecimal discountAmount)
    • setDiscountTargetType

      public void setDiscountTargetType(String discountTargetType)
    • setDiscountMethodType

      public void setDiscountMethodType(String discountMethodType)
    • setDiscountTimingType

      public void setDiscountTimingType(String discountTimingType)
    • setDiscountProrationType

      public void setDiscountProrationType(String discountProrationType)
    • setDiscountApplicableToSalesPrice

      public void setDiscountApplicableToSalesPrice(boolean discountApplicableToSalesPrice)
    • setDiscountApplicableToDependentItems

      public void setDiscountApplicableToDependentItems(boolean discountApplicableToDependentItems)
    • setPriority

      public void setPriority(Long priority)
      See Also:
    • setActiveStartDate

      public void setActiveStartDate(Instant activeStartDate)
      See Also:
    • setActiveEndDate

      public void setActiveEndDate(Instant activeEndDate)
      See Also:
    • setCombinabilityOverrides

      public void setCombinabilityOverrides(Set<JpaCombinabilityOverride> combinabilityOverrides)
      See Also:
    • setCampaignTrackingIds

      public void setCampaignTrackingIds(Set<JpaCampaignTracking> campaignTrackingIds)
      See Also:
    • setCombinabilityType

      public void setCombinabilityType(String combinabilityType)
      See Also:
    • setStackable

      public void setStackable(boolean stackable)
      See Also:
    • setAutomaticallyConsidered

      public void setAutomaticallyConsidered(boolean automaticallyConsidered)
      See Also:
    • setPreferCartBundling

      public void setPreferCartBundling(boolean preferCartBundling)
      See Also:
    • setDistributeOfferAmountToTargets

      public void setDistributeOfferAmountToTargets(boolean distributeOfferAmountToTargets)
    • setRequiresRelatedTargetAndQualifiers

      public void setRequiresRelatedTargetAndQualifiers(boolean requiresRelatedTargetAndQualifiers)
      See Also:
    • setQualifierItemCriteriaConnectiveOperator

      public void setQualifierItemCriteriaConnectiveOperator(String qualifierItemCriteriaConnectiveOperator)
      See Also:
    • setQualifierItemCriteriaRules

      public void setQualifierItemCriteriaRules(Set<ItemCriteriaRule> qualifierItemCriteriaRules)
      See Also:
    • setQualifiersCanBeQualifiers

      public void setQualifiersCanBeQualifiers(boolean qualifiersCanBeQualifiers)
      See Also:
    • setQualifiersCanBeTargets

      public void setQualifiersCanBeTargets(boolean qualifiersCanBeTargets)
      See Also:
    • setApplyDiscountToAllTargets

      public void setApplyDiscountToAllTargets(Boolean applyDiscountToAllTargets)
      See Also:
    • setExcludeDiscountedItemsFromTotals

      public void setExcludeDiscountedItemsFromTotals(Boolean excludeDiscountedItemsFromTotals)
      See Also:
    • setApplyRemainderToFulfillment

      public void setApplyRemainderToFulfillment(Boolean applyRemainderToFulfillment)
      See Also:
    • setTargetItemCriteriaConnectiveOperator

      public void setTargetItemCriteriaConnectiveOperator(String targetItemCriteriaConnectiveOperator)
      See Also:
    • setTargetItemCriteriaRules

      public void setTargetItemCriteriaRules(Set<ItemCriteriaRule> targetItemCriteriaRules)
      See Also:
    • setMaxUses

      public void setMaxUses(int maxUses)
      See Also:
    • setGeneralMaxUsageStatus

      public void setGeneralMaxUsageStatus(String generalMaxUsageStatus)
      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

      public void setMaxUsesPerUserStrategy(String maxUsesPerUserStrategy)
      See Also:
    • setOrderCriteria

      public void setOrderCriteria(String orderCriteria)
      See Also:
    • setSegment

      public void setSegment(String segment)
      See Also:
    • setFulfillmentGroupCriteria

      public void setFulfillmentGroupCriteria(String fulfillmentGroupCriteria)
      See Also:
    • setTimeCriteria

      public void setTimeCriteria(String timeCriteria)
      See Also:
    • setUseQtyOnlyTierCalculation

      public void setUseQtyOnlyTierCalculation(boolean useQtyOnlyTierCalculation)
      See Also:
    • setQualifyFulfillmentAcrossAllItems

      public void setQualifyFulfillmentAcrossAllItems(boolean qualifyFulfillmentAcrossAllItems)
      See Also:
    • setUserTargets

      public void setUserTargets(Set<JpaUserTarget> userTargets)
      See Also:
    • setTracking

      public void setTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking)
      Specified by:
      setTracking in interface com.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

      public void setBeginPeriod(Integer beginPeriod)
    • setEndPeriod

      public void setEndPeriod(Integer endPeriod)
    • setTargetGroupingStrategy

      public void setTargetGroupingStrategy(String targetGroupingStrategy)
    • setOfferDiscountStrategy

      public void setOfferDiscountStrategy(String offerDiscountStrategy)
    • setFreeGift

      public void setFreeGift(boolean freeGift)
      See Also:
    • setFreeProduct

      public void setFreeProduct(String freeProduct)
      See Also:
    • setVoucher

      public void setVoucher(boolean voucher)
      See Also:
    • setVoucherCampaign

      public void setVoucherCampaign(String voucherCampaign)
      See Also:
    • setEstimatedValue

      public void setEstimatedValue(BigDecimal estimatedValue)
      Estimated value for this offer, used in scoring the best offer permutation for voucher and free gift offers.
      See Also:
    • setAttributes

      public void setAttributes(Map<String,JpaAttribute> attributes)
    • setFulfillmentServiceLevel

      public void setFulfillmentServiceLevel(String fulfillmentServiceLevel)
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object