Class ReservationOriginDestinationOfferPricingInfoHandler

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

public class ReservationOriginDestinationOfferPricingInfoHandler extends AbstractReservationOfferPricingInfoHandler implements ReservationHandler
This handler is responsible for instantiating a list of Offer Pricing Infos for given leg which will contain summary of ancillaries selected by user. It populates the OfferPricingInfo of the OriginDestinationOfferInfoData.
  • Constructor Details

    • ReservationOriginDestinationOfferPricingInfoHandler

      public ReservationOriginDestinationOfferPricingInfoHandler()
  • 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
    • createOriginDestinationOfferInfos

      protected List<OriginDestinationOfferInfoData> createOriginDestinationOfferInfos(List<AbstractOrderEntryModel> ancillaryEntries)
      Identifies different option in which ancillaries are assigned to order - whether it is per leg or per transport offering
      Parameters:
      ancillaryEntries - - set of ancillaries in Abstract Order for current leg
      Returns:
      list of options in which ancillaries are selected for current Abstract Order
    • isNewOfferInfo

      protected boolean isNewOfferInfo(List<OriginDestinationOfferInfoData> originDestinationOfferInfos, List<TransportOfferingModel> transportOfferings)
      Checks whether there has been already created an originDestinationOfferInfo for given transport offering combination. The assumption is taken that if there is only 1 Transport Offering for entry ancillary is applied on sector/offering level, if there are more, it is applied on leg level
      Parameters:
      originDestinationOfferInfos - - current list of offer infos
      transportOfferings - - combination of transport offerings
      Returns:
      true in case it is a new combination
    • isSameTOCombination

      protected boolean isSameTOCombination(List<TransportOfferingData> transportOfferings, List<TransportOfferingModel> transportOfferingModels)
      Compares to transportOffering lists to see whether they have same transport offering combinations
      Parameters:
      transportOfferings - the transport offerings
      transportOfferingModels - the transport offering models
      Returns:
      true if the lists have the same combination
    • createOriginDestinationOfferInfo

      protected OriginDestinationOfferInfoData createOriginDestinationOfferInfo(List<TransportOfferingModel> transportOfferings)
      Creates a new instance of Origin Destination Offer Info
      Parameters:
      transportOfferings - - offerings attached to given entry
      Returns:
      the origin destination offer info data
    • createOfferPricingInfos

      protected List<OfferPricingInfoData> createOfferPricingInfos(List<AbstractOrderEntryModel> ancillaryEntries, ReservationItemData reservationItem, List<TransportOfferingData> transportOfferings)
      Creates a list of offer pricing infos for given reservation item.
      Parameters:
      ancillaryEntries - - ancillary entries for given Abstract Order and leg
      reservationItem - - Reservation Item of current leg
      transportOfferings - - combination of transportOfferings for given origin destination offer info
      Returns:
      list of offer pricing info for leg
    • filterAncillaryEntriesForTransportOfferings

      protected List<AbstractOrderEntryModel> filterAncillaryEntriesForTransportOfferings(List<AbstractOrderEntryModel> ancillaryEntries, List<TransportOfferingData> transportOfferings)
      Filters out the ancillary entries to have only ones with matching transport offering combination
      Parameters:
      ancillaryEntries - - given ancillary entries for current leg of Abstract Order
      transportOfferings - - combination of transport offerings to be matched
      Returns:
      list
    • createOfferPricingInfosForTravellerBreakdown

      protected void createOfferPricingInfosForTravellerBreakdown(List<OfferPricingInfoData> offerPricingInfos, AbstractOrderEntryModel entry, ReservationItemData reservationItem)
      Creates a list of offerPricingInfos for the travellerBreakdown for the given entry and reservationItem
      Parameters:
      offerPricingInfos - the list of offerPricingInfo to be populated
      entry - the abstractOrderEntry
      reservationItem - the reservationItem
    • createOfferPricingInfosForBookingBreakdown

      protected void createOfferPricingInfosForBookingBreakdown(List<OfferPricingInfoData> offerPricingInfos, AbstractOrderEntryModel entry, ReservationItemData reservationItem)
      Creates a list of offerPricingInfos for the bookingBreakdown for the given entry and reservationItem
      Parameters:
      offerPricingInfos - the list of offerPricingInfo to be populated
      entry - the abstractOrderEntry
      reservationItem - the reservationItem
    • createNewOfferPricingInfoForTravellerBreakdown

      protected OfferPricingInfoData createNewOfferPricingInfoForTravellerBreakdown(ReservationItemData reservationItem, AbstractOrderEntryModel entry)
      Creates a new instance of OfferPricingInfo for a new ancillary product
      Parameters:
      reservationItem - - current reservation item for the leg
      entry - - new ancillary entry which needs to be translated into offer pricing info
      Returns:
      new offer pricing info containing information about current entry product
    • createNewTravellerBreakdown

      protected TravellerBreakdownData createNewTravellerBreakdown(ReservationItemData reservationItem, AbstractOrderEntryModel entry)
      Creates a new TravellerBreakdown instance
      Parameters:
      reservationItem - - current reservation item for the leg
      entry - - entry which needs to be included in traveller breakdown
      Returns:
      new traveller breakdown for traveller in the entry
    • getTravellerFromList

      protected TravellerData getTravellerFromList(ReservationItemData reservationItem, AbstractOrderEntryModel entry)
      Finds requested traveller in traveller list of reservation item
      Parameters:
      reservationItem - - current reservation item of leg
      entry - - entry containing requested traveller
      Returns:
      traveller data matching traveller from the entry
    • getTransportOfferingConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<TransportOfferingModel,TransportOfferingData> getTransportOfferingConverter()
      Gets transport offering converter.
      Returns:
      the transportOfferingConverter
    • setTransportOfferingConverter

      public void setTransportOfferingConverter(de.hybris.platform.servicelayer.dto.converter.Converter<TransportOfferingModel,TransportOfferingData> transportOfferingConverter)
      Sets transport offering converter.
      Parameters:
      transportOfferingConverter - the transportOfferingConverter to set