Class OfferAuditDaoImpl

java.lang.Object
org.broadleafcommerce.core.offer.dao.OfferAuditDaoImpl
All Implemented Interfaces:
OfferAuditDao

@Repository("blOfferAuditDao") public class OfferAuditDaoImpl extends Object implements OfferAuditDao
  • Field Details

    • LOG

      protected static final org.apache.commons.logging.Log LOG
    • em

      protected jakarta.persistence.EntityManager em
    • entityConfiguration

      protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
    • currentDateResolution

      protected Long currentDateResolution
    • cachedDate

      protected Date cachedDate
  • Constructor Details

    • OfferAuditDaoImpl

      public OfferAuditDaoImpl()
  • Method Details

    • getCurrentDateAfterFactoringInDateResolution

      protected Date getCurrentDateAfterFactoringInDateResolution()
    • create

      public OfferAudit create()
      Description copied from interface: OfferAuditDao
      Creates a new offer audit
      Specified by:
      create in interface OfferAuditDao
    • delete

      public void delete(OfferAudit offerAudit)
      Specified by:
      delete in interface OfferAuditDao
    • save

      public OfferAudit save(OfferAudit offerAudit)
      Description copied from interface: OfferAuditDao
      Persists an audit record to the database
      Specified by:
      save in interface OfferAuditDao
    • readAuditById

      public OfferAudit readAuditById(Long offerAuditId)
      Specified by:
      readAuditById in interface OfferAuditDao
    • countUsesByCustomer

      public Long countUsesByCustomer(Order order, Long customerId, Long offerId)
      Description copied from interface: OfferAuditDao
      Counts how many times the an offer has been used by a customer. This method will take into account if the Offer has already been applied to the Order so as not to prevent the Offer from applying to new items added to the Order by a CRS.
      Specified by:
      countUsesByCustomer in interface OfferAuditDao
      Returns:
      number of times and offer has been used by a customer
    • countUsesByAccount

      public Long countUsesByAccount(Order order, Long accountId, Long offerId)
      Description copied from interface: OfferAuditDao
      Counts how many times the an offer has been used by an account. This method will take into account if the Offer has already been applied to the Order so as not to prevent the Offer from applying to new items added to the Order by a CRS.
      Specified by:
      countUsesByAccount in interface OfferAuditDao
      Returns:
      number of times and offer has been used by a customer
    • countUsesByAccount

      public Long countUsesByAccount(Order order, Long accountId, Long offerId, Long minimumDaysPerUsage)
      Description copied from interface: OfferAuditDao
      Counts how many times the an offer has been used by an account (within the number of passed in days if provided). This method will take into account if the Offer has already been applied to the Order so as not to prevent the Offer from applying to new items added to the Order by a CRS.
      Specified by:
      countUsesByAccount in interface OfferAuditDao
      Returns:
      number of times and offer has been used by a customer
    • countUsesByCustomer

      public Long countUsesByCustomer(Order order, Long customerId, Long offerId, Long minimumDaysPerUsage)
      Description copied from interface: OfferAuditDao
      Counts how many times the an offer has been used by a customer (within the number of passed in days if provided). This method will take into account if the Offer has already been applied to the Order so as not to prevent the Offer from applying to new items added to the Order by a CRS.
      Specified by:
      countUsesByCustomer in interface OfferAuditDao
      Returns:
      number of times and offer has been used by a customer
    • countUsesByAccountOrCustomer

      protected Long countUsesByAccountOrCustomer(Order order, Long customerId, Long accountId, Long offerId, Long minimumDaysPerUsage)
    • getOmsOrderPredicate

      protected jakarta.persistence.criteria.Predicate getOmsOrderPredicate(jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<OrderImpl> orderRoot, jakarta.persistence.criteria.Join<Object,Object> parentOrder)
    • getOrderId

      protected Long getOrderId(Order order)
    • countUsesByCustomer

      @Deprecated public Long countUsesByCustomer(Long customerId, Long offerId)
      Deprecated.
      Description copied from interface: OfferAuditDao
      Counts how many times the an offer has been used by a customer
      Specified by:
      countUsesByCustomer in interface OfferAuditDao
      Returns:
      number of times and offer has been used by a customer
    • countOfferCodeUses

      public Long countOfferCodeUses(Order order, Long offerCodeId)
      Description copied from interface: OfferAuditDao
      Counts how many times the given offer code has been used in the system. This method will take into account if the OfferCode has already been applied to the Order so as not to prevent the OfferCODE from applying to new items added to the Order by a CRS.
      Specified by:
      countOfferCodeUses in interface OfferAuditDao
      Returns:
      number of times the offer code has been used
    • countOfferCodeUses

      @Deprecated public Long countOfferCodeUses(Long offerCodeId)
      Deprecated.
      Description copied from interface: OfferAuditDao
      Counts how many times the given offer code has been used in the system
      Specified by:
      countOfferCodeUses in interface OfferAuditDao
      Returns:
      number of times the offer code has been used
    • readOfferAuditsByOrderId

      public List<OfferAudit> readOfferAuditsByOrderId(Long orderId)
      Description copied from interface: OfferAuditDao
      Return all offer audits for a particular order
      Specified by:
      readOfferAuditsByOrderId in interface OfferAuditDao
      Returns:
    • getCurrentDateResolution

      public Long getCurrentDateResolution()
      Specified by:
      getCurrentDateResolution in interface OfferAuditDao
    • setCurrentDateResolution

      public void setCurrentDateResolution(Long currentDateResolution)
      Specified by:
      setCurrentDateResolution in interface OfferAuditDao