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 Summary
Modifier and TypeMethodDescriptionvoidaddTravellersToCart(Map<String, Integer> travellerQuantityMap) Adds travellers to the cart.cancelPartialOrder(OrderModel order, OrderEntryType orderEntryType, UserModel user) Creates cart from order and removes all entries of type orderEntryTypecancelPartialOrder(String bookingReference, OrderEntryType orderEntryType, String guid) Creates cart from order and removes all entries of type orderEntryTypecancelTraveller(String orderCode, String cancelledTravellerCode, String cancelledTravellerUid, String guid) Creates cart from order and removes all entries related to travellercreateCartFromOrder(OrderModel order, UserModel user) Creates a cart from order which will contain a reference to cloned order by original order.createCartFromOrder(String orderCode, String guid) Creates a cart from order which will contain a reference to cloned order by originalOrderCode attributevoidDeletes current cart modelgenerateOrderEntryId(CartModel cartModel) Generate order entry id integer.getAvailableStock(ProductModel productModel, TransportOfferingModel transportOfferingModel) Returns the available stock for Product in TransportOffering.Retrieves current destination transport facility from items that are in the cartgetEntriesTotal(List<AbstractOrderEntryModel> entries) Calculates the total price of given entries taking into consideration discounts and taxesgetEntryForId(AbstractOrderModel order, Integer entryId) Gets entry for id.getFareProductEntries(AbstractOrderModel abstractOrderModel) Returns the list of AbstractOrderEntryModel for fare product from the entries of abstractOrderModelgetGlobalDiscountForEntryType(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.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 conditionsgetPaymentOptions(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 conditionsgetTransportTotalByEntries(AbstractOrderModel order, List<AbstractOrderEntryModel> entries) calculates total by entriesCheck if the current session cart is an amendment cartReturns true is the entry price is calculated as net, false otherwisevoidRemoves delivery address from the cartvoidremoveTravellerFromCart(String travellerId) Remove traveller from the cart.voidsetAdditionalSecurity(Boolean additionalSecurity) Sets the additional security active on the session cartvoidupdateBundleEntriesWithBundleNumber(List<Integer> entryNumbers, Integer forcedBundleNumber) Updates order entries with the correct incremental bundle number after add to cartvoidvalidateCart(String departureLocation, String arrivalLocation, String departureDate, String returnDate) Validates cart to check if it transport details matches currently selected options.Methods inherited from interface de.hybris.platform.order.AbstractOrderService
addAllGlobalDiscountValues, addAllTotalTaxValues, addGlobalDiscountValue, addNewEntry, addNewEntry, addNewEntry, addTotalTaxValue, clone, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getGlobalDiscountValue, removeGlobalDiscountValue, removeTotalTaxValue, saveOrderMethods inherited from interface de.hybris.platform.order.CartService
addToCart, appendToCart, calculateCart, changeCurrentCartUser, changeSessionCartCurrency, createCartFromQuote, getSessionCart, hasCart, hasSessionCart, removeSessionCart, setSessionCart, updateQuantities, updateQuantities
-
Method Details
-
createCartFromOrder
Creates a cart from order which will contain a reference to cloned order by originalOrderCode attribute- Parameters:
orderCode- original orderguid- 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 codecancelledTravellerCode- the cancelled traveller codecancelledTravellerUid- the cancelled traveller uidguid- the guid- Returns:
- Cart Model without entries related to given traveller
-
removeDeliveryAddress
void removeDeliveryAddress()Removes delivery address from the cart -
getAvailableStock
Returns the available stock for Product in TransportOffering.- Parameters:
productModel- the product modeltransportOfferingModel- the transport offering model- Returns:
- Long, quantity available for the product.
-
getFareProductEntries
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
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
Creates cart from order and removes all entries of type orderEntryType- Parameters:
bookingReference- the booking referenceorderEntryType- the order entry typeguid- 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
Updates order entries with the correct incremental bundle number after add to cart- Parameters:
entryNumbers- the entry numbersforcedBundleNumber- 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 locationarrivalLocation- arrival locationdepartureDate- departure datereturnDate- return date
-
setAdditionalSecurity
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 orderentries- the entries- Returns:
- transport total by entries
-
isNetPricedEntry
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 orderentryType- the entry type- Returns:
- global discount for entry type
-
getEntriesTotal
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, AddTravellerToCartExceptionServiceAdds travellers to the cart.- Parameters:
travellerQuantityMap- the travellerQuantityMap- Throws:
de.hybris.platform.servicelayer.exceptions.ModelSavingException- the model saving exceptionAddTravellerToCartExceptionService- the add traveller to cart exception service
-
removeTravellerFromCart
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
Gets entry for id.- Parameters:
order- the orderentryId- the entry id- Returns:
- the entry for id
-
generateOrderEntryId
Generate order entry id integer.- Parameters:
cartModel- the cart model- Returns:
- the integer
-
createCartFromOrder
Creates a cart from order which will contain a reference to cloned order by original order.- Parameters:
orderModel- the original order modeluser- the user- Returns:
- newly created cart
-
cancelPartialOrder
Creates cart from order and removes all entries of type orderEntryType- Parameters:
order- the orderorderEntryType- the order entry typeuser- the user- Returns:
- Cart Model without entries of type orderEntryType
-