Class DefaultTravelCartFacade
java.lang.Object
de.hybris.platform.commercefacades.order.impl.DefaultCartFacade
de.hybris.platform.travelfacades.order.impl.DefaultTravelCartFacade
- All Implemented Interfaces:
de.hybris.platform.commercefacades.order.CartFacade,TravelCartFacade
- Direct Known Subclasses:
DefaultShoppingTravelCartFacade,DefaultTransportCartFacade
public class DefaultTravelCartFacade
extends de.hybris.platform.commercefacades.order.impl.DefaultCartFacade
implements TravelCartFacade
The class is responsible for updating certain properties information like transport offering code specific for a travel bundle
in the cart.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final longThis constant value dictates the quantity of the fare product to be added in the cart. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBundleToCart(AddBundleToCartRequestData addBundleToCartRequestData) Method to add the fare product including bundled products to cart using bundle implementation introduced with Hybris 6.4protected List<CartModificationData>addPerLegBundleProductToCart(List<AddBundleToCartData> addBundleToCartDataList) Add per leg bundle product to cart list.protected List<CartModificationData>addProduct(String productId, long quantity, int bundleNo, AddBundleToCartData addBundleToCartData, TravellerData travellerData, PriceLevel priceLevel, Boolean active, AmendStatus amendStatus) Add product list.voidaddPropertiesToCartEntry(String productCode, int entryNo, List<String> transportOfferingCodes, String travelRouteCode, int originDestinationRefNumber, String travellerCode, Boolean active, AmendStatus amendStatus, String addToCartCriteriaType) Add properties to cart entry.voidaddPropertiesToCartEntry(String productCode, int entryNo, Map<String, Object> params) Add properties to cart entry.voidaddSelectedAccommodationToCart(String transportOfferingCode, String travellerCode, String configuredAccommodationUid) This method adds a configured accommodation as a selected accommodation to the cartvoidapplyVoucher(String voucherCode) Method to add voucher to cart.voidassignAnonymousCartToCurrentUser(String toCartGuid) assign the anonymous cart to the current uservoidCleans up the cart from bundles.createCartFromOrder(String orderId) Create cart from order id.createCartFromOrderGuid(String orderId) Create cart from order guid.voidDeletes current cart to avoid processing amendment carts in a normal booking journeyvoidMethod to evaluate cart using rules engine for fees and discountsprotected AccommodationMapServiceGets accommodation map service.protected de.hybris.platform.store.services.BaseStoreServiceGet base store servicegetBookingDueAmount(PriceData totalAmount, PriceData amountPaid) Returns amount due for the bookingprotected BookingFacadeGets booking facade.protected BookingServiceGets booking service.getBookingTotal(String originalOrderCode) Returns the total booking amountprotected de.hybris.platform.configurablebundlefacades.order.BundleCartFacadeGets bundle cart facade.Gets cart code.protected StringgetCartCode(String currentCartCode) Returns the code that is assigned to the version ID field in theTravellerModel.getCartEntry(Integer entryId, List<Class> expectedTypes) Returns an OrderEntryData(containing cart entry details) based on the given cart entry number whith expectedType validationReturns current cart totalprotected de.hybris.platform.servicelayer.i18n.CommonI18NServiceGets common i 18 n service.Gets the current cart codeprotected de.hybris.platform.commerceservices.customer.CustomerAccountServiceGet customer account serviceprotected DoublegetDiscountsToDisplay(AbstractOrderModel abstractOrder) Returns the value of applied global discounts, assuming fixed/percentage discounts on carts are the only occurring discountsgetGlobalDiscountForEntryType(AbstractOrderModel abstractOrder, OrderEntryType entryType) Return the portio of global discounts relative to the given entry typeCalculates the next bundle number to be used while adding products belonging to bundle to the cart using directly methods requiring it.protected List<OrderStatus>Gets not allowed statuses for create amend cart.getOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, String travellerCode, boolean bundleNoCheckRequired) Gets order entry from an order.getOrderEntry(String productCode, String travelRouteCode, List<String> transportOfferingCodes, String travellerCode, boolean bundleNoCheckRequired) Gets order entry.protected de.hybris.platform.servicelayer.dto.converter.Converter<AbstractOrderEntryModel,OrderEntryData> Gets the original order code from the amendment cartCalculates partial paymentprotected de.hybris.platform.servicelayer.dto.converter.Converter<PaymentOptionInfo,PaymentOptionData> Gets payment option converter.Returns the list of available payment options for the current order.Returns the list of available payment options for the current ordergetPaymentOptions(OrderEntryType orderEntryType) Returns the list of available payment options for the current order to pay the remaining amount for a given OrderEntryTypeprotected Map<String,PopulatePropertyMapStrategy> Gets populate cart entry property strategy map.protected Map<String,PriceLevel> getProductPriceLevels(List<AddBundleToCartData> addBundleToCartDataList) Method to populate price levels for all the productsprotected LonggetQuantityToOffer(ProductModel productModel, List<TransportOfferingModel> transportOfferingModels, Long quantity) This method calculates the quantity of a product in offer to compare against the available stock.protected List<SelectedAccommodationValidationStrategy>Gets selected accommodation validation strategy list.protected de.hybris.platform.servicelayer.session.SessionServiceGets session service.getTotalsForReservation(String originalOrderCode) Returns a data representation of totals in an accommodation bookingCalculates the value of total to pay or refund for current reservationDeprecated.since version 5.0protected TransportOfferingServiceGets transport offering service.protected TravelBundleCommerceCartFacadeGets travel bundle commerce cart facade.protected TravelCartServiceGets travel cart service.protected List<TravelCartValidationStrategy>Gets travel cart validation strategy list.protected TravelCommerceCartServiceGets travel commerce cart service.protected TravelCommercePriceFacadeGets travel commerce price facade.protected TravellerDatagetTravellerData(String travellerCode) Returns theTravellerDatacorresponding to the given travellerCode taken from the existing cart entries.protected TravellerFacadeGets traveller facade.protected TravellerServiceGets traveller service.protected StringGets traveller version id from cart.protected TravelPromotionsFacadeGets travel promotions facade.protected TravelRouteServiceGets travel route service.protected TravelRulesServiceGets travel rules service.protected de.hybris.platform.commercefacades.voucher.VoucherFacadeGets voucher facade.booleanChecks if user made any changes during amendmentChecks if the current cart in session has the additional security activeChecks if the current cart in session is used for amendmentbooleanisAnonymousUserCart(String cartGuid) Checks if given card belongs to anonymous user.booleanThis method will return true if the current cart can be used in booking/amendment flow, false otherwiseReturn a boolean according with the nature of the first product price retrieved available for cart calculationbooleanisProductAvailable(String productCode, List<String> transportOfferingCodes, Long quantity) Returns true if the product is available for the transport offering.protected booleanisSameTransaction(PaymentTransactionData submittedTransactions, PaymentTransactionData transaction) Is same transaction boolean.protected booleanisSelectedOption(List<PaymentTransactionData> optionTransactions, List<PaymentTransactionData> submittedTransactions) Is selected option boolean.booleanisValidPaymentOption(List<PaymentTransactionData> transactions) Checks if the selected payment options passed as a list of associated transaction is a valid option comparing it with all the available optionspopulatePropertiesMap(String addToCartCriteriaType, String travelRouteCode, int originDestinationRefNumber, List<String> transportOfferingCodes, List<TravellerModel> travellersList, Boolean active, AmendStatus amendStatus) Populate properties map map.protected RateDatapopulateRateDataFromCart(String originalOrderCode) Populate rate data from cart rate data.voidMethod re-calculates cart after adding travel specific details to cart entry i.e.voidremoveBoundFromCart(String boundId) Remove the bound from the cart.voidRemove the cart and all the associated objects that would remain orphan in case of deletion.voidRemoves delivery address from a cart which will be then copied over from billing informationvoidRemoves all cart entries for specific origin destination ref number.protected voidremoveInternalItems(AbstractOrderModel abstractOrderModel) Remove internal items.voidremoveSelectedAccommodationFromCart(String transportOfferingCode, String travellerCode, String configuredAccommodationUid) This method removes a selected accommodation from the cartprotected voidremoveSpecialServiceRequest(SpecialRequestDetailModel specialRequestDetail) Remove special service request.protected voidremoveTravelOrderEntryInfo(TravelOrderEntryInfoModel travelOrderEntryInfo) Remove travel order entry info.voidremoveVoucher(String voucherCode) Method to remove voucher from cart.voidsetAccommodationMapService(AccommodationMapService accommodationMapService) Sets accommodation map service.voidsetAdditionalSecurity(Boolean additionalSecurity) Sets the additional security active on the session cartprotected voidsetAddToCartParametersInContext(List<String> transportOfferingCodes, String travelRouteCode, TravellerData travellerData, PriceLevel priceLevel, int originDestinationRefNumber, Boolean active, AmendStatus amendStatus) Method to set values in Session Context.voidsetBaseStoreService(de.hybris.platform.store.services.BaseStoreService service) Set base store servicevoidsetBookingFacade(BookingFacade bookingFacade) Sets booking facade.voidsetBookingService(BookingService bookingService) Sets booking service.voidsetBundleCartFacade(de.hybris.platform.configurablebundlefacades.order.BundleCartFacade bundleCartFacade) Sets bundle cart facade.voidsetCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) Sets common i 18 n service.voidsetCustomerAccountService(de.hybris.platform.commerceservices.customer.CustomerAccountService customerAccountService) Set the customer account servicevoidsetNotAllowedStatusesForCreateAmendCart(List<OrderStatus> notAllowedStatusesForCreateAmendCart) Sets not allowed statuses for create amend cart.voidsetOrderEntryConverter(de.hybris.platform.servicelayer.dto.converter.Converter<AbstractOrderEntryModel, OrderEntryData> orderEntryConverter) voidsetOrderEntryType(OrderEntryType type, int entryNumber) Assign a specificOrderEntryTypeto a cart entryvoidsetPaymentOptionConverter(de.hybris.platform.servicelayer.dto.converter.Converter<PaymentOptionInfo, PaymentOptionData> paymentOptionConverter) Sets payment option converter.voidsetPopulateCartEntryPropertyStrategyMap(Map<String, PopulatePropertyMapStrategy> populateCartEntryPropertyStrategyMap) Sets populate cart entry property strategy map.voidsetSelectedAccommodationValidationStrategyList(List<SelectedAccommodationValidationStrategy> selectedAccommodationValidationStrategyList) Sets selected accommodation validation strategy list.voidsetSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets session service.voidsetTransportOfferingService(TransportOfferingService transportOfferingService) Sets transport offering service.voidsetTravelBundleCommerceCartFacade(TravelBundleCommerceCartFacade travelBundleCommerceCartFacade) Sets travel bundle commerce cart facade.voidsetTravelCartService(TravelCartService travelCartService) Sets travel cart service.voidsetTravelCartValidationStrategyList(List<TravelCartValidationStrategy> travelCartValidationStrategyList) Sets travel cart validation strategy list.voidsetTravelCommerceCartService(TravelCommerceCartService travelCommerceCartService) Sets travel commerce cart service.voidsetTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade) Sets travel commerce price facade.voidsetTravellerFacade(TravellerFacade travellerFacade) Sets traveller facade.voidsetTravellerService(TravellerService travellerService) Sets traveller service.voidsetTravelPromotionsFacade(TravelPromotionsFacade travelPromotionsFacade) Sets travel promotions facade.voidsetTravelRouteService(TravelRouteService travelRouteService) Sets travel route service.voidsetTravelRulesService(TravelRulesService travelRulesService) Sets travel rules service.voidsetVoucherFacade(de.hybris.platform.commercefacades.voucher.VoucherFacade voucherFacade) Sets voucher facade.voidupdateBundleEntriesWithBundleNumber(List<Integer> entryNumbers, Integer forcedBundleNumber) Updates order entries with the correct incremental bundle number after add to cartvoidValidate cart for all the necessary information to place the ordervoidvalidateCart(String departureLocation, String arrivalLocation, String departureDate, String returnDate) Validates cart to check if it matches currently selected options.voidvalidateOrderForAmendment(OrderModel orderModel, boolean isOrderFromGuid) Validate that an amend cart can be created from the order.booleanValidates the abstract order entries in the cart, to check that if n is the max originDestinationRefNumber, there is at least one abstract order entry for each i from 0 to n.booleanValidate seat selection.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, getModelService, getMostRecentCartGuidForUser, 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, setModelService, setPointOfServiceService, setPriceDataFactory, setProductConfigurationMergeStrategies, setProductFacade, setProductService, setUserService, updateCartEntry, updateCartEntry, updateCartEntry, updateCartMetadata, validateCartDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.commercefacades.order.CartFacade
addToCart, addToCart, estimateExternalTaxes, getCartsForCurrentUser, getDeliveryCountries, getMiniCart, getMostRecentCartGuidForUser, getSessionCart, getSessionCartGuid, getSessionCartWithEntryOrdering, hasEntries, hasSessionCart, removeEntryGroup, removeSessionCart, removeStaleCarts, restoreAnonymousCartAndMerge, restoreAnonymousCartAndTakeOwnership, restoreCartAndMerge, restoreSavedCart, updateCartEntry, updateCartEntry, updateCartEntry, updateCartMetadata, validateCartData
-
Field Details
-
MINIMUM_PRODUCT_QUANTITY
protected static final long MINIMUM_PRODUCT_QUANTITYThis constant value dictates the quantity of the fare product to be added in the cart.- See Also:
-
-
Constructor Details
-
DefaultTravelCartFacade
public DefaultTravelCartFacade()
-
-
Method Details
-
addToCart
public CartModificationData addToCart(String code, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException - Specified by:
addToCartin interfacede.hybris.platform.commercefacades.order.CartFacade- Overrides:
addToCartin classde.hybris.platform.commercefacades.order.impl.DefaultCartFacade- Throws:
de.hybris.platform.commerceservices.order.CommerceCartModificationException
-
addPropertiesToCartEntry
public void addPropertiesToCartEntry(String productCode, int entryNo, List<String> transportOfferingCodes, String travelRouteCode, int originDestinationRefNumber, String travellerCode, Boolean active, AmendStatus amendStatus, String addToCartCriteriaType) Description copied from interface:TravelCartFacadeAdd properties to cart entry.- Specified by:
addPropertiesToCartEntryin interfaceTravelCartFacade- Parameters:
productCode- the product codeentryNo- the entry notransportOfferingCodes- the transport offering codestravelRouteCode- the travel route codeoriginDestinationRefNumber- the origin destination ref numbertravellerCode- the traveller codeactive- the activeamendStatus- the amend statusaddToCartCriteriaType- the add to cart criteria type
-
addPropertiesToCartEntry
Description copied from interface:TravelCartFacadeAdd properties to cart entry.- Specified by:
addPropertiesToCartEntryin interfaceTravelCartFacade- Parameters:
productCode- the product codeentryNo- the entry noparams- the params
-
addSelectedAccommodationToCart
public void addSelectedAccommodationToCart(String transportOfferingCode, String travellerCode, String configuredAccommodationUid) Description copied from interface:TravelCartFacadeThis method adds a configured accommodation as a selected accommodation to the cart- Specified by:
addSelectedAccommodationToCartin interfaceTravelCartFacade- Parameters:
transportOfferingCode- the transport offering codetravellerCode- the traveller codeconfiguredAccommodationUid- the configured accommodation identifier
-
removeSelectedAccommodationFromCart
public void removeSelectedAccommodationFromCart(String transportOfferingCode, String travellerCode, String configuredAccommodationUid) Description copied from interface:TravelCartFacadeThis method removes a selected accommodation from the cart- Specified by:
removeSelectedAccommodationFromCartin interfaceTravelCartFacade- Parameters:
transportOfferingCode- the transport offering codetravellerCode- the traveller codeconfiguredAccommodationUid- the configured accommodation identifier
-
populatePropertiesMap
protected Map<String,Object> populatePropertiesMap(String addToCartCriteriaType, String travelRouteCode, int originDestinationRefNumber, List<String> transportOfferingCodes, List<TravellerModel> travellersList, Boolean active, AmendStatus amendStatus) Populate properties map map.- Parameters:
addToCartCriteriaType- the add to cart criteria typetravelRouteCode- the travel route codeoriginDestinationRefNumber- the origin destination ref numbertransportOfferingCodes- the transport offering codestravellersList- the travellers listactive- the activeamendStatus- the amend status- Returns:
- the map
-
getOrderEntry
public OrderEntryData getOrderEntry(String productCode, String travelRouteCode, List<String> transportOfferingCodes, String travellerCode, boolean bundleNoCheckRequired) Description copied from interface:TravelCartFacadeGets order entry.- Specified by:
getOrderEntryin interfaceTravelCartFacade- Parameters:
productCode- the product codetravelRouteCode- the travel route codetransportOfferingCodes- the transport offering codestravellerCode- the traveller codebundleNoCheckRequired- the bundle no check required- Returns:
- OrderEntryData order entry
-
getOrderEntry
public OrderEntryData getOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, String travellerCode, boolean bundleNoCheckRequired) Description copied from interface:TravelCartFacadeGets order entry from an order.- Specified by:
getOrderEntryin interfaceTravelCartFacade- Parameters:
abstractOrderModel- the abstract order modelproductCode- the product codetravelRouteCode- the travel route codetransportOfferingCodes- the transport offering codestravellerCode- the traveller codebundleNoCheckRequired- the bundle no check required- Returns:
- OrderEntryData order entry
-
isAmendmentCart
Description copied from interface:TravelCartFacadeChecks if the current cart in session is used for amendment- Specified by:
isAmendmentCartin interfaceTravelCartFacade- Returns:
- true if session cart is used for amendment
-
isAdditionalSecurityActive
Description copied from interface:TravelCartFacadeChecks if the current cart in session has the additional security active- Specified by:
isAdditionalSecurityActivein interfaceTravelCartFacade- Returns:
- true if session cart has the additional security active
-
setAdditionalSecurity
Description copied from interface:TravelCartFacadeSets the additional security active on the session cart- Specified by:
setAdditionalSecurityin interfaceTravelCartFacade- Parameters:
additionalSecurity- the additionalSecurity value
-
removeDeliveryAddress
public void removeDeliveryAddress()Description copied from interface:TravelCartFacadeRemoves delivery address from a cart which will be then copied over from billing information- Specified by:
removeDeliveryAddressin interfaceTravelCartFacade
-
getOriginalOrderCode
Description copied from interface:TravelCartFacadeGets the original order code from the amendment cart- Specified by:
getOriginalOrderCodein interfaceTravelCartFacade- Returns:
- original order code
-
applyVoucher
public void applyVoucher(String voucherCode) throws de.hybris.platform.commercefacades.voucher.exceptions.VoucherOperationException Description copied from interface:TravelCartFacadeMethod to add voucher to cart.- Specified by:
applyVoucherin interfaceTravelCartFacade- Parameters:
voucherCode- the voucher code- Throws:
de.hybris.platform.commercefacades.voucher.exceptions.VoucherOperationException- the voucher operation exception
-
removeVoucher
public void removeVoucher(String voucherCode) throws de.hybris.platform.commercefacades.voucher.exceptions.VoucherOperationException Description copied from interface:TravelCartFacadeMethod to remove voucher from cart.- Specified by:
removeVoucherin interfaceTravelCartFacade- Parameters:
voucherCode- the voucher code- Throws:
de.hybris.platform.commercefacades.voucher.exceptions.VoucherOperationException- the voucher operation exception
-
recalculateCart
public void recalculateCart()Description copied from interface:TravelCartFacadeMethod re-calculates cart after adding travel specific details to cart entry i.e. price level, route code, traveller details etc.- Specified by:
recalculateCartin interfaceTravelCartFacade
-
addBundleToCart
public List<CartModificationData> addBundleToCart(AddBundleToCartRequestData addBundleToCartRequestData) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException Description copied from interface:TravelCartFacadeMethod to add the fare product including bundled products to cart using bundle implementation introduced with Hybris 6.4- Specified by:
addBundleToCartin interfaceTravelCartFacade- Parameters:
addBundleToCartRequestData- the add bundle to cart request data- Returns:
- list of cart modification data
- Throws:
de.hybris.platform.commerceservices.order.CommerceCartModificationException- the commerce cart modification exception
-
addPerLegBundleProductToCart
protected List<CartModificationData> addPerLegBundleProductToCart(List<AddBundleToCartData> addBundleToCartDataList) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException Add per leg bundle product to cart list.- Parameters:
addBundleToCartDataList- the add bundle to cart data list- Returns:
- the list
- Throws:
de.hybris.platform.commerceservices.order.CommerceCartModificationException- the commerce cart modification exception
-
addProduct
protected List<CartModificationData> addProduct(String productId, long quantity, int bundleNo, AddBundleToCartData addBundleToCartData, TravellerData travellerData, PriceLevel priceLevel, Boolean active, AmendStatus amendStatus) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException Add product list.- Parameters:
productId- the product idquantity- the quantitybundleNo- the bundle noaddBundleToCartData- the add bundle to cart datatravellerData- the traveller datapriceLevel- the price levelactive- the activeamendStatus- the amend status- Returns:
- the list
- Throws:
de.hybris.platform.commerceservices.order.CommerceCartModificationException- the commerce cart modification exception
-
getCartCode
Returns the code that is assigned to the version ID field in theTravellerModel. In the current session cart does not have any original order it is returning null.- Parameters:
currentCartCode- the current cart code- Returns:
- cart code
-
getTravellerData
Returns theTravellerDatacorresponding to the given travellerCode taken from the existing cart entries.- Parameters:
travellerCode- as the traveller code- Returns:
- the TravellerData if exists, null otherwise
-
isProductAvailable
public boolean isProductAvailable(String productCode, List<String> transportOfferingCodes, Long quantity) Description copied from interface:TravelCartFacadeReturns true if the product is available for the transport offering.- Specified by:
isProductAvailablein interfaceTravelCartFacade- Parameters:
productCode- the product codetransportOfferingCodes- the transport offering codesquantity- the quantity to offer- Returns:
- true if product is available, else false.
-
getQuantityToOffer
protected Long getQuantityToOffer(ProductModel productModel, List<TransportOfferingModel> transportOfferingModels, Long quantity) This method calculates the quantity of a product in offer to compare against the available stock.- Parameters:
productModel- the product modeltransportOfferingModels- the transport offering modelsquantity- the quantity- Returns:
- a Long
-
getProductPriceLevels
protected Map<String,PriceLevel> getProductPriceLevels(List<AddBundleToCartData> addBundleToCartDataList) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException Method to populate price levels for all the products- Parameters:
addBundleToCartDataList- the add bundle to cart data list- Returns:
- product price levels
- Throws:
de.hybris.platform.commerceservices.order.CommerceCartModificationException- the commerce cart modification exception
-
setAddToCartParametersInContext
protected void setAddToCartParametersInContext(List<String> transportOfferingCodes, String travelRouteCode, TravellerData travellerData, PriceLevel priceLevel, int originDestinationRefNumber, Boolean active, AmendStatus amendStatus) Method to set values in Session Context. These values will be used when the product is added to cart.- Parameters:
transportOfferingCodes- the transport offering codestravelRouteCode- the travel route codetravellerData- the traveller datapriceLevel- the price leveloriginDestinationRefNumber- the origin destination ref numberactive- the activeamendStatus- the amend status
-
getTravellerVersionIdFromCart
Gets traveller version id from cart.- Returns:
- the traveller version id from cart
-
getCurrentCartCode
Description copied from interface:TravelCartFacadeGets the current cart code- Specified by:
getCurrentCartCodein interfaceTravelCartFacade- Returns:
- current cart code
-
hasCartBeenAmended
public boolean hasCartBeenAmended()Description copied from interface:TravelCartFacadeChecks if user made any changes during amendment- Specified by:
hasCartBeenAmendedin interfaceTravelCartFacade- Returns:
- true if some changes were made
-
evaluateCart
public void evaluateCart()Description copied from interface:TravelCartFacadeMethod to evaluate cart using rules engine for fees and discounts- Specified by:
evaluateCartin interfaceTravelCartFacade
-
isCurrentCartValid
public boolean isCurrentCartValid()Description copied from interface:TravelCartFacadeThis method will return true if the current cart can be used in booking/amendment flow, false otherwise- Specified by:
isCurrentCartValidin interfaceTravelCartFacade- Returns:
- the boolean
-
getTotalToPayPrice
Description copied from interface:TravelCartFacadeCalculates the value of total to pay or refund for current reservation- Specified by:
getTotalToPayPricein interfaceTravelCartFacade- Returns:
- total to pay
-
getTotalToPayPriceAfterChangeDates
Deprecated.since version 5.0Description copied from interface:TravelCartFacadeCalculates actual Total to pay amount after change dates- Specified by:
getTotalToPayPriceAfterChangeDatesin interfaceTravelCartFacade- Returns:
- total to pay after change dates
-
getPartialPaymentAmount
Description copied from interface:TravelCartFacadeCalculates partial payment- Specified by:
getPartialPaymentAmountin interfaceTravelCartFacade- Returns:
- partial payment to pay
-
getBookingTotal
Description copied from interface:TravelCartFacadeReturns the total booking amount- Specified by:
getBookingTotalin interfaceTravelCartFacade- Parameters:
originalOrderCode- original order code- Returns:
- booking total
-
getCartTotal
Description copied from interface:TravelCartFacadeReturns current cart total- Specified by:
getCartTotalin interfaceTravelCartFacade- Returns:
- cart total
-
getBookingDueAmount
Description copied from interface:TravelCartFacadeReturns amount due for the booking- Specified by:
getBookingDueAmountin interfaceTravelCartFacade- Parameters:
totalAmount- total amountamountPaid- amount paid- Returns:
- due amount
-
setOrderEntryType
Description copied from interface:TravelCartFacadeAssign a specificOrderEntryTypeto a cart entry- Specified by:
setOrderEntryTypein interfaceTravelCartFacade- Parameters:
type- the type to setentryNumber- the number of the cart entry to update
-
getPaymentOptions
Description copied from interface:TravelCartFacadeReturns the list of available payment options for the current order- Specified by:
getPaymentOptionsin interfaceTravelCartFacade- Returns:
- payment options
-
getPaymentOptions
Description copied from interface:TravelCartFacadeReturns the list of available payment options for the current order to pay the remaining amount for a given OrderEntryType- Specified by:
getPaymentOptionsin interfaceTravelCartFacade- Parameters:
orderEntryType- order entry type- Returns:
- the list of PaymentOptionData
-
deleteCurrentCart
public void deleteCurrentCart()Description copied from interface:TravelCartFacadeDeletes current cart to avoid processing amendment carts in a normal booking journey- Specified by:
deleteCurrentCartin interfaceTravelCartFacade
-
isValidPaymentOption
Description copied from interface:TravelCartFacadeChecks if the selected payment options passed as a list of associated transaction is a valid option comparing it with all the available options- Specified by:
isValidPaymentOptionin interfaceTravelCartFacade- Parameters:
transactions- the transactions- Returns:
- boolean
-
isSelectedOption
protected boolean isSelectedOption(List<PaymentTransactionData> optionTransactions, List<PaymentTransactionData> submittedTransactions) Is selected option boolean.- Parameters:
optionTransactions- the option transactionssubmittedTransactions- the submitted transactions- Returns:
- the boolean
-
isSameTransaction
protected boolean isSameTransaction(PaymentTransactionData submittedTransactions, PaymentTransactionData transaction) Is same transaction boolean.- Parameters:
submittedTransactions- the submitted transactionstransaction- the transaction- Returns:
- the boolean
-
getNextBundleNumberToUse
Description copied from interface:TravelCartFacadeCalculates the next bundle number to be used while adding products belonging to bundle to the cart using directly methods requiring it.- Specified by:
getNextBundleNumberToUsein interfaceTravelCartFacade- Returns:
- the next number to use when manually add bundle products to cart
-
updateBundleEntriesWithBundleNumber
public void updateBundleEntriesWithBundleNumber(List<Integer> entryNumbers, Integer forcedBundleNumber) Description copied from interface:TravelCartFacadeUpdates order entries with the correct incremental bundle number after add to cart- Specified by:
updateBundleEntriesWithBundleNumberin interfaceTravelCartFacade- Parameters:
entryNumbers- entry numbersforcedBundleNumber- forcedBundleNumber
-
validateCart
public void validateCart(String departureLocation, String arrivalLocation, String departureDate, String returnDate) Description copied from interface:TravelCartFacadeValidates cart to check if it matches currently selected options. If not, the cart is cleared.- Specified by:
validateCartin interfaceTravelCartFacade- Parameters:
departureLocation- departure locationarrivalLocation- arrival locationdepartureDate- departure datereturnDate- return date
-
cleanUpCartForMinOriginDestinationRefNumber
Description copied from interface:TravelCartFacadeCleans up the cart from bundles. It removes all the entries of type TRANSPORT with originDestinationRefNumber greater than the given odRefNum.- Specified by:
cleanUpCartForMinOriginDestinationRefNumberin interfaceTravelCartFacade- Parameters:
odRefNum- as the minimum originDestinationRefNumber
-
removeBoundFromCart
Description copied from interface:TravelCartFacadeRemove the bound from the cart. It removes all the entries of associated to the bound Id- Specified by:
removeBoundFromCartin interfaceTravelCartFacade- Parameters:
boundId- as the bound Id
-
removeEntriesForOriginDestinationRefNumber
Description copied from interface:TravelCartFacadeRemoves all cart entries for specific origin destination ref number.- Specified by:
removeEntriesForOriginDestinationRefNumberin interfaceTravelCartFacade- Parameters:
odRefNum- origin destination ref number
-
validateOriginDestinationRefNumbersInCart
public boolean validateOriginDestinationRefNumbersInCart()Description copied from interface:TravelCartFacadeValidates the abstract order entries in the cart, to check that if n is the max originDestinationRefNumber, there is at least one abstract order entry for each i from 0 to n.- Specified by:
validateOriginDestinationRefNumbersInCartin interfaceTravelCartFacade- Returns:
- true if the cart contains at least one abstract order entry type for each originDestinationRefNumber, false otherwise.
-
isNetPrice
Description copied from interface:TravelCartFacadeReturn a boolean according with the nature of the first product price retrieved available for cart calculation- Specified by:
isNetPricein interfaceTravelCartFacade- Parameters:
entry- the entry- Returns:
- true if the product has a net price associated, false otherwise
-
getGlobalDiscountForEntryType
public BigDecimal getGlobalDiscountForEntryType(AbstractOrderModel abstractOrder, OrderEntryType entryType) Description copied from interface:TravelCartFacadeReturn the portio of global discounts relative to the given entry type- Specified by:
getGlobalDiscountForEntryTypein interfaceTravelCartFacade- Parameters:
abstractOrder- the abstract orderentryType- the entry type- Returns:
- global discount for entry type
-
getTotalsForReservation
Description copied from interface:TravelCartFacadeReturns a data representation of totals in an accommodation booking- Specified by:
getTotalsForReservationin interfaceTravelCartFacade- Parameters:
originalOrderCode- the original order code- Returns:
- totals for reservation
-
validateSeatSelection
public boolean validateSeatSelection()Description copied from interface:TravelCartFacadeValidate seat selection.- Specified by:
validateSeatSelectionin interfaceTravelCartFacade- Returns:
- the boolean
-
populateRateDataFromCart
Populate rate data from cart rate data.- Parameters:
originalOrderCode- the original order code- Returns:
- the rate data
-
getDiscountsToDisplay
Returns the value of applied global discounts, assuming fixed/percentage discounts on carts are the only occurring discounts- Parameters:
abstractOrder- the abstract order- Returns:
- discounts to display
-
getCartCode
Description copied from interface:TravelCartFacadeGets cart code.- Specified by:
getCartCodein interfaceTravelCartFacade- Returns:
- cart guid if anonymous user and cart code if logged in user
-
isAnonymousUserCart
Description copied from interface:TravelCartFacadeChecks if given card belongs to anonymous user.- Specified by:
isAnonymousUserCartin interfaceTravelCartFacade- Parameters:
cartGuid- GUID of the cart.- Returns:
- true if the cart belongs to anonymous user.
-
assignAnonymousCartToCurrentUser
public void assignAnonymousCartToCurrentUser(String toCartGuid) throws de.hybris.platform.commerceservices.order.CommerceCartRestorationException Description copied from interface:TravelCartFacadeassign the anonymous cart to the current user- Specified by:
assignAnonymousCartToCurrentUserin interfaceTravelCartFacade- Parameters:
toCartGuid- anonymous Cart Guid- Throws:
de.hybris.platform.commerceservices.order.CommerceCartRestorationException- the commerce cart restoration exception
-
getPaymentOptionList
Returns the list of available payment options for the current order.- Specified by:
getPaymentOptionListin interfaceTravelCartFacade- Returns:
- payment options
-
getCartEntry
public OrderEntryData getCartEntry(Integer entryId, List<Class> expectedTypes) throws TravelCartEntryException Description copied from interface:TravelCartFacadeReturns an OrderEntryData(containing cart entry details) based on the given cart entry number whith expectedType validation- Specified by:
getCartEntryin interfaceTravelCartFacade- Parameters:
entryId- the entry identifierexpectedTypes- the expected types- Returns:
OrderEntryDatathe order entry data- Throws:
TravelCartEntryException- the travel cart entry exception
-
validateCart
public void validateCart()Description copied from interface:TravelCartFacadeValidate cart for all the necessary information to place the order- Specified by:
validateCartin interfaceTravelCartFacade
-
createCartFromOrder
public String createCartFromOrder(String orderId) throws InvalidOrderStatusException, InvalidUserException Description copied from interface:TravelCartFacadeCreate cart from order id.- Specified by:
createCartFromOrderin interfaceTravelCartFacade- Parameters:
orderId- the order id- Returns:
- the cart id
- Throws:
InvalidOrderStatusExceptionInvalidUserException
-
createCartFromOrderGuid
Description copied from interface:TravelCartFacadeCreate cart from order guid.- Specified by:
createCartFromOrderGuidin interfaceTravelCartFacade- Parameters:
orderId- the order guid- Returns:
- the cart id
-
removeCart
public void removeCart() throws TravelCartValidationException, de.hybris.platform.servicelayer.exceptions.ModelRemovalExceptionDescription copied from interface:TravelCartFacadeRemove the cart and all the associated objects that would remain orphan in case of deletion.- Specified by:
removeCartin interfaceTravelCartFacade- Throws:
TravelCartValidationException- the travel cart validation exceptionde.hybris.platform.servicelayer.exceptions.ModelRemovalException- the model removal exception
-
removeInternalItems
Remove internal items.- Parameters:
abstractOrderModel- the abstract order model
-
removeTravelOrderEntryInfo
Remove travel order entry info.- Parameters:
travelOrderEntryInfo- the travel order entry info
-
removeSpecialServiceRequest
Remove special service request.- Parameters:
specialRequestDetail- the special request detail
-
validateOrderForAmendment
Validate that an amend cart can be created from the order.- Specified by:
validateOrderForAmendmentin interfaceTravelCartFacade- Parameters:
orderModel- the order modelisOrderFromGuid- is the order guid present
-
getTravellerService
Gets traveller service.- Returns:
- the travellerService
-
setTravellerService
Sets traveller service.- Parameters:
travellerService- the travellerService to set
-
getOrderEntryConverter
protected de.hybris.platform.servicelayer.dto.converter.Converter<AbstractOrderEntryModel,OrderEntryData> getOrderEntryConverter()- Overrides:
getOrderEntryConverterin classde.hybris.platform.commercefacades.order.impl.DefaultCartFacade- Returns:
- the orderEntryConverter
-
setOrderEntryConverter
public void setOrderEntryConverter(de.hybris.platform.servicelayer.dto.converter.Converter<AbstractOrderEntryModel, OrderEntryData> orderEntryConverter) - Overrides:
setOrderEntryConverterin classde.hybris.platform.commercefacades.order.impl.DefaultCartFacade- Parameters:
orderEntryConverter- the orderEntryConverter to set
-
getTravelRouteService
Gets travel route service.- Returns:
- the travelRouteService
-
setTravelRouteService
Sets travel route service.- Parameters:
travelRouteService- the travelRouteService to set
-
getTransportOfferingService
Gets transport offering service.- Returns:
- the transportOfferingService
-
setTransportOfferingService
Sets transport offering service.- Parameters:
transportOfferingService- the transportOfferingService to set
-
getTravelCommerceCartService
Gets travel commerce cart service.- Returns:
- the travelCommerceCartService
-
setTravelCommerceCartService
Sets travel commerce cart service.- Parameters:
travelCommerceCartService- the travelCommerceCartService to set
-
getAccommodationMapService
Gets accommodation map service.- Returns:
- the accommodationMapService
-
setAccommodationMapService
Sets accommodation map service.- Parameters:
accommodationMapService- the accommodationMapService to set
-
getTravelCartService
Gets travel cart service.- Returns:
- the travelCartService
-
setTravelCartService
Sets travel cart service.- Parameters:
travelCartService- the travelCartService to set
-
getVoucherFacade
protected de.hybris.platform.commercefacades.voucher.VoucherFacade getVoucherFacade()Gets voucher facade.- Returns:
- the voucherFacade
-
setVoucherFacade
public void setVoucherFacade(de.hybris.platform.commercefacades.voucher.VoucherFacade voucherFacade) Sets voucher facade.- Parameters:
voucherFacade- the voucherFacade to set
-
getTravelPromotionsFacade
Gets travel promotions facade.- Returns:
- the travelPromotionsFacade
-
setTravelPromotionsFacade
Sets travel promotions facade.- Parameters:
travelPromotionsFacade- the travelPromotionsFacade to set
-
getTravellerFacade
Gets traveller facade.- Returns:
- the travellerFacade
-
setTravellerFacade
Sets traveller facade.- Parameters:
travellerFacade- the travellerFacade to set
-
getTravelCommercePriceFacade
Gets travel commerce price facade.- Returns:
- the travelCommercePriceFacade
-
setTravelCommercePriceFacade
Sets travel commerce price facade.- Parameters:
travelCommercePriceFacade- the travelCommercePriceFacade to set
-
getSessionService
protected de.hybris.platform.servicelayer.session.SessionService getSessionService()Gets session service.- Returns:
- the sessionService
-
setSessionService
public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets session service.- Parameters:
sessionService- the sessionService to set
-
getBookingService
Gets booking service.- Returns:
- the bookingService
-
setBookingService
Sets booking service.- Parameters:
bookingService- the bookingService to set
-
getTravelRulesService
Gets travel rules service.- Returns:
- the travelRulesService
-
setTravelRulesService
Sets travel rules service.- Parameters:
travelRulesService- the travelRulesService to set
-
getPopulateCartEntryPropertyStrategyMap
Gets populate cart entry property strategy map.- Returns:
- the populateCartEntryPropertyStrategyMap
-
setPopulateCartEntryPropertyStrategyMap
public void setPopulateCartEntryPropertyStrategyMap(Map<String, PopulatePropertyMapStrategy> populateCartEntryPropertyStrategyMap) Sets populate cart entry property strategy map.- Parameters:
populateCartEntryPropertyStrategyMap- the populateCartEntryPropertyStrategyMap to set
-
getCommonI18NService
protected de.hybris.platform.servicelayer.i18n.CommonI18NService getCommonI18NService()Gets common i 18 n service.- Returns:
- the common i 18 n service
-
setCommonI18NService
public void setCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) Sets common i 18 n service.- Parameters:
commonI18NService- the common i 18 n service
-
getPaymentOptionConverter
protected de.hybris.platform.servicelayer.dto.converter.Converter<PaymentOptionInfo,PaymentOptionData> getPaymentOptionConverter()Gets payment option converter.- Returns:
- paymentOptionConverter payment option converter
-
setPaymentOptionConverter
public void setPaymentOptionConverter(de.hybris.platform.servicelayer.dto.converter.Converter<PaymentOptionInfo, PaymentOptionData> paymentOptionConverter) Sets payment option converter.- Parameters:
paymentOptionConverter- the paymentOptionConverter to set
-
getBookingFacade
Gets booking facade.- Returns:
- the bookingFacade
-
setBookingFacade
Sets booking facade.- Parameters:
bookingFacade- the bookingFacade 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
-
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
-
getSelectedAccommodationValidationStrategyList
protected List<SelectedAccommodationValidationStrategy> getSelectedAccommodationValidationStrategyList()Gets selected accommodation validation strategy list.- Returns:
- the selected accommodation validation strategy list
-
setSelectedAccommodationValidationStrategyList
public void setSelectedAccommodationValidationStrategyList(List<SelectedAccommodationValidationStrategy> selectedAccommodationValidationStrategyList) Sets selected accommodation validation strategy list.- Parameters:
selectedAccommodationValidationStrategyList- the selected accommodation validation strategy list
-
getTravelCartValidationStrategyList
Gets travel cart validation strategy list.- Returns:
- the travel cart validation strategy list
-
setTravelCartValidationStrategyList
public void setTravelCartValidationStrategyList(List<TravelCartValidationStrategy> travelCartValidationStrategyList) Sets travel cart validation strategy list.- Parameters:
travelCartValidationStrategyList- the travel cart validation strategy list
-
getNotAllowedStatusesForCreateAmendCart
Gets not allowed statuses for create amend cart.- Returns:
- the not allowed statuses for create amend cart
-
setNotAllowedStatusesForCreateAmendCart
public void setNotAllowedStatusesForCreateAmendCart(List<OrderStatus> notAllowedStatusesForCreateAmendCart) Sets not allowed statuses for create amend cart.- Parameters:
notAllowedStatusesForCreateAmendCart- the not allowed statuses for create amend cart
-
getCustomerAccountService
protected de.hybris.platform.commerceservices.customer.CustomerAccountService getCustomerAccountService()Get customer account service- Returns:
- customerAccountService
-
setCustomerAccountService
public void setCustomerAccountService(de.hybris.platform.commerceservices.customer.CustomerAccountService customerAccountService) Set the customer account service- Parameters:
customerAccountService-
-
getBaseStoreService
protected de.hybris.platform.store.services.BaseStoreService getBaseStoreService()Get base store service- Returns:
-
setBaseStoreService
public void setBaseStoreService(de.hybris.platform.store.services.BaseStoreService service) Set base store service- Parameters:
service-
-