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 TypeMethodDescriptionvoidarchiveAllByIds(List<String> contextIds, String archivalReason, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Archives all thePriceDataUsageDetailwhose ids are given in the contextIds list.voidmarkRevertibleAllByIds(@NonNull List<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible=true for all thePriceDataUsageDetailwhose ids are given in the contextIds list.intpurgeOutdatedPriceDataUsageDetails(Duration outdatedPriceDataUsageDetailTimeout, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes allPriceDataUsageDetailswithPriceDataUsageDetail.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 aPageofPriceDataUsageDetailbased 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 ofPriceDataUsageDetailthat are "revertible"(revertible=true) and before the specified datevoidupdateRevertibleByReferenceId(String transactionReferenceType, String transactionReferenceId, Boolean revertible, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible for thePriceDataUsageDetailthat 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, updateSortMethods 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 aPageofPriceDataUsageDetailbased 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 thePriceDataUsageDetailwhose 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 thePriceDataUsageDetailwhose 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 thePriceDataUsageDetailthat 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 thePriceDatapage- the pagecontextInfo- the context info- Returns:
- Page of
PriceDataUsageDetail
-
purgeOutdatedPriceDataUsageDetails
int purgeOutdatedPriceDataUsageDetails(Duration outdatedPriceDataUsageDetailTimeout, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes allPriceDataUsageDetailswithPriceDataUsageDetail.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 ofPriceDataUsageDetailthat 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
-