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

public class TravelCartBundleValidationStrategy extends AbstractTravelCartValidationStrategy
The implementation of TravelCartValidationStrategy Validates the bundle in the cart for price and fare products.
  • Constructor Details

    • TravelCartBundleValidationStrategy

      public TravelCartBundleValidationStrategy()
  • Method Details

    • validateCart

      public void validateCart(CartModel cartModel) throws TravelCartValidationException
      Description copied from interface: TravelCartValidationStrategy
      Validate 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 info
      cartModel - the cart model
    • getTotalFarePrice

      protected double getTotalFarePrice(CartModel cartModel)
      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 data
      cartModel - the cart model
      travelOrderEntryInfoModelList - 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 data
      productCode - the product code
      Returns:
      the boolean
    • filterTransportOfferings

      protected boolean filterTransportOfferings(Set<String> transportOfferingCodes, Collection<TransportOfferingModel> transportOfferings)
      Filter transport offerings.
      Parameters:
      transportOfferingCodes - the transport offering models
      transportOfferings - the transport offerings
      Returns:
      the boolean
    • filterPricedItinerary

      protected boolean filterPricedItinerary(PricedItineraryData pricedItineraryData, Set<String> transportOfferingCodes)
      Filter priced itinerary.
      Parameters:
      pricedItineraryData - the priced itinerary data
      transportOfferingCodes - 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 models
      travellers - the travellers
      Returns:
      fare search request data
    • createTravelPreferences

      protected TravelPreferencesData 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 models
      fareSearchRequestData - 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

      protected boolean isReturnJourney(List<TravelOrderEntryInfoModel> travelOrderEntryInfoModelList)
      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:
      isReturnJourney in class AbstractTravelCartValidationStrategy
      Parameters:
      travelOrderEntryInfoModelList - the travel order entry info model list
      Returns:
      the boolean
    • getUTCDepartureTime

      protected ZonedDateTime getUTCDepartureTime(TransportOfferingModel transportOfferingModel)
      Return the UTC departure time for the given transportOffering
      Overrides:
      getUTCDepartureTime in class AbstractTravelCartValidationStrategy
      Parameters:
      transportOfferingModel - as the tranportOffering
      Returns:
      the zoned date time
    • getFareSearchFacade

      protected FareSearchFacade getFareSearchFacade()
      Gets fare search facade.
      Returns:
      the fare search facade
    • setFareSearchFacade

      public void setFareSearchFacade(FareSearchFacade fareSearchFacade)
      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

      protected BookingFacade getBookingFacade()
      Gets booking facade.
      Returns:
      the booking facade
    • setBookingFacade

      public void setBookingFacade(BookingFacade bookingFacade)
      Sets booking facade.
      Parameters:
      bookingFacade - the booking facade
    • getTravelCartFacade

      protected TravelCartFacade getTravelCartFacade()
      Gets travel cart facade.
      Returns:
      the travel cart facade
    • setTravelCartFacade

      public void setTravelCartFacade(TravelCartFacade travelCartFacade)
      Sets travel cart facade.
      Parameters:
      travelCartFacade - the travel cart facade