Interface CancelPenaltiesCalculationService

All Known Implementing Classes:
DefaultCancelPenaltiesCalculationService

public interface CancelPenaltiesCalculationService
Interface for operations about cancel penalties calculation
  • Method Details

    • getActiveCancelPenalty

      CancelPenaltyModel getActiveCancelPenalty(Collection<CancelPenaltyModel> cancelPenalties, Date checkInDate, BigDecimal plannedAmount)
      Retrieves the cancel penalty currently active
      Parameters:
      cancelPenalties -
      checkInDate -
      plannedAmount -
      Returns:
    • getCancelPenaltyDeadline

      Date getCancelPenaltyDeadline(CancelPenaltyModel cancelPenalty, Date checkInDate)
      This method returns the deadline Date for the given CancelPenalty. If both RelativeDeadline and AbsoluteDeadline are defined, the earliest one will be returned.
      Parameters:
      cancelPenalty -
      checkInDate -
      Returns:
      the Date corresponding to the deadline
    • getCancelPenaltyAmount

      BigDecimal getCancelPenaltyAmount(CancelPenaltyModel cancelPenalty, BigDecimal plannedAmount)
      This method returns the amount to retain from the refund. If both fixedAmount and percentageAmount are defined in the cancelPenalty, the highest one will be returned.
      Parameters:
      cancelPenalty -
      plannedAmount -
      Returns:
      the BigDecimal corresponding to the amount of the cancelPenalty