Interface AccommodationCartFacade

All Known Implementing Classes:
DefaultAccommodationCartFacade, DefaultShoppingAccommodationCartFacade

public interface AccommodationCartFacade
This facade provides functionality of adding or removing accommodation specific products to / from cart.
  • Method Details

    • addAccommodationToCart

      @Deprecated(since="2003", forRemoval=true) void addAccommodationToCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Perform accommodation into cart, numberOfRooms times.
      Parameters:
      checkInDate - the check in date
      checkOutDate - the check out date
      accommodationOfferingCode - the accommodation offering code
      accommodationCode - the accommodation code
      rates - the rates
      numberOfRooms - the number of rooms
      ratePlanCode - the rate plan code
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • addAccommodation

      List<CartModificationData> addAccommodation(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Add accommodation to cart occ list.
      Parameters:
      checkInDate - the check in date
      checkOutDate - the check out date
      accommodationOfferingCode - the accommodation offering code
      accommodationCode - the accommodation code
      rates - the rates
      numberOfRooms - the number of rooms
      ratePlanCode - the rate plan code
      Returns:
      the list of CartModificationData
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • addAccommodationsToCart

      @Deprecated(since="2003", forRemoval=true) void addAccommodationsToCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      1. Verify how many AccommodationOrderEntryGroups are in the cart for given accommodation, accommodationOffering and ratePlan set. 2. Compare this number to numberOfRooms to get roomQuantityToAdd (or remove) 3a. if roomQuantityToAdd == 0 -> do nothing 3b. if roomQuantityToAdd < 0 -> get the list of results from point 1 and remove the last few (or all of them if size == Math.abs(roomQuantityToAdd) ) - remove all entries related to these AccommodationOfferGroupEntries and then the groupEntries themselves and then normalize roomStayRefNumbers 3c.if roomQuantityToAdd > 0 -> perform addAccommodationBookingToCart roomQuantityToAdd times
      Parameters:
      checkInDate - the check in date
      checkOutDate - the check out date
      accommodationOfferingCode - the accommodation offering code
      accommodationCode - the accommodation code
      rates - the rates
      numberOfRooms - the number of rooms
      ratePlanCode - the rate plan code
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • addAccommodations

      List<CartModificationData> addAccommodations(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Add accommodations to cart occ list.
      Parameters:
      checkInDate - the check in date
      checkOutDate - the check out date
      accommodationOfferingCode - the accommodation offering code
      accommodationCode - the accommodation code
      rates - the rates
      numberOfRooms - the number of rooms
      ratePlanCode - the rate plan code
      Returns:
      the list of CartModificationData
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • addAccommodation

      int addAccommodation(AddRoomStayData addRoomStayData) throws MaximumQuantityExceededException, InvalidRoomStayException, de.hybris.platform.commerceservices.order.CommerceCartModificationException, InvalidSessionCartException
      Add accommodation to cart.
      Parameters:
      addRoomStayData - accommodation parameters
      Returns:
      the order entry group number of added accommodation
      Throws:
      MaximumQuantityExceededException - if maximum quantity of rooms exceeded
      InvalidRoomStayException - if room stay information is invalid
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - if error occurs during adding accommodation to a cart
      InvalidSessionCartException - the cart is not in session
    • addAccommodationsToCart

      Boolean addAccommodationsToCart(AccommodationOrderEntryGroupModel accommodationOrderEntryGroup, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode, String paymentType) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Perform addAccommodationBookingToCart, numberOfRooms times. and then link the entries to given accommodationOrderEntryGroup
      Parameters:
      accommodationOrderEntryGroup - the accommodation order entry group
      accommodationOfferingCode - the accommodation offering code
      accommodationCode - the accommodation code
      rates - the rates
      numberOfRooms - the number of rooms
      ratePlanCode - the rate plan code
      paymentType - the payment type
      Returns:
      the boolean
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • rollbackAccommodationEntries

      void rollbackAccommodationEntries(String accommodationCode, String accommodationOfferingCode, String ratePlanCode)
      Removes entries associated to selected option that was affected during add to cart.
      Parameters:
      accommodationCode - the accommodation code
      accommodationOfferingCode - the accommodation offering code
      ratePlanCode - the rate plan code
    • cleanUpCartBeforeAddition

      void cleanUpCartBeforeAddition(String accommodationOfferingCode, String checkInDateTime, String checkOutDateTime)
      Checks if the accommodationOfferingCode matches the one that is currently in the cart. If not, all AccommodationOrderEntryGroups should be removed from cart because multi accommodation offering booking is not supported
      Parameters:
      accommodationOfferingCode - the accommodation offering code
      checkInDateTime - the check in date time
      checkOutDateTime - the check out date time
    • cleanUpCartBeforeAddition

      void cleanUpCartBeforeAddition(String accommodationOfferingCode, String checkInDate, String checkOutDate, List<RoomStayCandidateData> roomStayCandidates)
      This method checks if entries that are currently in the cart match the request. If they don't the cart is removed.
      Parameters:
      accommodationOfferingCode - the accommodation offering code
      checkInDate - the check in date
      checkOutDate - the check out date
      roomStayCandidates - the room stay candidates
    • emptyCart

      void emptyCart()
      Removes all the entries in the cart.
    • validateNumberOfRoomsToAdd

      boolean validateNumberOfRoomsToAdd(String accommodationOfferingCode, String accommodationCode, String ratePlanCode, int numberOfRooms, int allowedNumberOfRooms)
      Checks if the number of rooms in the cart after addition would be within the configured limit
      Parameters:
      accommodationOfferingCode - the accommodation offering code
      accommodationCode - the accommodation code
      ratePlanCode - the rate plan code
      numberOfRooms - the number of rooms
      allowedNumberOfRooms - the allowed number of rooms
      Returns:
      boolean boolean
    • addProductToCart

      @Deprecated(since="2003", forRemoval=true) void addProductToCart(String productCode, int roomStayReferenceNumber, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Methods that performs the addToCart of a product for the given productCode. If the product is already in the cart and the quantity is greater than 0, the abstractOrderEntry will be updated. If the product is already in the cart and the quantity 0, the abstractOrderEntry will be remove. If the product is not yet in the cart and the quantity is greater than 0, a new abstractOrderEntry will be created.
      Parameters:
      productCode - as the code of the product to be added to the cart
      roomStayReferenceNumber - as the reference Number of the room that the product is added to
      quantity - as the quantity of the product to add to the cart
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • addProduct

      CartModificationData addProduct(String productCode, int roomStayReferenceNumber, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Add product to cart occ list.
      Parameters:
      productCode - the product code
      roomStayReferenceNumber - the room stay reference number
      quantity - the quantity
      Returns:
      the list of CartModificationData
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • removeAccommodationOrderEntryGroup

      Boolean removeAccommodationOrderEntryGroup(int roomStayReference)
      Removes the Accommodation Order Entry Group from cart alongside with all the associated entries
      Parameters:
      roomStayReference - the room stay reference
      Returns:
      boolean boolean
    • validateAccommodationCart

      boolean validateAccommodationCart()
      Validates if there are any AccommodationOrderEntryGroups in the cart.
      Returns:
      boolean boolean
    • getCurrentAccommodationOffering

      String getCurrentAccommodationOffering()
      Returns current accommodation offering that is in the cart
      Returns:
      current accommodation offering
    • collectRoomRates

      Collect room rates list.
      Parameters:
      form - the form
      Returns:
      the list
    • isAmendmentForServices

      Boolean isAmendmentForServices()
      Determines if an amendment is happening on services
      Returns:
      true if an amendment is happening on services
    • isNewRoomInCart

      boolean isNewRoomInCart()
      Check whether new room is added into the cart.
      Returns:
      true if new room is added into the cart
    • addAccommodationBundleToCart

      List<CartModificationData> addAccommodationBundleToCart(AccommodationBundleTemplateModel accommodationBundleTemplateModel, AddDealToCartData addDealToCartData) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      This method adds to the cart all the valid room rates belonging to a bundle according with a date range
      Parameters:
      accommodationBundleTemplateModel - the accommodation bundle template model
      addDealToCartData - the add deal to cart data
      Returns:
      list list
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • replaceAccommodationInCart

      void replaceAccommodationInCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode, Integer roomStayRefNumber) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Replaces the current room stay with a newly selected option. It doesn't do normalisation of room stay ref number on removal because the ref number should be the same for the newly added option
      Parameters:
      checkInDate - check in date
      checkOutDate - check out date
      accommodationOfferingCode - accommodation offering code
      accommodationCode - accommodation code
      rates - room rates
      numberOfRooms - number of rooms
      ratePlanCode - rate plan code
      roomStayRefNumber - room stay ref number
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - commerce cart modification exception
    • addSelectedAccommodationToCart

      @Deprecated(since="2003", forRemoval=true) boolean addSelectedAccommodationToCart(String accommodationUid, String transportOfferingCode, String travellerCode, String originDestinationRefNo, String travelRoute)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since 2003.
      Method responsible to add the accommodation to the cart for the traveller based on the following scenarios: 1. If the accommodation(ConfiguredAccommodationModel) is configured in the system. 2. If the accommodation is bookable. 3. if the products of accommodation are referenced by the fare product entry in the cart. 4. if the accommodation is not already booked by other travellers in the transportOffering. 5. If the accommodation is not already added to the cart by other passenger of same cart.
      Parameters:
      accommodationUid - the accommodation uid
      transportOfferingCode - the transport offering code
      travellerCode - the traveller code
      originDestinationRefNo - the origin destination ref no
      travelRoute - the travel route
      Returns:
      true, if successful
    • addSelectedAccommodation

      @Deprecated(since="2003", forRemoval=true) CartModificationData addSelectedAccommodation(String accommodationUid, String transportOfferingCode, String travellerCode, String originDestinationRefNo, String travelRoute)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since version 2003
      Method responsible to add the accommodation to the cart for the traveller based on the following scenarios: 1. If the accommodation(ConfiguredAccommodationModel) is configured in the system. 2. If the accommodation is bookable. 3. if the products of accommodation are referenced by the fare product entry in the cart. 4. if the accommodation is not already booked by other travellers in the transportOffering. 5. If the accommodation is not already added to the cart by other passenger of same cart.
      Parameters:
      accommodationUid - the accommodation uid
      transportOfferingCode - the transport offering code
      travellerCode - the traveller code
      originDestinationRefNo - the origin destination ref no
      travelRoute - the travel route
      Returns:
      CartModificationData
    • removeSelectedAccommodationFromCart

      @Deprecated(since="2003", forRemoval=true) boolean removeSelectedAccommodationFromCart(String accommodationUid, String transportOfferingCode, String travellerCode, String travelRoute)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes the selected accommodation from cart.
      Parameters:
      accommodationUid - the accommodation uid
      transportOfferingCode - the transport offering code
      travellerCode - the traveller code
      travelRoute - the travel route
      Returns:
      true, if successful
    • removeSelectedAccommodation

      CartModificationData removeSelectedAccommodation(String accommodationUid, String transportOfferingCode, String travellerCode, String travelRoute)
      Removes the selected accommodation from cart.
      Parameters:
      accommodationUid - the accommodation uid
      transportOfferingCode - the transport offering code
      travellerCode - the traveller code
      travelRoute - the travel route
      Returns:
      CartModificationData
    • collectRoomRates

      List<RoomRateCartData> collectRoomRates(Date checkInDate, Date checkOutDate, String ratePlanCode)
      Collect room rates data list.
      Parameters:
      checkInDate - the check in date
      checkOutDate - the check out date
      ratePlanCode - the rate plan code
      Returns:
      the list
    • updateServiceEntry

      CartModificationData updateServiceEntry(Integer entryId, Long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Update Service entry
      Parameters:
      entryId -
      quantity -
      Returns:
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • removeServiceEntry

      CartModificationData removeServiceEntry(Integer entryId) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Remove the service associated to the given entry number
      Parameters:
      entryId - the entryNumber
      Returns:
      CartModificationData
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the CommerceCartModificationException
    • removeRoomStay

      void removeRoomStay(Integer roomStayRefNumber) throws InvalidRoomStayException, RemoveRoomStayException
      Method responsible to remove the accommodation order entry group and related entries from the cart in the following sequence: 1. validates the accommodation order entry group by room stay ref number. 2. validates the count of accommodation order entry group for amendment cart as last room must not be deleted in this case. 3. removes the accommodation order entry group.
      Parameters:
      roomStayRefNumber - roomStayRefNumber
      Throws:
      InvalidRoomStayException - if room stay information is invalid
      RemoveRoomStayException - if one last room is left for amendment cart or error occurred for removal of accommodation for given roomStayRefNumber