Class ReservationItineraryPricingInfoHandler

java.lang.Object
de.hybris.platform.travelfacades.reservation.handlers.impl.ReservationItineraryPricingInfoHandler
All Implemented Interfaces:
ReservationHandler

public class ReservationItineraryPricingInfoHandler extends Object implements ReservationHandler
This handler is responsible for instantiating Itinerary Pricing Info for given leg which will contain summary of fare products selected by user
  • Constructor Details

    • ReservationItineraryPricingInfoHandler

      public ReservationItineraryPricingInfoHandler()
  • Method Details

    • handle

      public void handle(AbstractOrderModel abstractOrderModel, ReservationData reservationData)
      Description copied from interface: ReservationHandler
      Handle method.
      Specified by:
      handle in interface ReservationHandler
      Parameters:
      abstractOrderModel - the abstract order model
      reservationData - the reservation data
    • createItineraryPricingInfo

      protected ItineraryPricingInfoData createItineraryPricingInfo(AbstractOrderModel abstractOrderModel, ReservationItemData reservationItem)
      Creates a new Itinerary Pricing Info to hold fare products summary for each leg of the journey
      Parameters:
      abstractOrderModel - - given Abstract Order
      reservationItem - - Reservation Item of current leg
      Returns:
      new itinerary pricing info
    • createTravellerBreakdowns

      protected List<TravellerBreakdownData> createTravellerBreakdowns(List<AbstractOrderEntryModel> bundledEntries, ReservationItemData reservationItem)
      Creates price breakdown for each traveller.
      Parameters:
      bundledEntries - - entries that are in a bundle for current leg
      reservationItem - - Reservation Item of current leg
      Returns:
      list of traveller breakdowns
    • createTravellerBreakdown

      protected TravellerBreakdownData createTravellerBreakdown(List<AbstractOrderEntryModel> bundledEntries, TravellerData traveller)
      Create a new travellerBreakdownData for the given traveller.
      Parameters:
      bundledEntries - the bundled entries
      traveller - the traveller
      Returns:
      the newly created travellerBreakdownData
    • calculateTravellerFare

      protected PassengerFareData calculateTravellerFare(List<AbstractOrderEntryModel> bundledEntries, TravellerData traveller)
      Sums up all bundle products prices for given traveller
      Parameters:
      bundledEntries - the bundled entries
      traveller - the traveller
      Returns:
      sum of bundle product prices
    • retreiveFareBasisCodesForTraveller

      protected List<String> retreiveFareBasisCodesForTraveller(List<AbstractOrderEntryModel> bundledEntries, TravellerData traveller)
      Collects all fare basis codes for given traveller
      Parameters:
      bundledEntries - the bundled entries
      traveller - the traveller
      Returns:
      fare basis codes for traveller
    • createPTCFareBreakdowns

      protected List<PTCFareBreakdownData> createPTCFareBreakdowns(List<AbstractOrderEntryModel> bundledEntries, ReservationItemData reservationItem)
      Creates price breakdown for each passenger type.
      Parameters:
      bundledEntries - - entries that are in a bundle for current leg
      reservationItem - - Reservation Item of current leg
      Returns:
      list
    • createPTCFareBreakdown

      protected PTCFareBreakdownData createPTCFareBreakdown(List<AbstractOrderEntryModel> bundledEntries, PassengerTypeQuantityData passengerTypeQuantity)
      Creates a new instance of price breakdown for given passengerType
      Parameters:
      bundledEntries - the bundled entries
      passengerTypeQuantity - the passenger type quantity
      Returns:
      ptc fare breakdown data
    • retreivePerPassengerTypeFare

      protected PassengerFareData retreivePerPassengerTypeFare(List<AbstractOrderEntryModel> bundledEntries, String passengerTypeCode)
      Calculates the fare price per passenger type based on bundled entries
      Parameters:
      bundledEntries - the bundled entries
      passengerTypeCode - the passenger type code
      Returns:
      passenger fare data
    • createFareInfosForPassengerTypes

      protected List<FareInfoData> createFareInfosForPassengerTypes(List<AbstractOrderEntryModel> bundledEntries, String passengerTypeCode)
      Retrieves Fare information from entries based on passengerType
      Parameters:
      bundledEntries - the bundled entries
      passengerTypeCode - the passenger type code
      Returns:
      list
    • createFareInfo

      protected FareInfoData createFareInfo(List<FareDetailsData> fareDetailsDataList)
      Method returns a new instance of FareInfoData with the list of FareDetailsData added
      Parameters:
      fareDetailsDataList - the fare details data list
      Returns:
      FareInfoData fare info data
    • createFareDetails

      protected FareDetailsData createFareDetails(FareProductData fareProductData)
      Method returns a new instance of FareDetailsData with the FareProductData added
      Parameters:
      fareProductData - the fare product data
      Returns:
      FareDetailsData fare details data
    • retreiveFareBasisCodesForPassengerType

      protected List<String> retreiveFareBasisCodesForPassengerType(List<AbstractOrderEntryModel> bundledEntries, String passengerTypeCode)
      Retrieves fare basis codes from entries based on passenger type.
      Parameters:
      bundledEntries - - entries which contain bundled products of given leg
      passengerTypeCode - - current passenger type
      Returns:
      list of fare basis codes for passenger type
    • retrievePassengerTypeQuantitiesFromTravellers

      protected List<PassengerTypeQuantityData> retrievePassengerTypeQuantitiesFromTravellers(List<TravellerData> travellers)
      Creates a list of Passenger Type Quantities which will define how many PTCFareBreakdowns are needed
      Parameters:
      travellers - - travellers of the particular leg
      Returns:
      list of passenger type quantities
    • getPassengerTypeQuantityFromList

      protected PassengerTypeQuantityData getPassengerTypeQuantityFromList(List<PassengerTypeQuantityData> passengerTypeQuantities, String passengerTypeCode)
      Checks whether there is already an entry for given passenger type
      Parameters:
      passengerTypeQuantities - the passenger type quantities
      passengerTypeCode - the passenger type code
      Returns:
      passenger type quantity from list
    • getPassengerTypeCodeFromEntry

      protected String getPassengerTypeCodeFromEntry(AbstractOrderEntryModel entry)
      Retrieves passenger type code from given abstract order entry
      Parameters:
      entry - - abstract order entry containing traveller
      Returns:
      passenger type code for entry
    • getFareProductConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<FareProductModel,FareProductData> getFareProductConverter()
      Gets fare product converter.
      Returns:
      the fareProductConverter
    • setFareProductConverter

      public void setFareProductConverter(de.hybris.platform.servicelayer.dto.converter.Converter<FareProductModel,FareProductData> fareProductConverter)
      Sets fare product converter.
      Parameters:
      fareProductConverter - the fareProductConverter to set
    • getPriceDataFactory

      protected de.hybris.platform.commercefacades.product.PriceDataFactory getPriceDataFactory()
      Gets price data factory.
      Returns:
      the priceDataFactory
    • setPriceDataFactory

      public void setPriceDataFactory(de.hybris.platform.commercefacades.product.PriceDataFactory priceDataFactory)
      Sets price data factory.
      Parameters:
      priceDataFactory - the priceDataFactory to set
    • getCommonI18NService

      protected de.hybris.platform.servicelayer.i18n.CommonI18NService getCommonI18NService()
      Gets common I18N service.
      Returns:
      the commonI18NService
    • setCommonI18NService

      public void setCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService)
      Sets common I18N service.
      Parameters:
      commonI18NService - the commonI18NService to set
    • getEnumerationService

      protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
      Gets enumeration service.
      Returns:
      the enumerationService
    • setEnumerationService

      public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
      Sets enumeration service.
      Parameters:
      enumerationService - the enumerationService to set
    • getTravelCommercePriceFacade

      protected TravelCommercePriceFacade getTravelCommercePriceFacade()
      Returns:
      the travelCommercePriceFacade
    • setTravelCommercePriceFacade

      public void setTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade)
      Parameters:
      travelCommercePriceFacade - the travelCommercePriceFacade to set
    • getBundleTemplateService

      protected de.hybris.platform.configurablebundleservices.bundle.BundleTemplateService getBundleTemplateService()
      Gets bundle template service.
      Returns:
      the bundle template service
    • setBundleTemplateService

      public void setBundleTemplateService(de.hybris.platform.configurablebundleservices.bundle.BundleTemplateService bundleTemplateService)
      Sets bundle template service.
      Parameters:
      bundleTemplateService - the bundle template service