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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected OfferPricingInfoDatacreateNewOfferPricingInfoForTravellerBreakdown(ReservationItemData reservationItem, AbstractOrderEntryModel entry) Creates a new instance of OfferPricingInfo for a new ancillary productprotected TravellerBreakdownDatacreateNewTravellerBreakdown(ReservationItemData reservationItem, AbstractOrderEntryModel entry) Creates a new TravellerBreakdown instanceprotected List<OfferPricingInfoData>createOfferPricingInfos(List<AbstractOrderEntryModel> ancillaryEntries, ReservationItemData reservationItem, List<TransportOfferingData> transportOfferings) Creates a list of offer pricing infos for given reservation item.protected voidcreateOfferPricingInfosForBookingBreakdown(List<OfferPricingInfoData> offerPricingInfos, AbstractOrderEntryModel entry, ReservationItemData reservationItem) Creates a list of offerPricingInfos for the bookingBreakdown for the given entry and reservationItemprotected voidcreateOfferPricingInfosForTravellerBreakdown(List<OfferPricingInfoData> offerPricingInfos, AbstractOrderEntryModel entry, ReservationItemData reservationItem) Creates a list of offerPricingInfos for the travellerBreakdown for the given entry and reservationItemprotected OriginDestinationOfferInfoDatacreateOriginDestinationOfferInfo(List<TransportOfferingModel> transportOfferings) Creates a new instance of Origin Destination Offer Infoprotected List<OriginDestinationOfferInfoData>createOriginDestinationOfferInfos(List<AbstractOrderEntryModel> ancillaryEntries) Identifies different option in which ancillaries are assigned to order - whether it is per leg or per transport offeringprotected List<AbstractOrderEntryModel>filterAncillaryEntriesForTransportOfferings(List<AbstractOrderEntryModel> ancillaryEntries, List<TransportOfferingData> transportOfferings) Filters out the ancillary entries to have only ones with matching transport offering combinationprotected de.hybris.platform.servicelayer.dto.converter.Converter<TransportOfferingModel,TransportOfferingData> Gets transport offering converter.protected TravellerDatagetTravellerFromList(ReservationItemData reservationItem, AbstractOrderEntryModel entry) Finds requested traveller in traveller list of reservation itemvoidhandle(AbstractOrderModel abstractOrderModel, ReservationData reservationData) Handle method.protected booleanisNewOfferInfo(List<OriginDestinationOfferInfoData> originDestinationOfferInfos, List<TransportOfferingModel> transportOfferings) Checks whether there has been already created an originDestinationOfferInfo for given transport offering combination.protected booleanisSameTOCombination(List<TransportOfferingData> transportOfferings, List<TransportOfferingModel> transportOfferingModels) Compares to transportOffering lists to see whether they have same transport offering combinationsvoidsetTransportOfferingConverter(de.hybris.platform.servicelayer.dto.converter.Converter<TransportOfferingModel, TransportOfferingData> transportOfferingConverter) Sets transport offering converter.Methods inherited from class de.hybris.platform.travelfacades.reservation.handlers.impl.AbstractReservationOfferPricingInfoHandler
checkBundleNo, checkBundleNo, createNewBookingBreakdown, createNewOfferPricingInfoForBookingBreakdown, getCommonI18NService, getNotAncillaryProductTypes, getOfferPricingInfoFromList, getPriceDataFactory, getProductConverter, getProductTypeInstanceMap, getTravelCommercePriceFacade, getTravellerBreakdownForTraveller, isAncillaryEntry, isAncillaryEntry, isPerBookingEntry, isPerLegEntry, isPerLegPerPaxEntry, isPerPaxEntry, setCommonI18NService, setNotAncillaryProductTypes, setPriceDataFactory, setProductConverter, setProductTypeInstanceMap, setTravelCommercePriceFacade, updateBookingBreakdown, updateBookingBreakdown, updateTravellerBreakdown, updateTravellerBreakdown
-
Constructor Details
-
ReservationOriginDestinationOfferPricingInfoHandler
public ReservationOriginDestinationOfferPricingInfoHandler()
-
-
Method Details
-
handle
Description copied from interface:ReservationHandlerHandle method.- Specified by:
handlein interfaceReservationHandler- Parameters:
abstractOrderModel- the abstract order modelreservationData- 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 infostransportOfferings- - 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 offeringstransportOfferingModels- 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 legreservationItem- - Reservation Item of current legtransportOfferings- - 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 OrdertransportOfferings- - 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 populatedentry- the abstractOrderEntryreservationItem- 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 populatedentry- the abstractOrderEntryreservationItem- 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 legentry- - 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 legentry- - 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 legentry- - 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
-