Class DefaultRatePlanService

java.lang.Object
de.hybris.platform.travelservices.services.impl.DefaultRatePlanService
All Implemented Interfaces:
RatePlanService

public class DefaultRatePlanService extends Object implements RatePlanService
The type Default rate plan service.
  • Constructor Details

    • DefaultRatePlanService

      public DefaultRatePlanService()
  • Method Details

    • getGuaranteeToApply

      public GuaranteeModel getGuaranteeToApply(AccommodationOrderEntryGroupModel group, Date date)
      Description copied from interface: RatePlanService
      Return the correct guarantee to apply given the order entry group and the date when we want to apply it
      Specified by:
      getGuaranteeToApply in interface RatePlanService
      Parameters:
      group - the group
      date - the date
      Returns:
      guarantee to apply
    • getGuaranteeToApply

      public GuaranteeModel getGuaranteeToApply(AccommodationOrderEntryGroupModel group, Date startingDate, Date currentDate)
      Description copied from interface: RatePlanService
      Return the correct guarantee to apply given the order entry group and the date when we want to apply it
      Specified by:
      getGuaranteeToApply in interface RatePlanService
      Parameters:
      group - the group
      startingDate - the starting date
      currentDate - the current date
      Returns:
      guarantee to apply
    • getGuranteeToApply

      protected GuaranteeModel getGuranteeToApply(List<GuaranteeModel> guarantees, Date startingDate, Date currentDate)
      Gets gurantee to apply.
      Parameters:
      guarantees - the guarantees
      startingDate - the starting date
      currentDate - the current date
      Returns:
      the gurantee to apply
    • getAppliedGuaranteeAmount

      public Double getAppliedGuaranteeAmount(GuaranteeModel guaranteeToApply, BigDecimal roomRatePrice)
      Description copied from interface: RatePlanService
      Return amount to be paid as guarantee, applying the guarantee model on the price.
      Specified by:
      getAppliedGuaranteeAmount in interface RatePlanService
      Parameters:
      guaranteeToApply - object of GuaranteeModel
      roomRatePrice - the price on which guarantee is to be applied
      Returns:
      guarantee amount
    • getGuaranteeAmount

      protected Double getGuaranteeAmount(Double amountPercent, Double totalPrice)
      Gets guarantee amount.
      Parameters:
      amountPercent - the amount percent
      totalPrice - the total price
      Returns:
      the guarantee amount
    • normalizeGuaranteesDeadlines

      protected void normalizeGuaranteesDeadlines(List<GuaranteeModel> guarantees, Date startingDate, Date currentDate)
      This method normalizes deadlines, setting the relative deadline to the given date if it is before this date. This allows the application of a priority policy, triggered when two or more guarantees clash of the same date. Calculation has been made based on the offset in milliseconds between the date (resolved as per above explanation) and the check in date. To make the algorithm consistent if an absolute deadline is present it is converted into the relative deadline (in milliseconds) then eventually normalized.
      Parameters:
      guarantees - the guarantees
      startingDate - the starting date
      currentDate - the current date
    • getRatePlanForCode

      public RatePlanModel getRatePlanForCode(String ratePlanCode)
      Description copied from interface: RatePlanService
      Returns the RatePlanModel for a given code
      Specified by:
      getRatePlanForCode in interface RatePlanService
      Parameters:
      ratePlanCode - the code of the ratePlan to get
      Returns:
      the RatePlanModel corresponding to the given code
    • getGuaranteeComparator

      protected Comparator<GuaranteeModel> getGuaranteeComparator()
      Gets guarantee comparator.
      Returns:
      guaranteeComparator guarantee comparator
    • setGuaranteeComparator

      public void setGuaranteeComparator(Comparator<GuaranteeModel> guaranteeComparator)
      Sets guarantee comparator.
      Parameters:
      guaranteeComparator - the guaranteeComparator to set
    • getRatePlanDao

      protected RatePlanDao getRatePlanDao()
      Gets rate plan dao.
      Returns:
      ratePlanDao rate plan dao
    • setRatePlanDao

      public void setRatePlanDao(RatePlanDao ratePlanDao)
      Sets rate plan dao.
      Parameters:
      ratePlanDao - the ratePlanDao to set