Package org.bhn.promotion.core.service
Class OrderStorageService
java.lang.Object
org.bhn.promotion.core.service.OrderStorageService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessOrderDto(String flow, PromotionQuoteRequest promotionQuoteRequest, PromoSummary promoSummary, List<RedemptionModel> redemptionModels) Asynchronously processes the order by preparing anOrderDTOusing the provided flow,PromotionQuoteRequest,PromoSummary, and a list ofRedemptionModel.voidprocessRollback(String flow, RollbackRequest rollbackRequest, RollbackRedemptionSummary rollbackSummary, RollbackResponseModel rollbackResponseModel) Processes a rollback request by constructing rollback models based on the providedRollbackResponseModelandRollbackRequest, and then persists the rollback data using aRollbackDTO.
-
Constructor Details
-
OrderStorageService
public OrderStorageService()
-
-
Method Details
-
processOrderDto
@Async public void processOrderDto(String flow, PromotionQuoteRequest promotionQuoteRequest, PromoSummary promoSummary, List<RedemptionModel> redemptionModels) Asynchronously processes the order by preparing anOrderDTOusing the provided flow,PromotionQuoteRequest,PromoSummary, and a list ofRedemptionModel. The preparedOrderDTOis then passed to the save method for further processing and persistence. This method logs the start and completion of order processing, and is executed asynchronously.- Parameters:
flow- The flow of the order processing.promotionQuoteRequest- The request object containing order and promotion details.promoSummary- The summary of promotions applied to the order.redemptionModels- The list of redemption models applied to the order.
-
processRollback
@Async public void processRollback(String flow, RollbackRequest rollbackRequest, RollbackRedemptionSummary rollbackSummary, RollbackResponseModel rollbackResponseModel) Processes a rollback request by constructing rollback models based on the providedRollbackResponseModelandRollbackRequest, and then persists the rollback data using aRollbackDTO. This method also logs the start and end of the rollback processing for tracking.- Parameters:
flow- the name or identifier of the current workflow or flow triggering the rollbackrollbackRequest- the original rollback request containing context like the order IDrollbackSummary- the summary object containing redemption IDs and any rollback errorsrollbackResponseModel- the response model that contains details to build rollback models
-