Class DefaultAccommodationCartFacade

java.lang.Object
de.hybris.platform.commercefacades.order.impl.DefaultCartFacade
de.hybris.platform.travelfacades.order.impl.DefaultAccommodationCartFacade
All Implemented Interfaces:
de.hybris.platform.commercefacades.order.CartFacade, AccommodationCartFacade
Direct Known Subclasses:
DefaultShoppingAccommodationCartFacade

public class DefaultAccommodationCartFacade extends de.hybris.platform.commercefacades.order.impl.DefaultCartFacade implements AccommodationCartFacade
Default implementation of AccommodationCartFacade
  • Field Details

    • PRODUCT_QUANTITY

      protected static final long PRODUCT_QUANTITY
      This constant value dictates the quantity of the products to be added in the cart.
      See Also:
  • Constructor Details

    • DefaultAccommodationCartFacade

      public DefaultAccommodationCartFacade()
  • Method Details

    • addAccommodationToCart

      public void addAccommodationToCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      Perform accommodation into cart, numberOfRooms times.
      Specified by:
      addAccommodationToCart in interface AccommodationCartFacade
      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

      public 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
      Description copied from interface: AccommodationCartFacade
      Add accommodation to cart occ list.
      Specified by:
      addAccommodation in interface AccommodationCartFacade
      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

      public int addAccommodation(AddRoomStayData addRoomStayData) throws InvalidSessionCartException, MaximumQuantityExceededException, InvalidRoomStayException, de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      Add accommodation to cart.
      Specified by:
      addAccommodation in interface AccommodationCartFacade
      Parameters:
      addRoomStayData - accommodation parameters
      Returns:
      the order entry group number of added accommodation
      Throws:
      InvalidSessionCartException - the cart is not in session
      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
    • validateMaximumQuantity

      protected void validateMaximumQuantity() throws MaximumQuantityExceededException
      Validates the quantity of accommodations in a cart.
      Throws:
      MaximumQuantityExceededException - if maximum quantity of accommodations exceeded
    • validateAccommodationAgainstCart

      protected void validateAccommodationAgainstCart(String accommodationOfferingCode, Date checkInDate, Date checkOutDate) throws InvalidSessionCartException, InvalidRoomStayException
      Validates if accommodation can be added to the cart.
      Parameters:
      accommodationOfferingCode - the accommodation offering code
      checkInDate - the accommodation code
      checkOutDate - the rate plan code
      Throws:
      InvalidSessionCartException - the cart is not in session
      InvalidRoomStayException - if accomodation cannot be added to the cart
    • validateRoomStay

      protected void validateRoomStay(String accommodationOfferingCode, String accommodationCode, String ratePlanCode, Date checkinDate, Date checkoutDate) throws InvalidRoomStayException
      Validates the room stay information.
      Parameters:
      accommodationOfferingCode - the accommodation offering code
      accommodationCode - the accommodation code
      ratePlanCode - the rate plan code
      Throws:
      InvalidRoomStayException - if room stay information is invalid
    • addAccommodationsToCart

      public void addAccommodationsToCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      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
      Specified by:
      addAccommodationsToCart in interface AccommodationCartFacade
      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

      public 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
      Description copied from interface: AccommodationCartFacade
      Add accommodations to cart occ list.
      Specified by:
      addAccommodations in interface AccommodationCartFacade
      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

      public Boolean addAccommodationsToCart(AccommodationOrderEntryGroupModel accommodationOrderEntryGroup, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode, String paymentType) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      Perform addAccommodationBookingToCart, numberOfRooms times. and then link the entries to given accommodationOrderEntryGroup
      Specified by:
      addAccommodationsToCart in interface AccommodationCartFacade
      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

      public void rollbackAccommodationEntries(String accommodationCode, String accommodationOfferingCode, String ratePlanCode)
      Description copied from interface: AccommodationCartFacade
      Removes entries associated to selected option that was affected during add to cart.
      Specified by:
      rollbackAccommodationEntries in interface AccommodationCartFacade
      Parameters:
      accommodationCode - the accommodation code
      accommodationOfferingCode - the accommodation offering code
      ratePlanCode - the rate plan code
    • cleanUpCartBeforeAddition

      public void cleanUpCartBeforeAddition(String accommodationOfferingCode, String checkInDateTime, String checkOutDateTime)
      Description copied from interface: AccommodationCartFacade
      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
      Specified by:
      cleanUpCartBeforeAddition in interface AccommodationCartFacade
      Parameters:
      accommodationOfferingCode - the accommodation offering code
      checkInDateTime - the check in date time
      checkOutDateTime - the check out date time
    • cleanUpCartBeforeAddition

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

      protected boolean validateRoomStayCandidates(List<RoomStayCandidateData> roomStayCandidates, List<AccommodationOrderEntryGroupModel> entryGroups)
      Validate room stay candidates boolean.
      Parameters:
      roomStayCandidates - the room stay candidates
      entryGroups - the entry groups
      Returns:
      the boolean
    • emptyCart

      public void emptyCart()
      Description copied from interface: AccommodationCartFacade
      Removes all the entries in the cart.
      Specified by:
      emptyCart in interface AccommodationCartFacade
    • validateNumberOfRoomsToAdd

      public boolean validateNumberOfRoomsToAdd(String accommodationOfferingCode, String accommodationCode, String ratePlanCode, int numberOfRooms, int allowedNumberOfRooms)
      Description copied from interface: AccommodationCartFacade
      Checks if the number of rooms in the cart after addition would be within the configured limit
      Specified by:
      validateNumberOfRoomsToAdd in interface AccommodationCartFacade
      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
    • addToCart

      public CartModificationData addToCart(String code, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Overriding the method to force creation of new entry. This is because we need a separate entry of the same product to represent a different accommodation order entry group.
      Specified by:
      addToCart in interface de.hybris.platform.commercefacades.order.CartFacade
      Overrides:
      addToCart in class de.hybris.platform.commercefacades.order.impl.DefaultCartFacade
      Parameters:
      code -
      quantity -
      Returns:
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • addRoomRateToCart

      protected CartModificationData addRoomRateToCart(RoomRateCartData rate, List<Integer> entryNumbers, String accCode, String accOffCode, String ratePlanCode) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Add room rate to cart.
      Parameters:
      rate - the rate
      entryNumbers - the entry numbers
      accCode - the acc code
      accOffCode - the acc off code
      ratePlanCode - the rate plan code
      Returns:
      the cart modification data
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the commerce cart modification exception
    • addProductToCart

      public void addProductToCart(String productCode, int roomStayReferenceNumber, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      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.
      Specified by:
      addProductToCart in interface AccommodationCartFacade
      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

      public CartModificationData addProduct(String productCode, int roomStayReferenceNumber, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      Add product to cart occ list.
      Specified by:
      addProduct in interface AccommodationCartFacade
      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
    • updateServiceEntry

      protected CartModificationData updateServiceEntry(long updatedQuantity, AbstractOrderEntryModel existingEntry) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Updates the service entry with the given quantity
      Parameters:
      updatedQuantity - the updatedQuantity
      existingEntry - the existingEntry
      Returns:
      CartModificationData
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the CommerceCartModificationException
    • updateServiceEntry

      public CartModificationData updateServiceEntry(Integer entryId, Long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      Update Service entry
      Specified by:
      updateServiceEntry in interface AccommodationCartFacade
      Returns:
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • removeServiceEntry

      public CartModificationData removeServiceEntry(Integer entryId) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      Remove the service associated to the given entry number
      Specified by:
      removeServiceEntry in interface AccommodationCartFacade
      Parameters:
      entryId - the entryNumber
      Returns:
      CartModificationData
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - the CommerceCartModificationException
    • checkAccomodationServiceRestrictions

      protected void checkAccomodationServiceRestrictions(Long quantity, List<AccommodationOrderEntryGroupModel> accommodationOrderEntryGroups, ProductModel requestedProduct, AccommodationOrderEntryGroupModel requestedAccommodationGroup)
      Checks if the requested quantity respects the accommodation service restrictions
      Parameters:
      quantity - the quantity
      accommodationOrderEntryGroups - the accommodationOrderEntryGroups
      requestedProduct - the requestedProduct
      requestedAccommodationGroup - the requestedAccommodationGroup
    • collectRoomRates

      public List<RoomRateCartData> collectRoomRates(AccommodationAddToCartForm form)
      Description copied from interface: AccommodationCartFacade
      Collect room rates list.
      Specified by:
      collectRoomRates in interface AccommodationCartFacade
      Parameters:
      form - the form
      Returns:
      the list
    • isAmendmentForServices

      public Boolean isAmendmentForServices()
      Description copied from interface: AccommodationCartFacade
      Determines if an amendment is happening on services
      Specified by:
      isAmendmentForServices in interface AccommodationCartFacade
      Returns:
      true if an amendment is happening on services
    • addAccommodationBundleToCart

      public List<CartModificationData> addAccommodationBundleToCart(AccommodationBundleTemplateModel accommodationBundleTemplateModel, AddDealToCartData addDealToCartData) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: AccommodationCartFacade
      This method adds to the cart all the valid room rates belonging to a bundle according with a date range
      Specified by:
      addAccommodationBundleToCart in interface AccommodationCartFacade
      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

      public 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
      Description copied from interface: AccommodationCartFacade
      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
      Specified by:
      replaceAccommodationInCart in interface AccommodationCartFacade
      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
    • collectRoomRates

      public List<RoomRateCartData> collectRoomRates(Date checkInDate, Date checkOutDate, String ratePlanCode)
      Description copied from interface: AccommodationCartFacade
      Collect room rates data list.
      Specified by:
      collectRoomRates in interface AccommodationCartFacade
      Parameters:
      checkInDate - the check in date
      checkOutDate - the check out date
      ratePlanCode - the rate plan code
      Returns:
      the list
    • collectRoomRates

      protected List<RoomRateCartData> collectRoomRates(AccommodationBundleTemplateModel accommodationBundleTemplate, AddDealToCartData addDealToCartData)
      Collect room rates list.
      Parameters:
      accommodationBundleTemplate - the accommodation bundle template
      addDealToCartData - the add deal to cart data
      Returns:
      the list
    • createRoomCartDataList

      protected List<RoomRateCartData> createRoomCartDataList(Date checkInDate, Date checkOutDate, List<ProductModel> roomRateProducts)
      Method iterates through the dates between checkin and checkout date(excluding) and creates room rate data if it doesn't exist otherwise increment the cardinality. The method returns a list of products with the quantity and list of dates.
      Parameters:
      checkInDate - the check in date
      checkOutDate - the check out date
      roomRateProducts - the room rate products
      Returns:
      the list
    • validateRoomRateAgainstDate

      protected boolean validateRoomRateAgainstDate(Date date, ProductModel roomRate)
      Validate room rate against date boolean.
      Parameters:
      date - the date
      roomRate - the room rate
      Returns:
      the boolean
    • isValidDayOfWeek

      protected boolean isValidDayOfWeek(Date date, List<DayOfWeek> daysOfWeek)
      Is valid day of week boolean.
      Parameters:
      date - the date
      daysOfWeek - the days of week
      Returns:
      the boolean
    • buildNewRoomRateCartData

      protected RoomRateCartData buildNewRoomRateCartData(ProductModel productModel, LocalDateTime date)
      Build new room rate cart data room rate cart data.
      Parameters:
      productModel - the product model
      date - the date
      Returns:
      the room rate cart data
    • isNewRoomInCart

      public boolean isNewRoomInCart()
      Description copied from interface: AccommodationCartFacade
      Check whether new room is added into the cart.
      Specified by:
      isNewRoomInCart in interface AccommodationCartFacade
      Returns:
      true if new room is added into the cart
    • removeAccommodationOrderEntryGroup

      public Boolean removeAccommodationOrderEntryGroup(int roomStayReference)
      Description copied from interface: AccommodationCartFacade
      Removes the Accommodation Order Entry Group from cart alongside with all the associated entries
      Specified by:
      removeAccommodationOrderEntryGroup in interface AccommodationCartFacade
      Parameters:
      roomStayReference - the room stay reference
      Returns:
      boolean boolean
    • validateAccommodationCart

      public boolean validateAccommodationCart()
      Description copied from interface: AccommodationCartFacade
      Validates if there are any AccommodationOrderEntryGroups in the cart.
      Specified by:
      validateAccommodationCart in interface AccommodationCartFacade
      Returns:
      boolean boolean
    • getCurrentAccommodationOffering

      public String getCurrentAccommodationOffering()
      Description copied from interface: AccommodationCartFacade
      Returns current accommodation offering that is in the cart
      Specified by:
      getCurrentAccommodationOffering in interface AccommodationCartFacade
      Returns:
      current accommodation offering
    • addSelectedAccommodationToCart

      public boolean addSelectedAccommodationToCart(String accommodationUid, String transportOfferingCode, String travellerCode, String originDestinationRefNo, String travelRoute)
      Description copied from interface: AccommodationCartFacade
      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.
      Specified by:
      addSelectedAccommodationToCart in interface AccommodationCartFacade
      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

      public CartModificationData addSelectedAccommodation(String accommodationUid, String transportOfferingCode, String travellerCode, String originDestinationRefNo, String travelRoute)
      Description copied from interface: AccommodationCartFacade
      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.
      Specified by:
      addSelectedAccommodation in interface AccommodationCartFacade
      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
    • addPropertiesToCartEntry

      protected void addPropertiesToCartEntry(String travellerCode, int originDestinationRefNo, String travelRoute, List<String> transportOfferingCodes, Boolean active, AmendStatus amendStatus, CartModificationData cartModification)
      Adds the properties to cart entry.
      Parameters:
      travellerCode - the traveller code
      originDestinationRefNo - the origin destination ref no
      travelRoute - the travel route
      transportOfferingCodes - the transport offering codes
      active - the active
      amendStatus - the amend status
      cartModification - the cart modification
    • removeSelectedAccommodationFromCart

      public boolean removeSelectedAccommodationFromCart(String accommodationUid, String transportOfferingCode, String travellerCode, String travelRoute)
      Description copied from interface: AccommodationCartFacade
      Removes the selected accommodation from cart.
      Specified by:
      removeSelectedAccommodationFromCart in interface AccommodationCartFacade
      Parameters:
      accommodationUid - the accommodation uid
      transportOfferingCode - the transport offering code
      travellerCode - the traveller code
      travelRoute - the travel route
      Returns:
      true, if successful
    • removeSelectedAccommodation

      public CartModificationData removeSelectedAccommodation(String accommodationUid, String transportOfferingCode, String travellerCode, String travelRoute)
      Description copied from interface: AccommodationCartFacade
      Removes the selected accommodation from cart.
      Specified by:
      removeSelectedAccommodation in interface AccommodationCartFacade
      Parameters:
      accommodationUid - the accommodation uid
      transportOfferingCode - the transport offering code
      travellerCode - the traveller code
      travelRoute - the travel route
      Returns:
      CartModificationData
    • removeRoomStay

      public void removeRoomStay(Integer roomStayRefNumber) throws InvalidRoomStayException, RemoveRoomStayException
      Description copied from interface: AccommodationCartFacade
      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.
      Specified by:
      removeRoomStay in interface AccommodationCartFacade
      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
    • getAccommodationOffering

      protected AccommodationOfferingModel getAccommodationOffering(String accommodationOfferingCode) throws TravelCommerceCartModificationException
      Gets accommodation offering.
      Parameters:
      accommodationCode - the accommodation offering code
      Returns:
      the accommodation offering model
      Throws:
      TravelCommerceCartModificationException - in case of errors
    • getAccommodation

      protected ProductModel getAccommodation(String accommodationCode) throws TravelCommerceCartModificationException
      Gets accommodation.
      Parameters:
      accommodationCode - the accommodation code
      Returns:
      the accommodation model
      Throws:
      TravelCommerceCartModificationException - in case of errors
    • getAccommodationCommerceCartService

      protected AccommodationCommerceCartService getAccommodationCommerceCartService()
      Gets accommodation commerce cart service.
      Returns:
      the accommodationCommerceCartService
    • setAccommodationCommerceCartService

      public void setAccommodationCommerceCartService(AccommodationCommerceCartService accommodationCommerceCartService)
      Sets accommodation commerce cart service.
      Parameters:
      accommodationCommerceCartService - the accommodationCommerceCartService to set
    • getAccommodationService

      protected AccommodationService getAccommodationService()
      Gets accommodation service.
      Returns:
      the accommodation service
    • setAccommodationService

      public void setAccommodationService(AccommodationService accommodationService)
      Sets accommodation service.
      Parameters:
      accommodationService - the accommodation service to set
    • getBookingService

      protected BookingService getBookingService()
      Gets booking service.
      Returns:
      the bookingService
    • setBookingService

      public void setBookingService(BookingService bookingService)
      Sets booking service.
      Parameters:
      bookingService - the bookingService to set
    • getTravelCartService

      protected TravelCartService getTravelCartService()
      Gets travel cart service.
      Returns:
      the travelCartService
    • setTravelCartService

      public void setTravelCartService(TravelCartService travelCartService)
      Sets travel cart service.
      Parameters:
      travelCartService - the travelCartService to set
    • getCartFacade

      protected TravelCartFacade getCartFacade()
      Gets cart facade.
      Returns:
      the cartFacade
    • setCartFacade

      public void setCartFacade(TravelCartFacade cartFacade)
      Sets cart facade.
      Parameters:
      cartFacade - the cartFacade to set
    • getModelService

      protected de.hybris.platform.servicelayer.model.ModelService getModelService()
      Gets model service.
      Overrides:
      getModelService in class de.hybris.platform.commercefacades.order.impl.DefaultCartFacade
      Returns:
      the modelService
    • setModelService

      public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService)
      Sets model service.
      Overrides:
      setModelService in class de.hybris.platform.commercefacades.order.impl.DefaultCartFacade
      Parameters:
      modelService - the modelService to set
    • getEnumerationService

      protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
      Gets enumeration service.
      Returns:
      the enumerationService
    • setEnumerationService

      public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
      Sets enumeration service.
      Parameters:
      enumerationService - the enumerationService to set
    • getBundleCartFacade

      protected de.hybris.platform.configurablebundlefacades.order.BundleCartFacade getBundleCartFacade()
      Gets bundle cart facade.
      Returns:
      the bundleCartFacade
    • setBundleCartFacade

      public void setBundleCartFacade(de.hybris.platform.configurablebundlefacades.order.BundleCartFacade bundleCartFacade)
      Sets bundle cart facade.
      Parameters:
      bundleCartFacade - the bundleCartFacade to set
    • getSelectedAccommodationStrategyList

      protected List<SelectedAccommodationStrategy> getSelectedAccommodationStrategyList()
      Gets selected accommodation strategy list.
      Returns:
      the selectedAccommodationStrategyList
    • setSelectedAccommodationStrategyList

      public void setSelectedAccommodationStrategyList(List<SelectedAccommodationStrategy> selectedAccommodationStrategyList)
      Sets selected accommodation strategy list.
      Parameters:
      selectedAccommodationStrategyList - the selectedAccommodationStrategyList to set
    • getConfiguredAccommodationFacade

      protected ConfiguredAccommodationFacade getConfiguredAccommodationFacade()
      Gets configured accommodation facade.
      Returns:
      the configuredAccommodationFacade
    • setConfiguredAccommodationFacade

      public void setConfiguredAccommodationFacade(ConfiguredAccommodationFacade configuredAccommodationFacade)
      Sets configured accommodation facade.
      Parameters:
      configuredAccommodationFacade - the configuredAccommodationFacade to set
    • getAccommodationMapService

      protected AccommodationMapService getAccommodationMapService()
      Gets accommodation map service.
      Returns:
      the accommodationMapService
    • setAccommodationMapService

      public void setAccommodationMapService(AccommodationMapService accommodationMapService)
      Sets accommodation map service.
      Parameters:
      accommodationMapService - the accommodationMapService to set
    • getTravelCommercePriceFacade

      protected TravelCommercePriceFacade getTravelCommercePriceFacade()
      Gets travel commerce price facade.
      Returns:
      the travelCommercePriceFacade
    • setTravelCommercePriceFacade

      public void setTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade)
      Sets travel commerce price facade.
      Parameters:
      travelCommercePriceFacade - the travelCommercePriceFacade to set
    • getTravelRestrictionFacade

      protected TravelRestrictionFacade getTravelRestrictionFacade()
      Gets travel restriction facade.
      Returns:
      the travelRestrictionFacade
    • setTravelRestrictionFacade

      public void setTravelRestrictionFacade(TravelRestrictionFacade travelRestrictionFacade)
      Sets travel restriction facade.
      Parameters:
      travelRestrictionFacade - the travelRestrictionFacade to set
    • getTravellerFacade

      protected TravellerFacade getTravellerFacade()
      Gets traveller facade.
      Returns:
      TravellerFacade traveller facade
    • setTravellerFacade

      public void setTravellerFacade(TravellerFacade travellerFacade)
      Sets traveller facade.
      Parameters:
      travellerFacade - the traveller facade
    • getTravelBundleCommerceCartFacade

      protected TravelBundleCommerceCartFacade getTravelBundleCommerceCartFacade()
      Gets travel bundle commerce cart facade.
      Returns:
      the travelBundleCommerceCartFacade
    • setTravelBundleCommerceCartFacade

      public void setTravelBundleCommerceCartFacade(TravelBundleCommerceCartFacade travelBundleCommerceCartFacade)
      Sets travel bundle commerce cart facade.
      Parameters:
      travelBundleCommerceCartFacade - the travelBundleCommerceCartFacade to set
    • getRatePlanService

      protected RatePlanService getRatePlanService()
      Gets rate plan service.
      Returns:
      the rate plan service
    • setRatePlanService

      public void setRatePlanService(RatePlanService ratePlanService)
      Sets rate plan service.
      Parameters:
      ratePlanService - the rate plan service
    • getConfigurationService

      protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()
      Gets configuration service.
      Returns:
      the configuration service
    • setConfigurationService

      public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService)
      Sets configuration service.
      Parameters:
      configurationService - the configuration service to set
    • getCheckRequestedQuantityStrategies

      public Map<String,AccommodationRestrictionExtrasStrategy> getCheckRequestedQuantityStrategies()
      gets checkRequestedQuantityStrategies
      Returns:
      checkRequestedQuantityStrategies
    • setCheckRequestedQuantityStrategies

      public void setCheckRequestedQuantityStrategies(Map<String,AccommodationRestrictionExtrasStrategy> checkRequestedQuantityStrategies)
      sets checkRequestedQuantityStrategies
      Parameters:
      checkRequestedQuantityStrategies - the checkRequestedQuantityStrategies
    • getAccommodationOfferingService

      protected AccommodationOfferingService getAccommodationOfferingService()
      Gets accommodation offering service.
      Returns:
      the accommodation offering service
    • setAccommodationOfferingService

      public void setAccommodationOfferingService(AccommodationOfferingService accommodationOfferingService)
      Sets accommodation offering service.
      Parameters:
      accommodationOfferingService - the accommodation offering service