Interface BookingService

All Known Subinterfaces:
ShoppingBookingService
All Known Implementing Classes:
DefaultBookingService, DefaultShoppingBookingService

public interface BookingService
BookingService interface that provides functionality to manage Bookings.
  • Method Details

    • createRefundPaymentTransaction

      @Deprecated Boolean createRefundPaymentTransaction(AbstractOrderModel abstractOrder, BigDecimal amountToRefund)
      Deprecated.
      Creates a payment transaction for refund
      Parameters:
      abstractOrder - the abstract order
      amountToRefund - the amount to refund
      Returns:
      true if successfully created transaction
    • createRefundPaymentTransaction

      Boolean createRefundPaymentTransaction(AbstractOrderModel abstractOrder, BigDecimal amountToRefund, List<AbstractOrderEntryModel> entries)
      Creates a payment transaction for refund
      Parameters:
      abstractOrder - the abstract order
      amountToRefund - the amount to refund
      entries - the entries the transaction is linked to
      Returns:
      true if successfully created transaction
    • getAllOrders

      List<OrderModel> getAllOrders(String orderCode, BaseStoreModel baseStore)
      Return a list of all the orders for the given orderCode and baseStore
      Parameters:
      orderCode - the order code
      baseStore - the base store
      Returns:
      the list of OrderModel
    • isCancelPossible

      boolean isCancelPossible(OrderModel order)
      Check if the cancel order is possible for the order with the given orderCode
      Parameters:
      order - as the order to be cancelled
      Returns:
      true if the cancellation is possible, false otherwise
    • cancelOrder

      boolean cancelOrder(OrderModel order)
      Performs the cancellation of the order with the given orderCode
      Parameters:
      order - as the order to be cancelled
      Returns:
      true if the cancellation of the order was successful, false otherwise
    • getTotalToRefund

      BigDecimal getTotalToRefund(OrderModel order)
      Calculate the total amount to be refunded
      Parameters:
      order - as the order
      Returns:
      the BigDecimal value to be refunded
    • getTotalToRefund

      BigDecimal getTotalToRefund(OrderModel order, OrderEntryType orderEntryType)
      Calculate the total amount to refund based on the given orderEntryType
      Parameters:
      order - as the order
      orderEntryType - as the orderEntryType
      Returns:
      the BigDecimal value to refund
    • cancelTraveller

      @Deprecated boolean cancelTraveller(BigDecimal totalToRefund)
      Deprecated.
      Deprecated since version 2.0. Use cancelTraveller(BigDecimal, TravellerData) instead.
      Proceeds with cancellation of traveller, creates a refund transaction if there is any refund available
      Parameters:
      totalToRefund - the total to refund
      Returns:
      true if successfully created refund payment transaction
    • cancelTraveller

      boolean cancelTraveller(BigDecimal totalToRefund, TravellerData travellerData)
      Proceeds with cancellation of traveller, creates a refund transaction if there is any refund available
      Parameters:
      totalToRefund - the total to refund
      travellerData - the travellerData for which to create the refund payment
      Returns:
      true if successfully created refund payment transaction
    • getOrderModelFromStore

      OrderModel getOrderModelFromStore(String bookingReference)
      Gets order model from store.
      Parameters:
      bookingReference - the booking reference
      Returns:
      OrderModel order model from store
    • getOrderEntry

      AbstractOrderEntryModel getOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, boolean bundleNoCheckRequired)
      Retrieves abstractOrderEntry from given abstractOrderModel
      Parameters:
      abstractOrderModel - - the abstract order model
      productCode - the productCode
      travelRouteCode - the travel Route Code
      transportOfferingCodes - list of transport Offering Code
      travellerCodes - the Traveller unique id
      bundleNoCheckRequired - flag to check if bundle no. check is required.
      Returns:
      AbstractOrderEntryModel order entry
    • getOrderEntries

      List<AbstractOrderEntryModel> getOrderEntries(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, boolean bundleNoCheckRequired)
      Retrieves abstractOrderEntry list from given abstractOrderModel
      Parameters:
      abstractOrderModel - - the abstract order model
      productCode - the productCode
      travelRouteCode - the travel Route Code
      transportOfferingCodes - list of transport Offering Code
      travellerCodes - the Traveller unique id
      bundleNoCheckRequired - flag to check if bundle no. check is required.
      Returns:
      AbstractOrderEntryModel order entry
    • getOriginalOrderEntry

      AbstractOrderEntryModel getOriginalOrderEntry(String originalOrderCode, String productCode, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes, Boolean bundleNoCheckRequired)
      Retrieves abstractOrderEntry from given abstractOrderModel's code
      Parameters:
      originalOrderCode - the original order code
      productCode - the product code
      travelRouteCode - the travel route code
      transportOfferingCodes - the transport offering codes
      travellerCodes - the traveller codes
      bundleNoCheckRequired - the bundle no check required
      Returns:
      order entry for given code of abstract order model
    • hasCartBeenAmended

      boolean hasCartBeenAmended()
      Checks if user made any changes during amendment
      Returns:
      true if something has been changed
    • getOrder

      OrderModel getOrder(String bookingReference)
      Retrieves the orderModel for the specified bookingReference.
      Parameters:
      bookingReference - the booking reference
      Returns:
      OrderModel object.
    • getProductQuantityInOrderForTransportOffering

      Long getProductQuantityInOrderForTransportOffering(String bookingReference, ProductModel productModel, TransportOfferingModel transportOfferingModel)
      Returns the quantity of products in the Order for a transportOffering.
      Parameters:
      bookingReference - the booking reference
      productModel - the product model
      transportOfferingModel - the transport offering model
      Returns:
      a Long
    • checkBundleToAmendProduct

      boolean checkBundleToAmendProduct(AbstractOrderModel abstractOrderModel, String productCode, long qty, String travelRouteCode, List<String> transportOfferingCodes, List<String> travellerCodes)
      Checks if a product is included in a bundle
      Parameters:
      abstractOrderModel - the abstract order model
      productCode - the product code
      qty - the qty
      travelRouteCode - the travel route code
      transportOfferingCodes - the transport offering codes
      travellerCodes - the traveller codes
      Returns:
      true if the product is included in a bundle, false otherwise
    • atleastOneAdultTravellerRemaining

      boolean atleastOneAdultTravellerRemaining(String orderCode, String cancelledTravellerCode)
      Validates if atleast one adult traveller belongs to booking(apart from the one removed currently), while removing traveller from the booking.
      Parameters:
      orderCode - the order code
      cancelledTravellerCode - the cancelled traveller code
      Returns:
      boolean boolean
    • getOrderModelByOriginalOrderCode

      OrderModel getOrderModelByOriginalOrderCode(String bookingReference)
      Gets order with original order code equal to booking reference
      Parameters:
      bookingReference - the booking reference
      Returns:
      order model by original order code
    • updateOrderStatus

      void updateOrderStatus(OrderModel orderModel, OrderStatus status)
      Updates the order with the status provided as a param
      Parameters:
      orderModel - the order model
      status - the status
    • getAccommodationOrderEntryGroups

      List<AccommodationOrderEntryGroupModel> getAccommodationOrderEntryGroups(AbstractOrderModel abstractOrder)
      Returns list of AccommodationOrderEntryGroups that are in the abstract order.
      Parameters:
      abstractOrder - the abstract order
      Returns:
      accommodation order entry groups
    • getAccommodationOrderEntryGroup

      AccommodationOrderEntryGroupModel getAccommodationOrderEntryGroup(int roomStayRefNum, AbstractOrderModel abstractOrder)
      Returns AccommodationOrderEntryGroupModel based on roomStayRefNumber and cart number
      Parameters:
      roomStayRefNum - the room stay ref num
      abstractOrder - the abstract order
      Returns:
      accommodation order entry group
    • isReservationCancelled

      boolean isReservationCancelled(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType)
      Check if the reservation for the specified orderEntryType has been cancelled.
      Parameters:
      abstractOrderModel - as the abstractOrderModel to be checked
      orderEntryType - as the OrderEntryType corresponding to the reservation to be checked
      Returns:
      true if all the orderEntries for the specified orderEntryType are inactive or if quantity is equals to 0
    • checkIfAnyOrderEntryByType

      boolean checkIfAnyOrderEntryByType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType)
      Check if the abstractOrderModel has at least one orderEntry with type equals to the given orderEntryType
      Parameters:
      abstractOrderModel - as the abstractOrderModel to be checked
      orderEntryType - as the OrderEntryType to be checked
      Returns:
      true if there is at least one orderEntry with type equals to the given orderEntryType, false otherwise
    • addRequestToRoomStayBooking

      void addRequestToRoomStayBooking(String request, int roomStayRefNumber, String bookingReference) throws de.hybris.platform.servicelayer.exceptions.ModelSavingException, RequestKeyGeneratorException
      Add an user request against a room stay booking
      Parameters:
      request - the request
      roomStayRefNumber - the room stay ref number
      bookingReference - the booking reference
      Throws:
      de.hybris.platform.servicelayer.exceptions.ModelSavingException - the model saving exception
      RequestKeyGeneratorException - the request key generator exception
    • removeRequestFromRoomStayBooking

      void removeRequestFromRoomStayBooking(String requestCode, int roomStayRefNumber, String bookingReference) throws de.hybris.platform.servicelayer.exceptions.ModelNotFoundException, de.hybris.platform.servicelayer.exceptions.ModelRemovalException
      Remove an user request from a room stay booking
      Parameters:
      requestCode - the request code
      roomStayRefNumber - the room stay ref number
      bookingReference - the booking reference
      Throws:
      de.hybris.platform.servicelayer.exceptions.ModelNotFoundException - the model not found exception
      de.hybris.platform.servicelayer.exceptions.ModelRemovalException - the model removal exception
    • getAccommodationDetailsParameters

      Map<String,String> getAccommodationDetailsParameters(AbstractOrderModel abstractOrderModel)
      Retrieves a map of parameters needed to access accommodation details page (accommodation offering, check in date, check out date)
      Parameters:
      abstractOrderModel - the abstract order model
      Returns:
      accommodation details parameters
    • getAccommodationOrderEntryGroupRefs

      List<Integer> getAccommodationOrderEntryGroupRefs(AbstractOrderModel abstractOrderModel)
      Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.NEW
      Parameters:
      abstractOrderModel - the abstract order model
      Returns:
      new accommodation order entry group refs
    • getNewAccommodationOrderEntryGroupRefs

      List<Integer> getNewAccommodationOrderEntryGroupRefs(AbstractOrderModel abstractOrderModel)
      Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.NEW
      Parameters:
      abstractOrderModel - the abstract order model
      Returns:
      new accommodation order entry group refs
    • getOldAccommodationOrderEntryGroupRefs

      List<Integer> getOldAccommodationOrderEntryGroupRefs(AbstractOrderModel abstractOrderModel)
      Returns a list of AccommodationOrderEntryGroup reference numbers for the groups that have all entries in AmendStatus.SAME
      Parameters:
      abstractOrderModel - the abstract order model
      Returns:
      new accommodation order entry group refs
    • getOrderTotalPriceByType

      Double getOrderTotalPriceByType(AbstractOrderModel abstractOrder, OrderEntryType orderEntryType)
      Returns the orderTotal related to the given orderEntryType part of the order.
      Parameters:
      abstractOrder - the abstract order
      orderEntryType - the order entry type
      Returns:
      the Double value of the totalPrice for the given orderEntryType
    • cancelPartialOrder

      boolean cancelPartialOrder(BigDecimal totalToRefund, OrderEntryType orderEntryType)
      Proceeds with cancellation of a part of the order, creates a refund transaction if there is any refund available
      Parameters:
      totalToRefund - the total to refund
      orderEntryType - the order entry type
      Returns:
      true if successfully created refund payment transaction
    • unlinkBooking

      boolean unlinkBooking(UserModel user, OrderModel order)
      Unlinks the booking from user account
      Parameters:
      user - the user
      order - the order
      Returns:
      boolean
    • getLastActiveOrderForType

      AbstractOrderModel getLastActiveOrderForType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType)
      Returns the last active order for the specified OrderEntryType
      Parameters:
      abstractOrderModel - as the abstractOrderModel
      orderEntryType - as the orderEntryType
      Returns:
      the last active OrderModel
    • getOrderTotalPaid

      BigDecimal getOrderTotalPaid(AbstractOrderModel abstractOrder)
      Calculates the total already paid for a given order
      Parameters:
      abstractOrder - the abstract order
      Returns:
      order total paid
    • getOrderTotalPaidByEntryGroup

      BigDecimal getOrderTotalPaidByEntryGroup(AbstractOrderModel abstractOrder, AbstractOrderEntryGroupModel entryGroup)
      Calculates the total already paid for products belonging to a given entry group within the given order
      Parameters:
      abstractOrder - the abstract order
      entryGroup - the entry group
      Returns:
      order total paid by entry group
    • getOrderTotalPaidForOrderEntryType

      BigDecimal getOrderTotalPaidForOrderEntryType(AbstractOrderModel abstractOrder, OrderEntryType orderEntryType)
      Calculates the total already paid for products of the given orderEntryType and for the given order
      Parameters:
      abstractOrder - the abstract order
      orderEntryType - the order entry type
      Returns:
      order total paid for order entry type
    • getOrderTotalToPayForChangeDates

      BigDecimal getOrderTotalToPayForChangeDates()
      Calculates the total to pay for change dates for the order in cart
      Returns:
      totalAmountToPay order total to pay for change dates
    • linkEntriesToOldPaymentTransactions

      boolean linkEntriesToOldPaymentTransactions(AccommodationOrderEntryGroupModel orderEntryGroup, List<AbstractOrderEntryModel> entries)
      This method will replace all the old RoomRateModel entries belonging to specific group transaction entries , with new Entries.
      Parameters:
      orderEntryGroup - the order entry group
      entries - the entries
      Returns:
      boolean
    • getOriginalOrderEntry

      AbstractOrderEntryModel getOriginalOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, int roomStayRefNumber)
      Retrieves abstractOrderEntry from given abstractOrderModel
      Parameters:
      abstractOrderModel - - the abstract order model
      productCode - the productCode
      roomStayRefNumber - the room stay reference number
      Returns:
      AbstractOrderEntryModel order entry
    • isAbstractOrderOfType

      boolean isAbstractOrderOfType(AbstractOrderModel abstractOrder, String bookingType)
      Checks if is abstract Order is of type.
      Parameters:
      abstractOrder - the order
      bookingType - the booking type
      Returns:
      true, if current cart is of type
    • getBookingTotalByOrderEntryType

      double getBookingTotalByOrderEntryType(AbstractOrderModel abstractOrder, OrderEntryType orderEntryType)
      Calculates the base price total amount for the orderEntryType in the abstract order
      Parameters:
      abstractOrder - the order
      orderEntryType - the orderEntryType
      Returns:
      totalAmount booking total by order entry type
    • isValidPassengerReference

      boolean isValidPassengerReference(AbstractOrderModel abstractOrder, String passengerReference)
      Checks if the passenger reference is valid for the provided abstract order
      Parameters:
      abstractOrder - the abstractOrder
      passengerReference - the passengerReference
      Returns:
      boolean
    • calculateTotalRefundForCancelledTraveller

      BigDecimal calculateTotalRefundForCancelledTraveller(AbstractOrderModel abstractOrder)
      Calculate refund for cancelled traveller
      Parameters:
      abstractOrder - the abstract order
      Returns:
      big decimal
    • getOriginalOrder

      OrderModel getOriginalOrder(AbstractOrderModel abstractOrder)
      returns an original order
      Parameters:
      abstractOrder - the abstract order
      Returns:
      original order
    • getGlobalDiscountForEntryType

      BigDecimal getGlobalDiscountForEntryType(AbstractOrderModel abstractOrder, OrderEntryType entryType)
      Return the portio of global discounts relative to the given entry type
      Parameters:
      abstractOrder - the abstract order
      entryType - the entry type
      Returns:
      global discount for entry type
    • calculateTaxValueForEntries

      Double calculateTaxValueForEntries(AbstractOrderModel abstractOrder, List<AbstractOrderEntryModel> entries)
      Calculate accommodation tax value after Tax Compensation.
      Parameters:
      abstractOrder - the abstract order
      entries - the entries
      Returns:
      the big decimal
    • getOrderForCurrentUser

      OrderModel getOrderForCurrentUser(String code)
      Returns the specified order for the current user and store.
      Parameters:
      code - the code of the order to retrieve
      Returns:
      the order
    • getTotalRefundAmountByEntryType

      BigDecimal getTotalRefundAmountByEntryType(AbstractOrderModel abstractOrderModel, OrderEntryType orderEntryType)
      Gets total refund amount by entry type.
      Parameters:
      abstractOrderModel - the abstract order model
      orderEntryType - the order entry type
      Returns:
      the total refund amount by entry type
    • cancelOrder

      void cancelOrder(OrderModel order, UserModel requestor) throws BookingCancelException
      Performs the cancellation of the order.
      Parameters:
      order - the order to be cancelled
      requestor - the requestor
      Throws:
      BookingCancelException - if the order cannot be cancelled
    • checkIfPartialCancelPossible

      void checkIfPartialCancelPossible(OrderModel order, OrderEntryType orderEntryType) throws OrderCancelDeniedException
      Checks if the order cancellation possible for the given requestor.
      Parameters:
      order - the order to be cancelled
      Throws:
      OrderCancelDeniedException - when cancel is denied
    • getActiveEntries

      List<AbstractOrderEntryModel> getActiveEntries(OrderModel order, OrderEntryType excludedType)
      Returns active order entries whose type is not equal to given type to exclude.
      Parameters:
      order - the order
      excludedType - the order entry type to exclude
      Returns:
      order entries
    • getOrder

      OrderModel getOrder(String orderCode, boolean isOrderGuid)
      Get Order model from code or guid
      Parameters:
      orderCode -
      isOrderGuid -
      Returns:
    • getRequestToRoomStayBooking

      SpecialRequestDetailModel getRequestToRoomStayBooking(int roomStayRefNumber, OrderModel bookingReference) throws SpecialRequestException
      Get an user request against a room stay booking
      Parameters:
      roomStayRefNumber - the room stay ref number
      bookingReference - the booking reference
      Returns:
      true if the operation of adding the request is successfully performed, false otherwise
      Throws:
      SpecialRequestException - the special request exception