Interface TravelCartService

All Superinterfaces:
de.hybris.platform.order.AbstractOrderService<CartModel,CartEntryModel>, de.hybris.platform.order.CartService
All Known Subinterfaces:
ShoppingTravelCartService
All Known Implementing Classes:
DefaultPROSTravelCartService, DefaultShoppingTravelCartService, DefaultTravelCartService

public interface TravelCartService extends de.hybris.platform.order.CartService
Extension of CartService which contains travel specific functionality
  • Method Details

    • createCartFromOrder

      CartModel createCartFromOrder(String orderCode, String guid)
      Creates a cart from order which will contain a reference to cloned order by originalOrderCode attribute
      Parameters:
      orderCode - original order
      guid - the guid
      Returns:
      newly created Cart
    • cancelTraveller

      CartModel cancelTraveller(String orderCode, String cancelledTravellerCode, String cancelledTravellerUid, String guid)
      Creates cart from order and removes all entries related to traveller
      Parameters:
      orderCode - the order code
      cancelledTravellerCode - the cancelled traveller code
      cancelledTravellerUid - the cancelled traveller uid
      guid - the guid
      Returns:
      Cart Model without entries related to given traveller
    • removeDeliveryAddress

      void removeDeliveryAddress()
      Removes delivery address from the cart
    • getAvailableStock

      Long getAvailableStock(ProductModel productModel, TransportOfferingModel transportOfferingModel)
      Returns the available stock for Product in TransportOffering.
      Parameters:
      productModel - the product model
      transportOfferingModel - the transport offering model
      Returns:
      Long, quantity available for the product.
    • getFareProductEntries

      List<AbstractOrderEntryModel> getFareProductEntries(AbstractOrderModel abstractOrderModel)
      Returns the list of AbstractOrderEntryModel for fare product from the entries of abstractOrderModel
      Parameters:
      abstractOrderModel - the abstract order model
      Returns:
      list AbstractOrderEntryModel
    • getCurrentDestination

      String getCurrentDestination()
      Retrieves current destination transport facility from items that are in the cart
      Returns:
      current destination
    • getPaymentOptions

      List<PaymentOptionInfo> getPaymentOptions()
      Returns a list of payment options, in which every option is represented by a list of objects storing a subset of order entries, with the relative price to pay and the associated payment conditions
      Returns:
      payment options
    • getPaymentOptions

      List<PaymentOptionInfo> getPaymentOptions(OrderEntryType orderEntryType)
      Returns a list of payment options, in which every option is represented by a list of objects storing a subset of order entries, with the relative price to pay and the associated payment conditions
      Parameters:
      orderEntryType - the order entry type
      Returns:
      payment options
    • deleteCurrentCart

      void deleteCurrentCart()
      Deletes current cart model
    • cancelPartialOrder

      CartModel cancelPartialOrder(String bookingReference, OrderEntryType orderEntryType, String guid)
      Creates cart from order and removes all entries of type orderEntryType
      Parameters:
      bookingReference - the booking reference
      orderEntryType - the order entry type
      guid - the guid
      Returns:
      Cart Model without entries of type orderEntryType
    • 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 - the entry numbers
      forcedBundleNumber - the forced bundle number
    • validateCart

      void validateCart(String departureLocation, String arrivalLocation, String departureDate, String returnDate)
      Validates cart to check if it transport details matches currently selected options. If not, the cart is cleared.
      Parameters:
      departureLocation - departure location
      arrivalLocation - arrival location
      departureDate - departure date
      returnDate - return date
    • setAdditionalSecurity

      void setAdditionalSecurity(Boolean additionalSecurity)
      Sets the additional security active on the session cart
      Parameters:
      additionalSecurity - the additionalSecurity value
    • getTransportTotalByEntries

      BigDecimal getTransportTotalByEntries(AbstractOrderModel order, List<AbstractOrderEntryModel> entries)
      calculates total by entries
      Parameters:
      order - the order
      entries - the entries
      Returns:
      transport total by entries
    • isNetPricedEntry

      Boolean isNetPricedEntry(AbstractOrderEntryModel entry)
      Returns true is the entry price is calculated as net, false otherwise
      Parameters:
      entry - the entry
      Returns:
      boolean
    • 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
    • getEntriesTotal

      BigDecimal getEntriesTotal(List<AbstractOrderEntryModel> entries)
      Calculates the total price of given entries taking into consideration discounts and taxes
      Parameters:
      entries - the entries
      Returns:
      entries total
    • addTravellersToCart

      void addTravellersToCart(Map<String,Integer> travellerQuantityMap) throws de.hybris.platform.servicelayer.exceptions.ModelSavingException, AddTravellerToCartExceptionService
      Adds travellers to the cart.
      Parameters:
      travellerQuantityMap - the travellerQuantityMap
      Throws:
      de.hybris.platform.servicelayer.exceptions.ModelSavingException - the model saving exception
      AddTravellerToCartExceptionService - the add traveller to cart exception service
    • removeTravellerFromCart

      void removeTravellerFromCart(String travellerId)
      Remove traveller from the cart.
      Parameters:
      travellerId - the id of traveller
    • isAmendmentCart

      Boolean isAmendmentCart()
      Check if the current session cart is an amendment cart
      Returns:
      true if is an amendment cart
    • getEntryForId

      AbstractOrderEntryModel getEntryForId(AbstractOrderModel order, Integer entryId)
      Gets entry for id.
      Parameters:
      order - the order
      entryId - the entry id
      Returns:
      the entry for id
    • generateOrderEntryId

      Integer generateOrderEntryId(CartModel cartModel)
      Generate order entry id integer.
      Parameters:
      cartModel - the cart model
      Returns:
      the integer
    • createCartFromOrder

      CartModel createCartFromOrder(OrderModel order, UserModel user)
      Creates a cart from order which will contain a reference to cloned order by original order.
      Parameters:
      orderModel - the original order model
      user - the user
      Returns:
      newly created cart
    • cancelPartialOrder

      CartModel cancelPartialOrder(OrderModel order, OrderEntryType orderEntryType, UserModel user)
      Creates cart from order and removes all entries of type orderEntryType
      Parameters:
      order - the order
      orderEntryType - the order entry type
      user - the user
      Returns:
      Cart Model without entries of type orderEntryType