Class TravelCartBundleValidationStrategy
java.lang.Object
de.hybris.platform.travelfacades.order.strategies.impl.AbstractTravelCartValidationStrategy
de.hybris.platform.travelfacades.order.strategies.impl.TravelCartBundleValidationStrategy
- All Implemented Interfaces:
TravelCartValidationStrategy
- Direct Known Subclasses:
ShoppingCartSolutionValidationStrategy
The implementation of
TravelCartValidationStrategy
Validates the bundle in the cart for price and fare products.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<OriginDestinationInfoData>createOriginDestinationInfoData(List<TravelOrderEntryInfoModel> travelOrderEntryInfoModels, FareSearchRequestData fareSearchRequestData) Create origin destination info data list.protected List<PassengerTypeQuantityData>createPassengerTypeQuantityData(Collection<TravellerModel> travellers) Create passenger type quantity data.protected TravelPreferencesDataCreate travel preferences travel preferences data.protected booleanfilterPricedItinerary(PricedItineraryData pricedItineraryData, Set<String> transportOfferingCodes) Filter priced itinerary.protected booleanfilterProductByCode(ItineraryPricingInfoData itineraryPricingInfoData, String productCode) Filter product by code.protected booleanfilterTransportOfferings(Set<String> transportOfferingCodes, Collection<TransportOfferingModel> transportOfferings) Filter transport offerings.protected BookingFacadeGets booking facade.protected FareSearchFacadeGets fare search facade.protected List<ItineraryPricingInfoData>getItineraryPricingInfo(FareSelectionData fareSelectionData, CartModel cartModel, List<TravelOrderEntryInfoModel> travelOrderEntryInfoModelList) Filter fare selection by product code, origin destination ref number and transport offerings for current cartprotected de.hybris.platform.servicelayer.session.SessionServiceGets session service.protected doublegetTotalFarePrice(CartModel cartModel) Gets total fare price.protected TravelCartFacadeGets travel cart facade.protected ZonedDateTimegetUTCDepartureTime(TransportOfferingModel transportOfferingModel) Return the UTC departure time for the given transportOfferingprotected booleanisReturnJourney(List<TravelOrderEntryInfoModel> travelOrderEntryInfoModelList) Is return journey.protected FareSearchRequestDataprepareFareSearchRequestData(List<TravelOrderEntryInfoModel> travelOrderEntryInfoModels, Collection<TravellerModel> travellers) Prepare fare search request data.voidsetBookingFacade(BookingFacade bookingFacade) Sets booking facade.voidsetFareSearchFacade(FareSearchFacade fareSearchFacade) Sets fare search facade.voidsetSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets session service.voidsetTravelCartFacade(TravelCartFacade travelCartFacade) Sets travel cart facade.voidvalidateCart(CartModel cartModel) Validate cart for all the necessary information to place the orderprotected voidvalidatePrice(List<ItineraryPricingInfoData> filteredPricingInfo, CartModel cartModel) Checks that the price of all the fare products in the cart is equal to the price retrieved from fare searchMethods inherited from class de.hybris.platform.travelfacades.order.strategies.impl.AbstractTravelCartValidationStrategy
getTransportFareProductEntries, getTravelOrderEntryInfoListForFareProducts
-
Constructor Details
-
TravelCartBundleValidationStrategy
public TravelCartBundleValidationStrategy()
-
-
Method Details
-
validateCart
Description copied from interface:TravelCartValidationStrategyValidate cart for all the necessary information to place the order- Throws:
TravelCartValidationException
-
validatePrice
protected void validatePrice(List<ItineraryPricingInfoData> filteredPricingInfo, CartModel cartModel) Checks that the price of all the fare products in the cart is equal to the price retrieved from fare search- Parameters:
filteredPricingInfo- the filtered pricing infocartModel- the cart model
-
getTotalFarePrice
Gets total fare price. If pricing is net, get total price plus taxes else gets total price.- Parameters:
cartModel- the cart model- Returns:
- the total fare price
-
getItineraryPricingInfo
protected List<ItineraryPricingInfoData> getItineraryPricingInfo(FareSelectionData fareSelectionData, CartModel cartModel, List<TravelOrderEntryInfoModel> travelOrderEntryInfoModelList) Filter fare selection by product code, origin destination ref number and transport offerings for current cart- Parameters:
fareSelectionData- the fare selection datacartModel- the cart modeltravelOrderEntryInfoModelList- the travel order entry info model list- Returns:
- fare selection data
-
filterProductByCode
protected boolean filterProductByCode(ItineraryPricingInfoData itineraryPricingInfoData, String productCode) Filter product by code.- Parameters:
itineraryPricingInfoData- the itinerary pricing info dataproductCode- the product code- Returns:
- the boolean
-
filterTransportOfferings
protected boolean filterTransportOfferings(Set<String> transportOfferingCodes, Collection<TransportOfferingModel> transportOfferings) Filter transport offerings.- Parameters:
transportOfferingCodes- the transport offering modelstransportOfferings- the transport offerings- Returns:
- the boolean
-
filterPricedItinerary
protected boolean filterPricedItinerary(PricedItineraryData pricedItineraryData, Set<String> transportOfferingCodes) Filter priced itinerary.- Parameters:
pricedItineraryData- the priced itinerary datatransportOfferingCodes- the transport offering models- Returns:
- the boolean
-
prepareFareSearchRequestData
protected FareSearchRequestData prepareFareSearchRequestData(List<TravelOrderEntryInfoModel> travelOrderEntryInfoModels, Collection<TravellerModel> travellers) Prepare fare search request data.- Parameters:
travelOrderEntryInfoModels- the travel order entry info modelstravellers- the travellers- Returns:
- fare search request data
-
createTravelPreferences
Create travel preferences travel preferences data.- Returns:
- the travel preferences data
-
createOriginDestinationInfoData
protected List<OriginDestinationInfoData> createOriginDestinationInfoData(List<TravelOrderEntryInfoModel> travelOrderEntryInfoModels, FareSearchRequestData fareSearchRequestData) Create origin destination info data list.- Parameters:
travelOrderEntryInfoModels- the travel order entry info modelsfareSearchRequestData- the fare search request data- Returns:
- the list
-
createPassengerTypeQuantityData
protected List<PassengerTypeQuantityData> createPassengerTypeQuantityData(Collection<TravellerModel> travellers) Create passenger type quantity data.- Parameters:
travellers- the travellers- Returns:
- the list
-
isReturnJourney
Is return journey. Groups travel order entry info by origin destination ref number. Returns true (return journey) if there is more than one origin destination ref number.- Overrides:
isReturnJourneyin classAbstractTravelCartValidationStrategy- Parameters:
travelOrderEntryInfoModelList- the travel order entry info model list- Returns:
- the boolean
-
getUTCDepartureTime
Return the UTC departure time for the given transportOffering- Overrides:
getUTCDepartureTimein classAbstractTravelCartValidationStrategy- Parameters:
transportOfferingModel- as the tranportOffering- Returns:
- the zoned date time
-
getFareSearchFacade
Gets fare search facade.- Returns:
- the fare search facade
-
setFareSearchFacade
Sets fare search facade.- Parameters:
fareSearchFacade- the fare search facade
-
getSessionService
protected de.hybris.platform.servicelayer.session.SessionService getSessionService()Gets session service.- Returns:
- the session service
-
setSessionService
public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets session service.- Parameters:
sessionService- the session service
-
getBookingFacade
Gets booking facade.- Returns:
- the booking facade
-
setBookingFacade
Sets booking facade.- Parameters:
bookingFacade- the booking facade
-
getTravelCartFacade
Gets travel cart facade.- Returns:
- the travel cart facade
-
setTravelCartFacade
Sets travel cart facade.- Parameters:
travelCartFacade- the travel cart facade
-