Class DefaultPROSTravelCartService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.order.impl.DefaultAbstractOrderService<CartModel,CartEntryModel>
de.hybris.platform.order.impl.DefaultCartService
de.hybris.platform.travelservices.order.impl.DefaultTravelCartService
de.hybris.platform.shoppingservices.services.impl.DefaultShoppingTravelCartService
de.hybris.platform.prosservices.services.impl.DefaultPROSTravelCartService
- All Implemented Interfaces:
de.hybris.platform.order.AbstractOrderService<CartModel,,CartEntryModel> de.hybris.platform.order.CartService,ShoppingTravelCartService,TravelCartService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
The type Default pros travel cart service.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.travelservices.order.impl.DefaultTravelCartService
FIRST_ORDER_ENTRY_IDFields inherited from class de.hybris.platform.order.impl.DefaultCartService
SESSION_CART_PARAMETER_NAMEFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeFee(CartModel cartModel, TravellerData traveller) Adds a change fee to the cart for a specific traveller.voidaddEvenExchangeFee(CartModel cartModel, TravellerModel traveller) Adds an even exchange fee to the cart.protected voidaddRefundFeeToTheCart(CartModel cartModel, ShoppingRepricingResponseMessage repricerResponseMessage) Checks if there is at least on refund penalty in the repricer response message and add a RefundFee to the cart.protected DoublecalculateBasePriceForSegment(SegmentPrice segmentPrice) Calculate base price for segmentprotected BigDecimalcalculateTotalToPay(AbstractOrderModel abstractOrderModel) Calculates difference between old total and amended total to know how much user should pay (or how much they should be refunded)doublecancelSolution(CartModel cartModel, RepricingRequestData repricingRequestData, ShoppingRepricingResponseMessage repricerResponseMessage) This method deletes a solution fom the cart for all the associated passengers.Gets not allowed statuses for consignment entries.protected de.hybris.platform.product.ProductServiceGets product service.protected Map<String,PROSRemoveOrderEntryStrategy> Gets pros remove order entry strategy map.protected PROSSearchResponseServiceGets pros search response service.protected TravelCommerceCartServiceGets travel commerce cart service.protected List<TravellerModel>getTravellersForRefundFee(CartModel cartModel, List<ChangedTktSolution> changedTktSolutions) Gets travellers with refund fee not null.protected voidremoveOrderEntries(CartModel cartModel, List<AbstractOrderEntryModel> orderEntries) Removes order entries which belong to the same solution in the cart.voidremoveOrderEntriesBySolutionId(Integer solutionId, CartModel cartModel, List<String> passengerIds) Removes all the order entries by solution id or all the order entries having the same transport offering for the solution id.voidsetNotAllowedStatusesForConsignmentEntries(List<String> notAllowedStatusesForConsignmentEntries) Sets not allowed statuses for consignment entries.voidsetProductService(de.hybris.platform.product.ProductService productService) Sets product service.voidsetProsRemoveOrderEntryStrategyMap(Map<String, PROSRemoveOrderEntryStrategy> prosRemoveOrderEntryStrategyMap) Sets pros remove order entry strategy map.voidsetProsSearchResponseService(PROSSearchResponseService prosSearchResponseService) Sets pros search response service.voidsetTravelCommerceCartService(TravelCommerceCartService travelCommerceCartService) Sets travel commerce cart service.voidValidate cart.protected voidvalidateFareProducts(CartModel cartModel) Validate fare products.Methods inherited from class de.hybris.platform.shoppingservices.services.impl.DefaultShoppingTravelCartService
getCurrentDestination, getSearchResponseService, getShoppingTransportOfferingService, isCartValid, setSearchResponseService, setShoppingTransportOfferingServiceMethods inherited from class de.hybris.platform.travelservices.order.impl.DefaultTravelCartService
addTravellersToCart, calculateTotalExtras, cancelPartialOrder, cancelPartialOrder, cancelTraveller, cancelTravellerInternal, cloneAccommodationOrderEntryGroup, cloneAccommodationOrderEntryInfo, cloneSelectedAccommodation, cloneTraveller, cloneTravellers, cloneTravelOrderEntryInfo, cloneTravelOrderEntryInfoAttributes, createCartFromOrder, createCartFromOrder, deleteCurrentCart, forceCurrencyToOriginalOrderCurrency, generateOrderEntryId, getAvailableStock, getBaseStoreService, getBookingService, getCloneAbstractOrderStrategy, getCommerceCartCalculationStrategy, getCommonI18NService, getCustomerAccountService, getEntriesTotal, getEntryForId, getEnumerationService, getFareProductEntries, getGlobalDiscountCalculationStrategyMap, getGlobalDiscountForEntryType, getNextBundleNumberToUse, getOrder, getOrderCodeGenerator, getOriginalOrderEntry, getPassengerTypeService, getPaymentOptionCreationStrategies, getPaymentOptions, getPaymentOptions, getPaymentOptionsCreationStrategyMap, getSessionCart, getStoreSessionService, getTaxCompensationStrategy, getTimeService, getTransportTotalByEntries, getTravelCartDao, getTravelCommercePriceService, getTravelCommerceStockService, getTravellerService, getUserService, isAmendmentCart, isNetPricedEntry, populateOriginalOrderEntry, removeBookedSeatForTraveller, removeDeliveryAddress, removeTravellerFromCart, resetPaymentInfo, setAdditionalSecurity, setBaseStoreService, setBookingService, setCloneAbstractOrderStrategy, setCommerceCartCalculationStrategy, setCommonI18NService, setCustomerAccountService, setEnumerationService, setGlobalDiscountCalculationStrategyMap, setOrderCodeGenerator, setPassengerTypeService, setPaymentOptionCreationStrategies, setPaymentOptionsCreationStrategyMap, setStoreSessionService, setTaxCompensationStrategy, setTimeService, setTravelCartDao, setTravelCommercePriceService, setTravelCommerceStockService, setTravellerService, setUserService, updateBundleEntriesWithBundleNumber, validateCartMethods inherited from class de.hybris.platform.order.impl.DefaultCartService
addToCart, appendToCart, calculateCart, changeCurrentCartUser, changeSessionCartCurrency, clone, createCartFromQuote, getCreateCartFromQuoteStrategy, getNextEntryNumber, hasCart, hasSessionCart, internalGetSessionCart, postProcessClonedEntries, removeSessionCart, setAddToCartStrategy, setCartFactory, setCreateCartFromQuoteStrategy, setOrderCalculation, setSessionCart, updateQuantities, updateQuantitiesMethods inherited from class de.hybris.platform.order.impl.DefaultAbstractOrderService
addAllGlobalDiscountValues, addAllTotalTaxValues, addEntryAtPosition, addGlobalDiscountValue, addNewEntry, addNewEntry, addNewEntry, addTotalTaxValue, getAbstractOrderEntryService, getAbstractOrderEntryTypeService, getCollidingEntry, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getEntryTypeCode, getGlobalDiscountValue, getOrderDao, getSaveAbstractOrderStrategy, removeGlobalDiscountValue, removeTotalTaxValue, saveOrder, setAbstractOrderEntryService, setAbstractOrderEntryTypeService, setOrderDao, setSaveAbstractOrderStrategyMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, updateQuantitiesMethods inherited from interface de.hybris.platform.travelservices.order.TravelCartService
addTravellersToCart, cancelPartialOrder, cancelPartialOrder, cancelTraveller, createCartFromOrder, createCartFromOrder, deleteCurrentCart, generateOrderEntryId, getAvailableStock, getEntriesTotal, getEntryForId, getFareProductEntries, getGlobalDiscountForEntryType, getNextBundleNumberToUse, getPaymentOptions, getPaymentOptions, getTransportTotalByEntries, isAmendmentCart, isNetPricedEntry, removeDeliveryAddress, removeTravellerFromCart, setAdditionalSecurity, updateBundleEntriesWithBundleNumber, validateCart
-
Constructor Details
-
DefaultPROSTravelCartService
public DefaultPROSTravelCartService()
-
-
Method Details
-
validateCart
public void validateCart() throws de.hybris.platform.order.InvalidCartExceptionDescription copied from class:DefaultShoppingTravelCartServiceValidate cart.- Specified by:
validateCartin interfaceShoppingTravelCartService- Overrides:
validateCartin classDefaultShoppingTravelCartService- Throws:
de.hybris.platform.order.InvalidCartException- the invalid cart exception
-
validateFareProducts
protected void validateFareProducts(CartModel cartModel) throws de.hybris.platform.order.InvalidCartException Validate fare products.- Parameters:
cartModel- the cart model- Throws:
de.hybris.platform.order.InvalidCartException- the invalid cart exception
-
calculateBasePriceForSegment
Calculate base price for segment- Parameters:
segmentPrice- the segment price- Returns:
- the base price
-
cancelSolution
public double cancelSolution(CartModel cartModel, RepricingRequestData repricingRequestData, ShoppingRepricingResponseMessage repricerResponseMessage) throws CancelFlightException, de.hybris.platform.order.exceptions.CalculationException This method deletes a solution fom the cart for all the associated passengers. As first step, the entries in the cart are filtered by 1) either by solutionId or by transport offering codes, since the ancillary/baggage products added after an add solution to the cart don't have a solutionId associated to them; 2) consignment status of the related consignment entries different from SHIPPED/FLOWN/CANCELLED. As second step, a strategy is performed to evaluate the removal of the order entry from the cart. As third step, the method checks if there are at least one penalty fee in the repricer response to pay in order to allow the cancel flight operation and if it is present adds the RefundFee to the cart. After that, a comparison between the refund tax breakdown in the repricer response and the taxes of the order entries is done: if there is at least a tax which has not been fully refundable, an additional tax with same code and price equal to the non-refunded amount is added to the cart (in the list of total tax values).- Specified by:
cancelSolutionin interfaceShoppingTravelCartService- Overrides:
cancelSolutionin classDefaultShoppingTravelCartService- Parameters:
cartModel- the cartModelrepricingRequestData- the solutionIdrepricerResponseMessage- the repricerResponseMessage- Returns:
- the total to Refund after the cancel flight.
- Throws:
CancelFlightException- thrown if an error occur during the removal of the order entry or during the addition of an ancillaryChange/Refund/CompensationTax fee.de.hybris.platform.order.exceptions.CalculationException
-
removeOrderEntriesBySolutionId
public void removeOrderEntriesBySolutionId(Integer solutionId, CartModel cartModel, List<String> passengerIds) throws CancelFlightException Removes all the order entries by solution id or all the order entries having the same transport offering for the solution id.- Specified by:
removeOrderEntriesBySolutionIdin interfaceShoppingTravelCartService- Overrides:
removeOrderEntriesBySolutionIdin classDefaultShoppingTravelCartService- Parameters:
solutionId- the solution idcartModel- the cart modelpassengerIds- the list of passengers- Throws:
CancelFlightException- the cancel flight exception
-
calculateTotalToPay
Calculates difference between old total and amended total to know how much user should pay (or how much they should be refunded)- Parameters:
abstractOrderModel- the abstract order model- Returns:
- price to pay (or to be refunded)
-
addRefundFeeToTheCart
protected void addRefundFeeToTheCart(CartModel cartModel, ShoppingRepricingResponseMessage repricerResponseMessage) throws CancelFlightException Checks if there is at least on refund penalty in the repricer response message and add a RefundFee to the cart. After the fee is added to the cart and set the active status to ACTIVE.- Parameters:
cartModel- the cart modelrepricerResponseMessage- the repricer response message- Throws:
CancelFlightException
-
getTravellersForRefundFee
protected List<TravellerModel> getTravellersForRefundFee(CartModel cartModel, List<ChangedTktSolution> changedTktSolutions) Gets travellers with refund fee not null.- Parameters:
cartModel-changedTktSolutions- the changed tkt solutions- Returns:
- the travellers for refund fee
-
removeOrderEntries
protected void removeOrderEntries(CartModel cartModel, List<AbstractOrderEntryModel> orderEntries) throws CancelFlightException Removes order entries which belong to the same solution in the cart. The order entries will be removed basing on a strategy list performed on them.- Parameters:
cartModel- theorderEntries- the order entries- Throws:
CancelFlightException- the cancel flight exception
-
addChangeFee
Adds a change fee to the cart for a specific traveller.- Specified by:
addChangeFeein interfaceShoppingTravelCartService- Overrides:
addChangeFeein classDefaultShoppingTravelCartService- Parameters:
cartModel- the cart modeltraveller- the traveller- Throws:
ChangeFlightException- thrown when an error occurs during the addition of the changeFee product in the cart.
-
addEvenExchangeFee
public void addEvenExchangeFee(CartModel cartModel, TravellerModel traveller) throws ChangeFlightException Adds an even exchange fee to the cart.- Specified by:
addEvenExchangeFeein interfaceShoppingTravelCartService- Overrides:
addEvenExchangeFeein classDefaultShoppingTravelCartService- Parameters:
cartModel- the cart modeltraveller- the traveller- Throws:
ChangeFlightException- thrown when an error occurs during the addition of the EvenExchangeFee product in the cart.
-
getProsSearchResponseService
Gets pros search response service.- Returns:
- the pros search response service
-
setProsSearchResponseService
Sets pros search response service.- Parameters:
prosSearchResponseService- the pros search response service
-
getProsRemoveOrderEntryStrategyMap
Gets pros remove order entry strategy map.- Returns:
- the pros remove order entry strategy map
-
setProsRemoveOrderEntryStrategyMap
public void setProsRemoveOrderEntryStrategyMap(Map<String, PROSRemoveOrderEntryStrategy> prosRemoveOrderEntryStrategyMap) Sets pros remove order entry strategy map.- Parameters:
prosRemoveOrderEntryStrategyMap- the pros remove order entry strategy map
-
getProductService
protected de.hybris.platform.product.ProductService getProductService()Gets product service.- Returns:
- the product service
-
setProductService
public void setProductService(de.hybris.platform.product.ProductService productService) Sets product service.- Parameters:
productService- the product service
-
getTravelCommerceCartService
Gets travel commerce cart service.- Returns:
- the travel commerce cart service
-
setTravelCommerceCartService
Sets travel commerce cart service.- Parameters:
travelCommerceCartService- the travel commerce cart service
-
getNotAllowedStatusesForConsignmentEntries
Gets not allowed statuses for consignment entries.- Returns:
- the not allowed statuses for consignment entries
-
setNotAllowedStatusesForConsignmentEntries
public void setNotAllowedStatusesForConsignmentEntries(List<String> notAllowedStatusesForConsignmentEntries) Sets not allowed statuses for consignment entries.- Parameters:
notAllowedStatusesForConsignmentEntries- the not allowed statuses for consignment entries
-