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 Details

    • getOrderEntry

      OrderEntryData getOrderEntry(String productCode, String travelRouteCode, List<String> transportOfferingCodes, String travellerCode, boolean bundleNoCheckRequired)
      Gets order entry.
      Parameters:
      productCode - the product code
      travelRouteCode - the travel route code
      transportOfferingCodes - the transport offering codes
      travellerCode - the traveller code
      bundleNoCheckRequired - 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 model
      productCode - the product code
      travelRouteCode - the travel route code
      transportOfferingCodes - the transport offering codes
      travellerCode - the traveller code
      bundleNoCheckRequired - 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 code
      entryNo - the entry no
      transportOfferingCodes - the transport offering codes
      travelRouteCode - the travel route code
      originDestinationRefNumber - the origin destination ref number
      travellerCode - the traveller code
      active - the active
      amendStatus - the amend status
      addToCartCriteriaType - the add to cart criteria type
    • addPropertiesToCartEntry

      void addPropertiesToCartEntry(String productCode, int entryNo, Map<String,Object> params)
      Add properties to cart entry.
      Parameters:
      productCode - the product code
      entryNo - the entry no
      params - 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 code
      travellerCode - the traveller code
      configuredAccommodationIdentifier - 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 code
      travellerCode - the traveller code
      configuredAccommodationUid - 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

      void setAdditionalSecurity(Boolean additionalSecurity)
      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 code
      transportOfferingCodes - the transport offering codes
      quantityToOffer - 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

      void setOrderEntryType(OrderEntryType type, int entryNumber)
      Assign a specific OrderEntryType to a cart entry
      Parameters:
      type - the type to set
      entryNumber - 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

      boolean isValidPaymentOption(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 options
      Parameters:
      transactions - the transactions
      Returns:
      boolean
    • getPaymentOptions

      List<PaymentOptionData> getPaymentOptions(OrderEntryType orderEntryType)
      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 PriceData getTotalToPayPriceAfterChangeDates()
      Deprecated.
      since version 5.0
      Calculates actual Total to pay amount after change dates
      Returns:
      total to pay
    • getBookingTotal

      PriceData getBookingTotal(String originalOrderCode)
      Returns the total booking amount
      Parameters:
      originalOrderCode - original order code
      Returns:
      booking total
    • getBookingDueAmount

      PriceData getBookingDueAmount(PriceData totalAmount, PriceData amountPaid)
      Returns amount due for the booking
      Parameters:
      totalAmount - total amount
      amountPaid - 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

      void updateBundleEntriesWithBundleNumber(List<Integer> entryNumbers, Integer forcedBundleNumber)
      Updates order entries with the correct incremental bundle number after add to cart
      Parameters:
      entryNumbers - entry numbers
      forcedBundleNumber - 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 location
      arrivalLocation - arrival location
      departureDate - departure date
      returnDate - return date
    • cleanUpCartForMinOriginDestinationRefNumber

      void cleanUpCartForMinOriginDestinationRefNumber(Integer odRefNum)
      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

      void removeEntriesForOriginDestinationRefNumber(Integer odRefNum)
      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

      Boolean isNetPrice(AbstractOrderEntryModel entry)
      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 order
      entryType - the entry type
      Returns:
      global discount for entry type
    • getTotalsForReservation

      RateData getTotalsForReservation(String originalOrderCode)
      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

      boolean isAnonymousUserCart(String cartGuid)
      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 identifier
      expectedTypes - the expected types
      Returns:
      OrderEntryData the 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

      String createCartFromOrder(String orderId)
      Create cart from order id.
      Parameters:
      orderId - the order id
      Returns:
      the cart id
    • createCartFromOrderGuid

      String createCartFromOrderGuid(String orderGuid)
      Create cart from order guid.
      Parameters:
      orderGuid - the order guid
      Returns:
      the cart id
    • removeBoundFromCart

      void removeBoundFromCart(String boundId)
      Remove the bound from the cart. It removes all the entries of associated to the bound Id
      Parameters:
      boundId - as the bound Id
    • validateOrderForAmendment

      void validateOrderForAmendment(OrderModel orderModel, boolean isOrderFromGuid)
      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 model
      isOrderFromGuid - is the order guid present
    • removeCart

      void removeCart() throws TravelCartValidationException, de.hybris.platform.servicelayer.exceptions.ModelRemovalException
      Remove the cart and all the associated objects that would remain orphan in case of deletion.
      Throws:
      TravelCartValidationException - the travel cart validation exception
      de.hybris.platform.servicelayer.exceptions.ModelRemovalException - the model removal exception