Interface RefundAmountCalculationService
- All Known Implementing Classes:
DefaultRefundAmountCalculationService
public interface RefundAmountCalculationService
Service for handling refundAmount for
ReturnRequestModel. It calculates and persists the refund amount for ReturnRequest and the included RefundEntryModel-
Method Summary
Modifier and TypeMethodDescriptiongetCustomRefundAmount(ReturnRequestModel returnRequest) Returns the custom refund amount for aReturnRequestModel.getCustomRefundEntryAmount(ReturnEntryModel refundEntryModel) Gets theRefundEntryModel#_amountbased on the basePrice of products being returned in the entry.getOriginalRefundAmount(ReturnRequestModel returnRequest) Returns the original refund amount for aReturnRequestModel.getOriginalRefundEntryAmount(ReturnEntryModel refundEntryModel) Calculates and persists theRefundEntryModel#_amountbased on the amount of products being returned in the entry.
-
Method Details
-
getCustomRefundAmount
Returns the custom refund amount for aReturnRequestModel.- Parameters:
returnRequest- theReturnRequestModelfor which refund amount needs to be calculated- Returns:
BigDecimalrepresenting the custom refund amount
-
getCustomRefundEntryAmount
Gets theRefundEntryModel#_amountbased on the basePrice of products being returned in the entry.- Parameters:
refundEntryModel- theRefundEntryModelfor which refund amount needs to be calculated- Returns:
- the refundAmount for the requested
RefundEntryModel
-
getOriginalRefundAmount
Returns the original refund amount for aReturnRequestModel.- Parameters:
returnRequest- theReturnRequestModelfor which refund amount needs to be calculated- Returns:
BigDecimalrepresenting the original refund amount
-
getOriginalRefundEntryAmount
Calculates and persists theRefundEntryModel#_amountbased on the amount of products being returned in the entry.- Parameters:
refundEntryModel- theRefundEntryModelfor which refund entry amount needs to be calculated- Returns:
- the sum of all refund amount
RefundEntryModelfor all entries, otherwise 0
-