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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final longThis constant value dictates the quantity of the products to be added in the cart. -
Constructor Summary
Constructors -
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) 1.voidaddAccommodationToCart(Date checkInDate, Date checkOutDate, String accommodationOfferingCode, String accommodationCode, List<RoomRateCartData> rates, int numberOfRooms, String ratePlanCode) Perform accommodation into cart, numberOfRooms times.addProduct(String productCode, int roomStayReferenceNumber, long quantity) Add product to cart occ list.voidaddProductToCart(String productCode, int roomStayReferenceNumber, long quantity) Methods that performs the addToCart of a product for the given productCode.protected voidaddPropertiesToCartEntry(String travellerCode, int originDestinationRefNo, String travelRoute, List<String> transportOfferingCodes, Boolean active, AmendStatus amendStatus, CartModificationData cartModification) Adds the properties to cart entry.protected CartModificationDataaddRoomRateToCart(RoomRateCartData rate, List<Integer> entryNumbers, String accCode, String accOffCode, String ratePlanCode) Add room rate to cart.addSelectedAccommodation(String accommodationUid, String transportOfferingCode, String travellerCode, String originDestinationRefNo, String travelRoute) Method responsible to add the accommodation to the cart for the traveller based on the following scenarios: 1.booleanaddSelectedAccommodationToCart(String accommodationUid, String transportOfferingCode, String travellerCode, String originDestinationRefNo, String travelRoute) Method responsible to add the accommodation to the cart for the traveller based on the following scenarios: 1.Overriding the method to force creation of new entry.protected RoomRateCartDatabuildNewRoomRateCartData(ProductModel productModel, LocalDateTime date) Build new room rate cart data room rate cart data.protected voidcheckAccomodationServiceRestrictions(Long quantity, List<AccommodationOrderEntryGroupModel> accommodationOrderEntryGroups, ProductModel requestedProduct, AccommodationOrderEntryGroupModel requestedAccommodationGroup) Checks if the requested quantity respects the accommodation service restrictionsvoidcleanUpCartBeforeAddition(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.protected List<RoomRateCartData>collectRoomRates(AccommodationBundleTemplateModel accommodationBundleTemplate, AddDealToCartData addDealToCartData) Collect room rates list.collectRoomRates(Date checkInDate, Date checkOutDate, String ratePlanCode) Collect room rates data list.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.voidRemoves all the entries in the cart.protected ProductModelgetAccommodation(String accommodationCode) Gets accommodation.protected AccommodationCommerceCartServiceGets accommodation commerce cart service.protected AccommodationMapServiceGets accommodation map service.protected AccommodationOfferingModelgetAccommodationOffering(String accommodationOfferingCode) Gets accommodation offering.protected AccommodationOfferingServiceGets accommodation offering service.protected AccommodationServiceGets accommodation service.protected BookingServiceGets booking service.protected de.hybris.platform.configurablebundlefacades.order.BundleCartFacadeGets bundle cart facade.protected TravelCartFacadeGets cart facade.gets checkRequestedQuantityStrategiesprotected de.hybris.platform.servicelayer.config.ConfigurationServiceGets configuration service.protected ConfiguredAccommodationFacadeGets configured accommodation facade.Returns current accommodation offering that is in the cartprotected de.hybris.platform.enumeration.EnumerationServiceGets enumeration service.protected de.hybris.platform.servicelayer.model.ModelServiceGets model service.protected RatePlanServiceGets rate plan service.protected List<SelectedAccommodationStrategy>Gets selected accommodation strategy list.protected TravelBundleCommerceCartFacadeGets travel bundle commerce cart facade.protected TravelCartServiceGets travel cart service.protected TravelCommercePriceFacadeGets travel commerce price facade.protected TravellerFacadeGets traveller facade.protected TravelRestrictionFacadeGets travel restriction facade.Determines if an amendment is happening on servicesbooleanCheck whether new room is added into the cart.protected booleanisValidDayOfWeek(Date date, List<DayOfWeek> daysOfWeek) Is valid day of week boolean.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) Removes the selected accommodation from cart.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.voidsetAccommodationCommerceCartService(AccommodationCommerceCartService accommodationCommerceCartService) Sets accommodation commerce cart service.voidsetAccommodationMapService(AccommodationMapService accommodationMapService) Sets accommodation map service.voidsetAccommodationOfferingService(AccommodationOfferingService accommodationOfferingService) Sets accommodation offering service.voidsetAccommodationService(AccommodationService accommodationService) Sets accommodation service.voidsetBookingService(BookingService bookingService) Sets booking service.voidsetBundleCartFacade(de.hybris.platform.configurablebundlefacades.order.BundleCartFacade bundleCartFacade) Sets bundle cart facade.voidsetCartFacade(TravelCartFacade cartFacade) Sets cart facade.voidsetCheckRequestedQuantityStrategies(Map<String, AccommodationRestrictionExtrasStrategy> checkRequestedQuantityStrategies) sets checkRequestedQuantityStrategiesvoidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.voidsetConfiguredAccommodationFacade(ConfiguredAccommodationFacade configuredAccommodationFacade) Sets configured accommodation facade.voidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) Sets enumeration service.voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.voidsetRatePlanService(RatePlanService ratePlanService) Sets rate plan service.voidsetSelectedAccommodationStrategyList(List<SelectedAccommodationStrategy> selectedAccommodationStrategyList) Sets selected accommodation strategy list.voidsetTravelBundleCommerceCartFacade(TravelBundleCommerceCartFacade travelBundleCommerceCartFacade) Sets travel bundle commerce cart facade.voidsetTravelCartService(TravelCartService travelCartService) Sets travel cart service.voidsetTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade) Sets travel commerce price facade.voidsetTravellerFacade(TravellerFacade travellerFacade) Sets traveller facade.voidsetTravelRestrictionFacade(TravelRestrictionFacade travelRestrictionFacade) Sets travel restriction facade.protected CartModificationDataupdateServiceEntry(long updatedQuantity, AbstractOrderEntryModel existingEntry) Updates the service entry with the given quantityupdateServiceEntry(Integer entryId, Long quantity) Update Service entryprotected voidvalidateAccommodationAgainstCart(String accommodationOfferingCode, Date checkInDate, Date checkOutDate) Validates if accommodation can be added to the cart.booleanValidates if there are any AccommodationOrderEntryGroups in the cart.protected voidValidates the quantity of accommodations in a 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 limitprotected booleanvalidateRoomRateAgainstDate(Date date, ProductModel roomRate) Validate room rate against date boolean.protected voidvalidateRoomStay(String accommodationOfferingCode, String accommodationCode, String ratePlanCode, Date checkinDate, Date checkoutDate) Validates the room stay information.protected booleanvalidateRoomStayCandidates(List<RoomStayCandidateData> roomStayCandidates, List<AccommodationOrderEntryGroupModel> entryGroups) Validate room stay candidates boolean.Methods inherited from class de.hybris.platform.commercefacades.order.impl.DefaultCartFacade
addToCart, addToCart, configurationInfoToProductConfiguration, configureCartEntry, createCommerceCartParameter, createEmptyCart, deleteGroupedOrderEntriesMultiD, estimateExternalTaxes, filterConfigurationsByConfigurator, getBaseSiteService, getCartConverter, getCartModificationConverter, getCartRestorationConverter, getCartService, getCartsForCurrentUser, getCommerceCartParameterConverter, getCommerceCartService, getCountryConverter, getDeliveryCountries, getDeliveryService, getGroupCartModificationListConverter, getMiniCart, getMiniCartConverter, getMostRecentCartGuidForUser, getOrderEntryConverter, getOrderEntryNumberForMultiD, getPointOfServiceService, getPriceDataFactory, getProductConfigurationMergeStrategies, getProductFacade, getProductService, getSessionCart, getSessionCartGuid, getSessionCartWithEntryOrdering, getUserService, hasEntries, hasEntryGroups, hasSessionCart, mergeOrderEntryWithModelConfiguration, removeEntryGroup, removeSessionCart, removeStaleCarts, restoreAnonymousCartAndMerge, restoreAnonymousCartAndTakeOwnership, restoreCartAndMerge, restoreSavedCart, setBaseSiteService, setCartConverter, setCartModificationConverter, setCartRestorationConverter, setCartService, setCommerceCartParameterConverter, setCommerceCartService, setCountryConverter, setDeliveryService, setGroupCartModificationListConverter, setMiniCartConverter, setOrderEntryConverter, setPointOfServiceService, setPriceDataFactory, setProductConfigurationMergeStrategies, setProductFacade, setProductService, setUserService, updateCartEntry, updateCartEntry, updateCartEntry, updateCartMetadata, validateCartData
-
Field Details
-
PRODUCT_QUANTITY
protected static final long PRODUCT_QUANTITYThis 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:AccommodationCartFacadePerform accommodation into cart, numberOfRooms times.- Specified by:
addAccommodationToCartin interfaceAccommodationCartFacade- 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
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:AccommodationCartFacadeAdd accommodation to cart occ list.- Specified by:
addAccommodationin interfaceAccommodationCartFacade- 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
public int addAccommodation(AddRoomStayData addRoomStayData) throws InvalidSessionCartException, MaximumQuantityExceededException, InvalidRoomStayException, de.hybris.platform.commerceservices.order.CommerceCartModificationException Description copied from interface:AccommodationCartFacadeAdd accommodation to cart.- Specified by:
addAccommodationin interfaceAccommodationCartFacade- Parameters:
addRoomStayData- accommodation parameters- Returns:
- the order entry group number of added accommodation
- Throws:
InvalidSessionCartException- the cart is not in sessionMaximumQuantityExceededException- 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 cart
-
validateMaximumQuantity
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 codecheckInDate- the accommodation codecheckOutDate- the rate plan code- Throws:
InvalidSessionCartException- the cart is not in sessionInvalidRoomStayException- 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 codeaccommodationCode- the accommodation coderatePlanCode- 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:AccommodationCartFacade1. 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:
addAccommodationsToCartin interfaceAccommodationCartFacade- 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
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:AccommodationCartFacadeAdd accommodations to cart occ list.- Specified by:
addAccommodationsin interfaceAccommodationCartFacade- 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
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:AccommodationCartFacadePerform addAccommodationBookingToCart, numberOfRooms times. and then link the entries to given accommodationOrderEntryGroup- Specified by:
addAccommodationsToCartin interfaceAccommodationCartFacade- 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
public void rollbackAccommodationEntries(String accommodationCode, String accommodationOfferingCode, String ratePlanCode) Description copied from interface:AccommodationCartFacadeRemoves entries associated to selected option that was affected during add to cart.- Specified by:
rollbackAccommodationEntriesin interfaceAccommodationCartFacade- Parameters:
accommodationCode- the accommodation codeaccommodationOfferingCode- the accommodation offering coderatePlanCode- the rate plan code
-
cleanUpCartBeforeAddition
public void cleanUpCartBeforeAddition(String accommodationOfferingCode, String checkInDateTime, String checkOutDateTime) Description copied from interface:AccommodationCartFacadeChecks 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:
cleanUpCartBeforeAdditionin interfaceAccommodationCartFacade- Parameters:
accommodationOfferingCode- the accommodation offering codecheckInDateTime- the check in date timecheckOutDateTime- the check out date time
-
cleanUpCartBeforeAddition
public void cleanUpCartBeforeAddition(String accommodationOfferingCode, String checkInDate, String checkOutDate, List<RoomStayCandidateData> roomStayCandidates) Description copied from interface:AccommodationCartFacadeThis method checks if entries that are currently in the cart match the request. If they don't the cart is removed.- Specified by:
cleanUpCartBeforeAdditionin interfaceAccommodationCartFacade- Parameters:
accommodationOfferingCode- the accommodation offering codecheckInDate- the check in datecheckOutDate- the check out dateroomStayCandidates- the room stay candidates
-
validateRoomStayCandidates
protected boolean validateRoomStayCandidates(List<RoomStayCandidateData> roomStayCandidates, List<AccommodationOrderEntryGroupModel> entryGroups) Validate room stay candidates boolean.- Parameters:
roomStayCandidates- the room stay candidatesentryGroups- the entry groups- Returns:
- the boolean
-
emptyCart
public void emptyCart()Description copied from interface:AccommodationCartFacadeRemoves all the entries in the cart.- Specified by:
emptyCartin interfaceAccommodationCartFacade
-
validateNumberOfRoomsToAdd
public boolean validateNumberOfRoomsToAdd(String accommodationOfferingCode, String accommodationCode, String ratePlanCode, int numberOfRooms, int allowedNumberOfRooms) Description copied from interface:AccommodationCartFacadeChecks if the number of rooms in the cart after addition would be within the configured limit- Specified by:
validateNumberOfRoomsToAddin interfaceAccommodationCartFacade- 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
-
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:
addToCartin interfacede.hybris.platform.commercefacades.order.CartFacade- Overrides:
addToCartin classde.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 rateentryNumbers- the entry numbersaccCode- the acc codeaccOffCode- the acc off coderatePlanCode- 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:AccommodationCartFacadeMethods 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:
addProductToCartin interfaceAccommodationCartFacade- 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
public CartModificationData addProduct(String productCode, int roomStayReferenceNumber, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException Description copied from interface:AccommodationCartFacadeAdd product to cart occ list.- Specified by:
addProductin interfaceAccommodationCartFacade- 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
-
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 updatedQuantityexistingEntry- 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:AccommodationCartFacadeUpdate Service entry- Specified by:
updateServiceEntryin interfaceAccommodationCartFacade- 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:AccommodationCartFacadeRemove the service associated to the given entry number- Specified by:
removeServiceEntryin interfaceAccommodationCartFacade- 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 quantityaccommodationOrderEntryGroups- the accommodationOrderEntryGroupsrequestedProduct- the requestedProductrequestedAccommodationGroup- the requestedAccommodationGroup
-
collectRoomRates
Description copied from interface:AccommodationCartFacadeCollect room rates list.- Specified by:
collectRoomRatesin interfaceAccommodationCartFacade- Parameters:
form- the form- Returns:
- the list
-
isAmendmentForServices
Description copied from interface:AccommodationCartFacadeDetermines if an amendment is happening on services- Specified by:
isAmendmentForServicesin interfaceAccommodationCartFacade- 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:AccommodationCartFacadeThis method adds to the cart all the valid room rates belonging to a bundle according with a date range- Specified by:
addAccommodationBundleToCartin interfaceAccommodationCartFacade- 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
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:AccommodationCartFacadeReplaces 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:
replaceAccommodationInCartin interfaceAccommodationCartFacade- 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
-
collectRoomRates
public List<RoomRateCartData> collectRoomRates(Date checkInDate, Date checkOutDate, String ratePlanCode) Description copied from interface:AccommodationCartFacadeCollect room rates data list.- Specified by:
collectRoomRatesin interfaceAccommodationCartFacade- Parameters:
checkInDate- the check in datecheckOutDate- the check out dateratePlanCode- 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 templateaddDealToCartData- 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 datecheckOutDate- the check out dateroomRateProducts- the room rate products- Returns:
- the list
-
validateRoomRateAgainstDate
Validate room rate against date boolean.- Parameters:
date- the dateroomRate- the room rate- Returns:
- the boolean
-
isValidDayOfWeek
Is valid day of week boolean.- Parameters:
date- the datedaysOfWeek- the days of week- Returns:
- the boolean
-
buildNewRoomRateCartData
Build new room rate cart data room rate cart data.- Parameters:
productModel- the product modeldate- the date- Returns:
- the room rate cart data
-
isNewRoomInCart
public boolean isNewRoomInCart()Description copied from interface:AccommodationCartFacadeCheck whether new room is added into the cart.- Specified by:
isNewRoomInCartin interfaceAccommodationCartFacade- Returns:
- true if new room is added into the cart
-
removeAccommodationOrderEntryGroup
Description copied from interface:AccommodationCartFacadeRemoves the Accommodation Order Entry Group from cart alongside with all the associated entries- Specified by:
removeAccommodationOrderEntryGroupin interfaceAccommodationCartFacade- Parameters:
roomStayReference- the room stay reference- Returns:
- boolean boolean
-
validateAccommodationCart
public boolean validateAccommodationCart()Description copied from interface:AccommodationCartFacadeValidates if there are any AccommodationOrderEntryGroups in the cart.- Specified by:
validateAccommodationCartin interfaceAccommodationCartFacade- Returns:
- boolean boolean
-
getCurrentAccommodationOffering
Description copied from interface:AccommodationCartFacadeReturns current accommodation offering that is in the cart- Specified by:
getCurrentAccommodationOfferingin interfaceAccommodationCartFacade- Returns:
- current accommodation offering
-
addSelectedAccommodationToCart
public boolean addSelectedAccommodationToCart(String accommodationUid, String transportOfferingCode, String travellerCode, String originDestinationRefNo, String travelRoute) Description copied from interface:AccommodationCartFacadeMethod 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:
addSelectedAccommodationToCartin interfaceAccommodationCartFacade- 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
public CartModificationData addSelectedAccommodation(String accommodationUid, String transportOfferingCode, String travellerCode, String originDestinationRefNo, String travelRoute) Description copied from interface:AccommodationCartFacadeMethod 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:
addSelectedAccommodationin interfaceAccommodationCartFacade- Parameters:
accommodationUid- the accommodation uidtransportOfferingCode- the transport offering codetravellerCode- the traveller codeoriginDestinationRefNo- the origin destination ref notravelRoute- 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 codeoriginDestinationRefNo- the origin destination ref notravelRoute- the travel routetransportOfferingCodes- the transport offering codesactive- the activeamendStatus- the amend statuscartModification- the cart modification
-
removeSelectedAccommodationFromCart
public boolean removeSelectedAccommodationFromCart(String accommodationUid, String transportOfferingCode, String travellerCode, String travelRoute) Description copied from interface:AccommodationCartFacadeRemoves the selected accommodation from cart.- Specified by:
removeSelectedAccommodationFromCartin interfaceAccommodationCartFacade- Parameters:
accommodationUid- the accommodation uidtransportOfferingCode- the transport offering codetravellerCode- the traveller codetravelRoute- the travel route- Returns:
- true, if successful
-
removeSelectedAccommodation
public CartModificationData removeSelectedAccommodation(String accommodationUid, String transportOfferingCode, String travellerCode, String travelRoute) Description copied from interface:AccommodationCartFacadeRemoves the selected accommodation from cart.- Specified by:
removeSelectedAccommodationin interfaceAccommodationCartFacade- Parameters:
accommodationUid- the accommodation uidtransportOfferingCode- the transport offering codetravellerCode- the traveller codetravelRoute- the travel route- Returns:
CartModificationData
-
removeRoomStay
public void removeRoomStay(Integer roomStayRefNumber) throws InvalidRoomStayException, RemoveRoomStayException Description copied from interface:AccommodationCartFacadeMethod 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:
removeRoomStayin interfaceAccommodationCartFacade- 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
-
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
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
Gets accommodation service.- Returns:
- the accommodation service
-
setAccommodationService
Sets accommodation service.- Parameters:
accommodationService- the accommodation service to set
-
getBookingService
Gets booking service.- Returns:
- the bookingService
-
setBookingService
Sets booking service.- Parameters:
bookingService- the bookingService to set
-
getTravelCartService
Gets travel cart service.- Returns:
- the travelCartService
-
setTravelCartService
Sets travel cart service.- Parameters:
travelCartService- the travelCartService to set
-
getCartFacade
Gets cart facade.- Returns:
- the cartFacade
-
setCartFacade
Sets cart facade.- Parameters:
cartFacade- the cartFacade to set
-
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService()Gets model service.- Overrides:
getModelServicein classde.hybris.platform.commercefacades.order.impl.DefaultCartFacade- Returns:
- the modelService
-
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.- Overrides:
setModelServicein classde.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
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
Gets configured accommodation facade.- Returns:
- the configuredAccommodationFacade
-
setConfiguredAccommodationFacade
public void setConfiguredAccommodationFacade(ConfiguredAccommodationFacade configuredAccommodationFacade) Sets configured accommodation facade.- Parameters:
configuredAccommodationFacade- the configuredAccommodationFacade to set
-
getAccommodationMapService
Gets accommodation map service.- Returns:
- the accommodationMapService
-
setAccommodationMapService
Sets accommodation map service.- Parameters:
accommodationMapService- the accommodationMapService to set
-
getTravelCommercePriceFacade
Gets travel commerce price facade.- Returns:
- the travelCommercePriceFacade
-
setTravelCommercePriceFacade
Sets travel commerce price facade.- Parameters:
travelCommercePriceFacade- the travelCommercePriceFacade to set
-
getTravelRestrictionFacade
Gets travel restriction facade.- Returns:
- the travelRestrictionFacade
-
setTravelRestrictionFacade
Sets travel restriction facade.- Parameters:
travelRestrictionFacade- the travelRestrictionFacade to set
-
getTravellerFacade
Gets traveller facade.- Returns:
- TravellerFacade traveller facade
-
setTravellerFacade
Sets traveller facade.- Parameters:
travellerFacade- the traveller facade
-
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
Gets rate plan service.- Returns:
- the rate plan service
-
setRatePlanService
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
gets checkRequestedQuantityStrategies- Returns:
- checkRequestedQuantityStrategies
-
setCheckRequestedQuantityStrategies
public void setCheckRequestedQuantityStrategies(Map<String, AccommodationRestrictionExtrasStrategy> checkRequestedQuantityStrategies) sets checkRequestedQuantityStrategies- Parameters:
checkRequestedQuantityStrategies- the checkRequestedQuantityStrategies
-
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
-