Interface TravelCartFacade
- All Superinterfaces:
de.hybris.platform.commercefacades.order.CartFacade
- All Known Subinterfaces:
ShoppingTravelCartFacade
- All Known Implementing Classes:
DefaultPROSTransportCartFacade,DefaultPROSTravelCartFacade,DefaultShoppingTransportCartFacade,DefaultShoppingTravelCartFacade,DefaultTransportCartFacade,DefaultTravelCartFacade
public interface TravelCartFacade
extends de.hybris.platform.commercefacades.order.CartFacade
Travel Cart facade interface. Service is responsible for updating all necessary information specific for a travel bundle cart.
-
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.4voidaddPropertiesToCartEntry(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 configuredAccommodationIdentifier) 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 orderGuid) 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 discountsgetBookingDueAmount(PriceData totalAmount, PriceData amountPaid) Returns amount due for the bookinggetBookingTotal(String originalOrderCode) Returns the total booking amountGets cart code.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 totalGets the current cart codegetGlobalDiscountForEntryType(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.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.Gets the original order code from the amendment cartCalculates partial paymentReturns 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 OrderEntryTypegetTotalsForReservation(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.0booleanChecks 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 quantityToOffer) Returns true if the product is available for the transport offering.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 optionsvoidMethod 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.voidremoveSelectedAccommodationFromCart(String transportOfferingCode, String travellerCode, String configuredAccommodationUid) This method removes a selected accommodation from the cartvoidremoveVoucher(String voucherCode) Method to remove voucher from cart.voidsetAdditionalSecurity(Boolean additionalSecurity) Sets the additional security active on the session cartvoidsetOrderEntryType(OrderEntryType type, int entryNumber) Assign a specificOrderEntryTypeto a cart entryvoidupdateBundleEntriesWithBundleNumber(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 interface de.hybris.platform.commercefacades.order.CartFacade
addToCart, addToCart, addToCart, estimateExternalTaxes, getCartsForCurrentUser, getDeliveryCountries, getMiniCart, getMostRecentCartGuidForUser, getSessionCart, getSessionCartGuid, getSessionCartWithEntryOrdering, hasEntries, hasSessionCart, removeEntryGroup, removeSessionCart, removeStaleCarts, restoreAnonymousCartAndMerge, restoreAnonymousCartAndTakeOwnership, restoreCartAndMerge, restoreSavedCart, updateCartEntry, updateCartEntry, updateCartEntry, updateCartMetadata, validateCartData
-
Method Details
-
getOrderEntry
OrderEntryData getOrderEntry(String productCode, String travelRouteCode, List<String> transportOfferingCodes, String travellerCode, boolean bundleNoCheckRequired) Gets order entry.- 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
OrderEntryData getOrderEntry(AbstractOrderModel abstractOrderModel, String productCode, String travelRouteCode, List<String> transportOfferingCodes, String travellerCode, boolean bundleNoCheckRequired) Gets order entry from an order.- 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
-
addPropertiesToCartEntry
void addPropertiesToCartEntry(String productCode, int entryNo, List<String> transportOfferingCodes, String travelRouteCode, int originDestinationRefNumber, String travellerCode, Boolean active, AmendStatus amendStatus, String addToCartCriteriaType) Add properties to cart entry.- 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
Add properties to cart entry.- Parameters:
productCode- the product codeentryNo- the entry noparams- the params
-
addSelectedAccommodationToCart
void addSelectedAccommodationToCart(String transportOfferingCode, String travellerCode, String configuredAccommodationIdentifier) This method adds a configured accommodation as a selected accommodation to the cart- Parameters:
transportOfferingCode- the transport offering codetravellerCode- the traveller codeconfiguredAccommodationIdentifier- the configured accommodation identifier
-
removeSelectedAccommodationFromCart
void removeSelectedAccommodationFromCart(String transportOfferingCode, String travellerCode, String configuredAccommodationUid) This method removes a selected accommodation from the cart- Parameters:
transportOfferingCode- the transport offering codetravellerCode- the traveller codeconfiguredAccommodationUid- the configured accommodation identifier
-
isAmendmentCart
Boolean isAmendmentCart()Checks if the current cart in session is used for amendment- Returns:
- true if session cart is used for amendment
-
isAdditionalSecurityActive
Boolean isAdditionalSecurityActive()Checks if the current cart in session has the additional security active- Returns:
- true if session cart has the additional security active
-
setAdditionalSecurity
Sets the additional security active on the session cart- Parameters:
additionalSecurity- the additionalSecurity value
-
removeDeliveryAddress
void removeDeliveryAddress()Removes delivery address from a cart which will be then copied over from billing information -
getOriginalOrderCode
String getOriginalOrderCode()Gets the original order code from the amendment cart- Returns:
- original order code
-
applyVoucher
void applyVoucher(String voucherCode) throws de.hybris.platform.commercefacades.voucher.exceptions.VoucherOperationException Method to add voucher to cart.- Parameters:
voucherCode- the voucher code- Throws:
de.hybris.platform.commercefacades.voucher.exceptions.VoucherOperationException- the voucher operation exception
-
removeVoucher
void removeVoucher(String voucherCode) throws de.hybris.platform.commercefacades.voucher.exceptions.VoucherOperationException Method to remove voucher from cart.- Parameters:
voucherCode- the voucher code- Throws:
de.hybris.platform.commercefacades.voucher.exceptions.VoucherOperationException- the voucher operation exception
-
recalculateCart
void recalculateCart()Method re-calculates cart after adding travel specific details to cart entry i.e. price level, route code, traveller details etc. -
addBundleToCart
List<CartModificationData> addBundleToCart(AddBundleToCartRequestData addBundleToCartRequestData) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException Method to add the fare product including bundled products to cart using bundle implementation introduced with Hybris 6.4- 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
-
hasCartBeenAmended
boolean hasCartBeenAmended()Checks if user made any changes during amendment- Returns:
- true if some changes were made
-
getCurrentCartCode
String getCurrentCartCode()Gets the current cart code- Returns:
- current cart code
-
isProductAvailable
boolean isProductAvailable(String productCode, List<String> transportOfferingCodes, Long quantityToOffer) Returns true if the product is available for the transport offering.- Parameters:
productCode- the product codetransportOfferingCodes- the transport offering codesquantityToOffer- the quantity to offer- Returns:
- true if product is available, else false.
-
evaluateCart
void evaluateCart()Method to evaluate cart using rules engine for fees and discounts -
isCurrentCartValid
boolean isCurrentCartValid()This method will return true if the current cart can be used in booking/amendment flow, false otherwise- Returns:
- the boolean
-
getTotalToPayPrice
PriceData getTotalToPayPrice()Calculates the value of total to pay or refund for current reservation- Returns:
- total to pay
-
setOrderEntryType
Assign a specificOrderEntryTypeto a cart entry- Parameters:
type- the type to setentryNumber- the number of the cart entry to update
-
getPaymentOptions
List<PaymentOptionData> getPaymentOptions()Returns the list of available payment options for the current order- Returns:
- payment options
-
deleteCurrentCart
void deleteCurrentCart()Deletes current cart to avoid processing amendment carts in a normal booking journey -
isValidPaymentOption
Checks if the selected payment options passed as a list of associated transaction is a valid option comparing it with all the available options- Parameters:
transactions- the transactions- Returns:
- boolean
-
getPaymentOptions
Returns the list of available payment options for the current order to pay the remaining amount for a given OrderEntryType- Parameters:
orderEntryType- order entry type- Returns:
- the list of PaymentOptionData
-
getPartialPaymentAmount
PriceData getPartialPaymentAmount()Calculates partial payment- Returns:
- partial payment to pay
-
getTotalToPayPriceAfterChangeDates
Deprecated.since version 5.0Calculates actual Total to pay amount after change dates- Returns:
- total to pay
-
getBookingTotal
Returns the total booking amount- Parameters:
originalOrderCode- original order code- Returns:
- booking total
-
getBookingDueAmount
Returns amount due for the booking- Parameters:
totalAmount- total amountamountPaid- amount paid- Returns:
- due amount
-
getCartTotal
PriceData getCartTotal()Returns current cart total- Returns:
- cart total
-
getNextBundleNumberToUse
Integer getNextBundleNumberToUse()Calculates the next bundle number to be used while adding products belonging to bundle to the cart using directly methods requiring it.- Returns:
- the next number to use when manually add bundle products to cart
-
updateBundleEntriesWithBundleNumber
Updates order entries with the correct incremental bundle number after add to cart- Parameters:
entryNumbers- entry numbersforcedBundleNumber- forcedBundleNumber
-
validateCart
void validateCart(String departureLocation, String arrivalLocation, String departureDate, String returnDate) Validates cart to check if it matches currently selected options. If not, the cart is cleared.- Parameters:
departureLocation- departure locationarrivalLocation- arrival locationdepartureDate- departure datereturnDate- return date
-
cleanUpCartForMinOriginDestinationRefNumber
Cleans up the cart from bundles. It removes all the entries of type TRANSPORT with originDestinationRefNumber greater than the given odRefNum.- Parameters:
odRefNum- as the minimum originDestinationRefNumber
-
removeEntriesForOriginDestinationRefNumber
Removes all cart entries for specific origin destination ref number.- Parameters:
odRefNum- origin destination ref number
-
validateOriginDestinationRefNumbersInCart
boolean validateOriginDestinationRefNumbersInCart()Validates 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.- Returns:
- true if the cart contains at least one abstract order entry type for each originDestinationRefNumber, false otherwise.
-
isNetPrice
Return a boolean according with the nature of the first product price retrieved available for cart calculation- Parameters:
entry- the entry- Returns:
- true if the product has a net price associated, false otherwise
-
getGlobalDiscountForEntryType
BigDecimal getGlobalDiscountForEntryType(AbstractOrderModel abstractOrder, OrderEntryType entryType) Return the portio of global discounts relative to the given entry type- Parameters:
abstractOrder- the abstract orderentryType- the entry type- Returns:
- global discount for entry type
-
getTotalsForReservation
Returns a data representation of totals in an accommodation booking- Parameters:
originalOrderCode- the original order code- Returns:
- totals for reservation
-
validateSeatSelection
boolean validateSeatSelection()Validate seat selection.- Returns:
- the boolean
-
getCartCode
String getCartCode()Gets cart code.- Returns:
- cart guid if anonymous user and cart code if logged in user
-
isAnonymousUserCart
Checks if given card belongs to anonymous user.- Parameters:
cartGuid- GUID of the cart.- Returns:
- true if the cart belongs to anonymous user.
-
assignAnonymousCartToCurrentUser
void assignAnonymousCartToCurrentUser(String toCartGuid) throws de.hybris.platform.commerceservices.order.CommerceCartRestorationException assign the anonymous cart to the current user- Parameters:
toCartGuid- anonymous Cart Guid- Throws:
de.hybris.platform.commerceservices.order.CommerceCartRestorationException- the commerce cart restoration exception
-
getCartEntry
OrderEntryData getCartEntry(Integer entryId, List<Class> expectedTypes) throws TravelCartEntryException Returns an OrderEntryData(containing cart entry details) based on the given cart entry number whith expectedType validation- Parameters:
entryId- the entry identifierexpectedTypes- the expected types- Returns:
OrderEntryDatathe order entry data- Throws:
TravelCartEntryException- the travel cart entry exception
-
getPaymentOptionList
PaymentOptionListData getPaymentOptionList()Returns the list of available payment options for the current order.- Returns:
- payment options
-
validateCart
void validateCart()Validate cart for all the necessary information to place the order -
createCartFromOrder
Create cart from order id.- Parameters:
orderId- the order id- Returns:
- the cart id
-
createCartFromOrderGuid
Create cart from order guid.- Parameters:
orderGuid- the order guid- Returns:
- the cart id
-
removeBoundFromCart
Remove the bound from the cart. It removes all the entries of associated to the bound Id- Parameters:
boundId- as the bound Id
-
validateOrderForAmendment
Validate that an amend cart can be created from the order. 1) If the additional security is false the amendment is possible for everyone who has either the orderId or the orderGuid. 2) If the additional security data is TRUE, the orderId must not be the guid and only the owner of the order can cancel the booking.- Parameters:
orderModel- the Order modelisOrderFromGuid- is the order guid present
-
removeCart
void removeCart() throws TravelCartValidationException, de.hybris.platform.servicelayer.exceptions.ModelRemovalExceptionRemove the cart and all the associated objects that would remain orphan in case of deletion.- Throws:
TravelCartValidationException- the travel cart validation exceptionde.hybris.platform.servicelayer.exceptions.ModelRemovalException- the model removal exception
-