Interface OfferAuditService

All Known Implementing Classes:
OfferAuditServiceImpl

public interface OfferAuditService
Service for managing OfferAudits. An OfferAudit is used to track usage of an offer and offer code for a particular Order and Customer. This provides easy and fast tracking of verifying max uses on particular Offers.
Author:
Phillip Verheyden (phillipuniverse)
  • Method Details

    • readAuditById

      OfferAudit readAuditById(Long offerAuditId)
    • save

      OfferAudit save(OfferAudit offerAudit)
      Persists an audit record to the database
    • delete

      void delete(OfferAudit offerAudit)
    • create

      OfferAudit create()
      Creates a new offer audit
    • countUsesByCustomer

      Long countUsesByCustomer(Order order, Long customerId, Long offerId)
      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.
      Parameters:
      order -
      customerId -
      offerId -
      Returns:
      number of times and offer has been used by a customer
    • countUsesByCustomer

      Long countUsesByCustomer(Order order, Long customerId, Long offerId, Long minimumDaysPerUsage)
      Counts how many times the an offer has been used by a customer (within the passed in number of 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.
      Parameters:
      order -
      customerId -
      offerId -
      Returns:
      number of times and offer has been used by a customer
    • countUsesByAccount

      Long countUsesByAccount(Order order, Long accountId, Long offerId, Long minimumDaysPerUsage)
      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.
      Parameters:
      order -
      accountId -
      offerId -
      Returns:
      number of times and offer has been used by a customer
    • countUsesByCustomer

      Long countUsesByCustomer(Long customerId, Long offerId)
      Counts how many times the an offer has been used by a customer
      Parameters:
      customerId -
      offerId -
      Returns:
      number of times and offer has been used by a customer
    • countOfferCodeUses

      Long countOfferCodeUses(Order order, Long offerCodeId)
      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.
      Parameters:
      order -
      offerCodeId -
      Returns:
      number of times the offer code has been used
    • countOfferCodeUses

      @Deprecated Long countOfferCodeUses(Long offerCodeId)
      Counts how many times the given offer code has been used in the system
      Parameters:
      offerCodeId -
      Returns:
      number of times the offer code has been used
    • readOfferAuditsByOrderId

      List<OfferAudit> readOfferAuditsByOrderId(Long orderId)
      Read all audits by order id
      Parameters:
      orderId -
      Returns: