Interface PriceDataUsageDetailService<P extends PriceDataUsageDetail>

Type Parameters:
P - a domain P that extends PriceDataUsageDetail
All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
All Known Implementing Classes:
DefaultPriceDataUsageDetailService

public interface PriceDataUsageDetailService<P extends PriceDataUsageDetail> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Base service API for PriceDataUsageDetail. Backed by a PriceDataUsageDetailRepository.
Author:
karanjariwala
  • Method Details

    • readAllByTransactionReferenceTypeAndTransactionReferenceId

      org.springframework.data.domain.Page<P> readAllByTransactionReferenceTypeAndTransactionReferenceId(@NonNull @NonNull String transactionReferenceType, @NonNull @NonNull String transactionReferenceId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Reads a Page of PriceDataUsageDetail based on the transactionReferenceType and transactionReferenceId.
      Parameters:
      transactionReferenceType - the referenceType of the transaction (e.g. CART)
      transactionReferenceId - the referenceId of the transaction (e.g. cartId)
      page - the page
      contextInfo - the context info
      Returns:
      Page of PriceDataUsageDetail
    • archiveAllByIds

      void archiveAllByIds(List<String> contextIds, String archivalReason, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Archives all the PriceDataUsageDetail whose ids are given in the contextIds list.
      Parameters:
      contextIds - the ids to delete
      archivalReason - the reason for archival
      contextInfo - the context info
      See Also:
    • markRevertibleAllByIds

      void markRevertibleAllByIds(@NonNull @NonNull List<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Sets revertible=true for all the PriceDataUsageDetail whose ids are given in the contextIds list.
      Parameters:
      contextIds - the ids to mark
      contextInfo - the context info
    • updateRevertibleByReferenceId

      void updateRevertibleByReferenceId(String transactionReferenceType, String transactionReferenceId, Boolean revertible, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Sets revertible for the PriceDataUsageDetail that matches criteria
      Parameters:
      transactionReferenceType - the transactionReferenceType to restrict query
      transactionReferenceId - the transactionReferenceId to restrict query
      revertible - the value of revertible to set
      contextInfo - the context info
    • readAllByPriceDataIdIn

      org.springframework.data.domain.Page<P> readAllByPriceDataIdIn(Collection<String> priceDataIds, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Parameters:
      priceDataIds - the id of the PriceData
      page - the page
      contextInfo - the context info
      Returns:
      Page of PriceDataUsageDetail
    • purgeOutdatedPriceDataUsageDetails

      int purgeOutdatedPriceDataUsageDetails(Duration outdatedPriceDataUsageDetailTimeout, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deletes all PriceDataUsageDetails with PriceDataUsageDetail.getUsageDate() before the outdatedPriceDataUsageDetailTimeout.

      Used for cleanup of obsolete data

      Parameters:
      outdatedPriceDataUsageDetailTimeout - the duration before which the data is to be cleared
      contextInfo - the context info
      Returns:
      the number of rows deleted
    • readAllRevertibleOlderThan

      org.springframework.data.domain.Page<P> readAllRevertibleOlderThan(Instant usageDateBefore, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Fetches a page of PriceDataUsageDetail that are "revertible"(revertible=true) and before the specified date
      Parameters:
      usageDateBefore - - the date(instant) before usageDate
      pageable - - page info
      contextInfo - - the context info
      Returns:
      the page of PriceDataUsageDetail