Class 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:
    Offer, Serialized Form
    • Constructor Detail

      • JpaOffer

        public JpaOffer()
    • Method Detail

      • fromMe

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

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

        public static org.modelmapper.Converter<SharedCode,​JpaSharedCode> sharedCodeValuesToSharedCodeEntities()
      • 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)
        Specified by:
        preFromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
      • getMinTotalOfQualifierPrices

        public javax.money.MonetaryAmount getMinTotalOfQualifierPrices()
      • 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)
      • 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:
        Offer.getId()
      • getCurrency

        public javax.money.CurrencyUnit getCurrency()
        Transient property that holds the currency used to convert price to a MonetaryAmount.
      • 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()
      • getActiveStartDate

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

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

        public boolean isDistributeOfferAmountToTargets()
      • getMaxUsesPerOrder

        public int getMaxUsesPerOrder()
        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()
      • getEstimatedValue

        public BigDecimal getEstimatedValue()
        Estimated value for this offer, used in scoring the best offer permutation for voucher and free gift offers.
        See Also:
        Offer.getEstimatedValue()
      • 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:
        Offer.getId()
      • setCurrency

        public void setCurrency​(javax.money.CurrencyUnit currency)
        Transient property that holds the currency used to convert price to a MonetaryAmount.
      • 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)
      • setDistributeOfferAmountToTargets

        public void setDistributeOfferAmountToTargets​(boolean distributeOfferAmountToTargets)
      • setMaxUsesPerOrder

        public void setMaxUsesPerOrder​(int maxUsesPerOrder)
        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:
        Offer.isFreeGift()
      • setVoucher

        public void setVoucher​(boolean voucher)
        See Also:
        Offer.isVoucher()
      • 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:
        Offer.getEstimatedValue()
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object