Interface RefundAmountCalculationService
-
- All Known Implementing Classes:
DefaultRefundAmountCalculationService
public interface RefundAmountCalculationService
Service for handling refundAmount forReturnRequestModel
. It calculates and persists the refund amount for ReturnRequest and the includedRefundEntryModel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.math.BigDecimal
getCustomRefundAmount(ReturnRequestModel returnRequest)
Returns the custom refund amount for aReturnRequestModel
.java.math.BigDecimal
getCustomRefundEntryAmount(ReturnEntryModel refundEntryModel)
Gets theRefundEntryModel#_amount
based on the basePrice of products being returned in the entry.java.math.BigDecimal
getOriginalRefundAmount(ReturnRequestModel returnRequest)
Returns the original refund amount for aReturnRequestModel
.java.math.BigDecimal
getOriginalRefundEntryAmount(ReturnEntryModel refundEntryModel)
Calculates and persists theRefundEntryModel#_amount
based on the amount of products being returned in the entry.
-
-
-
Method Detail
-
getCustomRefundAmount
java.math.BigDecimal getCustomRefundAmount(ReturnRequestModel returnRequest)
Returns the custom refund amount for aReturnRequestModel
.- Parameters:
returnRequest
- theReturnRequestModel
for which refund amount needs to be calculated- Returns:
BigDecimal
representing the custom refund amount
-
getCustomRefundEntryAmount
java.math.BigDecimal getCustomRefundEntryAmount(ReturnEntryModel refundEntryModel)
Gets theRefundEntryModel#_amount
based on the basePrice of products being returned in the entry.- Parameters:
refundEntryModel
- theRefundEntryModel
for which refund amount needs to be calculated- Returns:
- the refundAmount for the requested
RefundEntryModel
-
getOriginalRefundAmount
java.math.BigDecimal getOriginalRefundAmount(ReturnRequestModel returnRequest)
Returns the original refund amount for aReturnRequestModel
.- Parameters:
returnRequest
- theReturnRequestModel
for which refund amount needs to be calculated- Returns:
BigDecimal
representing the original refund amount
-
getOriginalRefundEntryAmount
java.math.BigDecimal getOriginalRefundEntryAmount(ReturnEntryModel refundEntryModel)
Calculates and persists theRefundEntryModel#_amount
based on the amount of products being returned in the entry.- Parameters:
refundEntryModel
- theRefundEntryModel
for which refund entry amount needs to be calculated- Returns:
- the sum of all refund amount
RefundEntryModel
for all entries, otherwise 0
-
-