Interface PricingTransactionService
- All Known Implementing Classes:
 DefaultPricingTransactionService
public interface PricingTransactionService
The service class to handle pricing transactions such as recording and rolling back price data
 usages.
- Author:
 - karanjariwala
 
- 
Method Summary
Modifier and TypeMethodDescriptionvoidmarkPriceDataUsagesRevertible(@NonNull String transactionRefType, @NonNull String transactionRefId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible=true toPriceDataUsageDetailidentified by transactionRefType and transactionRefIdcom.broadleafcommerce.pricing.client.domain.usage.RecordPriceDataUsageResponserecordPriceDataUsage(com.broadleafcommerce.pricing.client.domain.usage.RecordPriceDataUsageRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Records price data usages.voidrollbackExpiredPriceDataUsage(Duration outdatedPriceDataUsageDetailTimeout, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Performs the rollback forPriceDataandPriceDataUsageDetailwherePriceDataUsageDetailare older than specified date and has flag revertible as truevoidrollbackPriceDataUsages(String transactionReferenceType, String transactionReferenceId, String rollbackReason, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Performs the rollback forPriceDataandPriceDataUsageDetail.voidrollbackPriceDataUsagesByPriceDataId(Map<String, Integer> quantityByPriceDataIdMap, String rollbackReason, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Performs the rollback forPriceDataandPriceDataUsageDetail. 
- 
Method Details
- 
recordPriceDataUsage
com.broadleafcommerce.pricing.client.domain.usage.RecordPriceDataUsageResponse recordPriceDataUsage(com.broadleafcommerce.pricing.client.domain.usage.RecordPriceDataUsageRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Records price data usages.If any one of the
PriceDataUsagesis no longer available or expired, then none are recorded.This is used for
price data that are limited by quantity. For example, pricing events such as a flash sale may have limited quantity for a sale price.- Parameters:
 request- theRecordPriceDataUsageRequestcontaining the usages to recordcontextInfo- the context info- Returns:
 - the 
RecordPriceDataUsageResponserepresenting the result of recording the usages 
 - 
rollbackPriceDataUsages
void rollbackPriceDataUsages(String transactionReferenceType, String transactionReferenceId, String rollbackReason, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Performs the rollback forPriceDataandPriceDataUsageDetail.This mainly includes adding back the
PriceData.getAvailableQuantity()and archiving thePriceDataUsageDetails.- Parameters:
 transactionReferenceType- the transactionReferenceType of the details to rollbacktransactionReferenceId- the transactionReferenceId of the details to rollbackrollbackReason- the reason for rollbackcontextInfo- the context info
 - 
markPriceDataUsagesRevertible
void markPriceDataUsagesRevertible(@NonNull @NonNull String transactionRefType, @NonNull @NonNull String transactionRefId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sets revertible=true toPriceDataUsageDetailidentified by transactionRefType and transactionRefId- Parameters:
 transactionRefType- the transactionRefType to restrict querytransactionRefId- the transactionRefId to restrict querycontextInfo- the context info
 - 
rollbackPriceDataUsagesByPriceDataId
void rollbackPriceDataUsagesByPriceDataId(Map<String, Integer> quantityByPriceDataIdMap, String rollbackReason, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Performs the rollback forPriceDataandPriceDataUsageDetail.This mainly includes adding back the
PriceData.getAvailableQuantity()and archiving thePriceDataUsageDetails.- Parameters:
 quantityByPriceDataIdMap- a map containing the entries that represent the quantity to be added back for a specific priceDataIdrollbackReason- the reason for rollbackcontextInfo- the context info
 - 
rollbackExpiredPriceDataUsage
void rollbackExpiredPriceDataUsage(Duration outdatedPriceDataUsageDetailTimeout, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Performs the rollback forPriceDataandPriceDataUsageDetailwherePriceDataUsageDetailare older than specified date and has flag revertible as true- Parameters:
 outdatedPriceDataUsageDetailTimeout- - timeout that will be subtracted from NOW to get the moment whenPriceDataUsageDetailis considered expiredcontextInfo- the context info
 
 -