Interface PriceDataUsageDetailService<P extends PriceDataUsageDetail>
- Type Parameters:
P
- a domain P that extendsPriceDataUsageDetail
- 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 Summary
Modifier and TypeMethodDescriptionvoid
archiveAllByIds
(List<String> contextIds, String archivalReason, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Archives all thePriceDataUsageDetail
whose ids are given in the contextIds list.void
markRevertibleAllByIds
(@NonNull List<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible=true for all thePriceDataUsageDetail
whose ids are given in the contextIds list.int
purgeOutdatedPriceDataUsageDetails
(Duration outdatedPriceDataUsageDetailTimeout, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes allPriceDataUsageDetails
withPriceDataUsageDetail.getUsageDate()
before theoutdatedPriceDataUsageDetailTimeout
.org.springframework.data.domain.Page<P>
readAllByPriceDataIdIn
(Collection<String> priceDataIds, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) org.springframework.data.domain.Page<P>
readAllByTransactionReferenceTypeAndTransactionReferenceId
(@NonNull String transactionReferenceType, @NonNull String transactionReferenceId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads aPage
ofPriceDataUsageDetail
based on the transactionReferenceType and transactionReferenceId.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 ofPriceDataUsageDetail
that are "revertible"(revertible=true) and before the specified datevoid
updateRevertibleByReferenceId
(String transactionReferenceType, String transactionReferenceId, Boolean revertible, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible for thePriceDataUsageDetail
that matches criteriaMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
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 aPage
ofPriceDataUsageDetail
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 pagecontextInfo
- 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 thePriceDataUsageDetail
whose ids are given in the contextIds list.- Parameters:
contextIds
- the ids to deletearchivalReason
- the reason for archivalcontextInfo
- 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 thePriceDataUsageDetail
whose ids are given in the contextIds list.- Parameters:
contextIds
- the ids to markcontextInfo
- the context info
-
updateRevertibleByReferenceId
void updateRevertibleByReferenceId(String transactionReferenceType, String transactionReferenceId, Boolean revertible, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible for thePriceDataUsageDetail
that matches criteria- Parameters:
transactionReferenceType
- the transactionReferenceType to restrict querytransactionReferenceId
- the transactionReferenceId to restrict queryrevertible
- the value of revertible to setcontextInfo
- 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 thePriceData
page
- the pagecontextInfo
- the context info- Returns:
- Page of
PriceDataUsageDetail
-
purgeOutdatedPriceDataUsageDetails
int purgeOutdatedPriceDataUsageDetails(Duration outdatedPriceDataUsageDetailTimeout, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes allPriceDataUsageDetails
withPriceDataUsageDetail.getUsageDate()
before theoutdatedPriceDataUsageDetailTimeout
.Used for cleanup of obsolete data
- Parameters:
outdatedPriceDataUsageDetailTimeout
- the duration before which the data is to be clearedcontextInfo
- 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 ofPriceDataUsageDetail
that are "revertible"(revertible=true) and before the specified date- Parameters:
usageDateBefore
- - the date(instant) before usageDatepageable
- - page infocontextInfo
- - the context info- Returns:
- the page of
PriceDataUsageDetail
-