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 Summary
Modifier and TypeMethodDescriptionintaddAccommodation(AddRoomStayData addRoomStayData) Add accommodation to cart.addAccommodation(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) Add accommodation to cart occ list.addAccommodationBundleToCart(AccommodationBundleTemplateModel accommodationBundleTemplateModel, AddDealToCartData addDealToCartData) This method adds to the cart all the valid room rates belonging to a bundle according with a date rangeaddAccommodations(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) Add accommodations to cart occ list.addAccommodationsToCart(AccommodationOrderEntryGroupModel accommodationOrderEntryGroup, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode, String paymentType) Perform addAccommodationBookingToCart, numberOfRooms times.voidaddAccommodationsToCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) Deprecated, for removal: This API element is subject to removal in a future version.voidaddAccommodationToCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) Deprecated, for removal: This API element is subject to removal in a future version.addProduct(String productCode, int roomStayReferenceNumber, long quantity) Add product to cart occ list.voidaddProductToCart(String productCode, int roomStayReferenceNumber, long quantity) Deprecated, for removal: This API element is subject to removal in a future version.Since 2003 useDefaultAccommodationCartFacade.addProduct(String, int, long)insteadaddSelectedAccommodation(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 2003booleanaddSelectedAccommodationToCart(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.voidcleanUpCartBeforeAddition(String accommodationOfferingCode, String checkInDateTime, String checkOutDateTime) Checks if the accommodationOfferingCode matches the one that is currently in the cart.voidcleanUpCartBeforeAddition(String accommodationOfferingCode, String checkInDate, String checkOutDate, List<RoomStayCandidateData> roomStayCandidates) This method checks if entries that are currently in the cart match the request.Collect room rates list.collectRoomRates(Date checkInDate, Date checkOutDate, String ratePlanCode) Collect room rates data list.voidRemoves all the entries in the cart.Returns current accommodation offering that is in the cartDetermines if an amendment is happening on servicesbooleanCheck whether new room is added into the cart.removeAccommodationOrderEntryGroup(int roomStayReference) Removes the Accommodation Order Entry Group from cart alongside with all the associated entriesvoidremoveRoomStay(Integer roomStayRefNumber) Method responsible to remove the accommodation order entry group and related entries from the cart in the following sequence: 1.removeSelectedAccommodation(String accommodationUid, String transportOfferingCode, String travellerCode, String travelRoute) Removes the selected accommodation from cart.booleanremoveSelectedAccommodationFromCart(String accommodationUid, String transportOfferingCode, String travellerCode, String travelRoute) Deprecated, for removal: This API element is subject to removal in a future version.removeServiceEntry(Integer entryId) Remove the service associated to the given entry numbervoidreplaceAccommodationInCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode, Integer roomStayRefNumber) Replaces the current room stay with a newly selected option.voidrollbackAccommodationEntries(String accommodationCode, String accommodationOfferingCode, String ratePlanCode) Removes entries associated to selected option that was affected during add to cart.updateServiceEntry(Integer entryId, Long quantity) Update Service entrybooleanValidates if there are any AccommodationOrderEntryGroups in the cart.booleanvalidateNumberOfRoomsToAdd(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
-
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 Deprecated, for removal: This API element is subject to removal in a future version.Perform accommodation into cart, numberOfRooms times.- Parameters:
checkInDate- the check in datecheckOutDate- the check out dateaccommodationOfferingCode- the accommodation offering codeaccommodationCode- the accommodation coderates- the ratesnumberOfRooms- the number of roomsratePlanCode- 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 datecheckOutDate- the check out dateaccommodationOfferingCode- the accommodation offering codeaccommodationCode- the accommodation coderates- the ratesnumberOfRooms- the number of roomsratePlanCode- 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 Deprecated, for removal: This API element is subject to removal in a future version.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 datecheckOutDate- the check out dateaccommodationOfferingCode- the accommodation offering codeaccommodationCode- the accommodation coderates- the ratesnumberOfRooms- the number of roomsratePlanCode- 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 datecheckOutDate- the check out dateaccommodationOfferingCode- the accommodation offering codeaccommodationCode- the accommodation coderates- the ratesnumberOfRooms- the number of roomsratePlanCode- 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 exceededInvalidRoomStayException- if room stay information is invalidde.hybris.platform.commerceservices.order.CommerceCartModificationException- if error occurs during adding accommodation to a cartInvalidSessionCartException- 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 groupaccommodationOfferingCode- the accommodation offering codeaccommodationCode- the accommodation coderates- the ratesnumberOfRooms- the number of roomsratePlanCode- the rate plan codepaymentType- 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 codeaccommodationOfferingCode- the accommodation offering coderatePlanCode- 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 codecheckInDateTime- the check in date timecheckOutDateTime- 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 codecheckInDate- the check in datecheckOutDate- the check out dateroomStayCandidates- 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 codeaccommodationCode- the accommodation coderatePlanCode- the rate plan codenumberOfRooms- the number of roomsallowedNumberOfRooms- 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.Since 2003 useDefaultAccommodationCartFacade.addProduct(String, int, long)insteadMethods 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 cartroomStayReferenceNumber- as the reference Number of the room that the product is added toquantity- 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 coderoomStayReferenceNumber- the room stay reference numberquantity- the quantity- Returns:
- the list of
CartModificationData - Throws:
de.hybris.platform.commerceservices.order.CommerceCartModificationException- the commerce cart modification exception
-
removeAccommodationOrderEntryGroup
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 modeladdDealToCartData- 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 datecheckOutDate- check out dateaccommodationOfferingCode- accommodation offering codeaccommodationCode- accommodation coderates- room ratesnumberOfRooms- number of roomsratePlanCode- rate plan coderoomStayRefNumber- 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 uidtransportOfferingCode- the transport offering codetravellerCode- the traveller codeoriginDestinationRefNo- the origin destination ref notravelRoute- 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 2003Method 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 uidtransportOfferingCode- the transport offering codetravellerCode- the traveller codeoriginDestinationRefNo- the origin destination ref notravelRoute- 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 uidtransportOfferingCode- the transport offering codetravellerCode- the traveller codetravelRoute- 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 uidtransportOfferingCode- the transport offering codetravellerCode- the traveller codetravelRoute- the travel route- Returns:
CartModificationData
-
collectRoomRates
Collect room rates data list.- Parameters:
checkInDate- the check in datecheckOutDate- the check out dateratePlanCode- 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 invalidRemoveRoomStayException- if one last room is left for amendment cart or error occurred for removal of accommodation for given roomStayRefNumber
-
DefaultAccommodationCartFacade.addAccommodations(java.util.Date, java.util.Date, java.lang.String, java.lang.String, java.util.List<de.hybris.platform.commercefacades.accommodation.RoomRateCartData>, int, java.lang.String)instead