Class ReservationItineraryPricingInfoHandler
java.lang.Object
de.hybris.platform.travelfacades.reservation.handlers.impl.ReservationItineraryPricingInfoHandler
- All Implemented Interfaces:
ReservationHandler
This handler is responsible for instantiating Itinerary Pricing Info for given leg which will contain summary of fare products
selected by user
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PassengerFareDatacalculateTravellerFare(List<AbstractOrderEntryModel> bundledEntries, TravellerData traveller) Sums up all bundle products prices for given travellerprotected FareDetailsDatacreateFareDetails(FareProductData fareProductData) Method returns a new instance of FareDetailsData with the FareProductData addedprotected FareInfoDatacreateFareInfo(List<FareDetailsData> fareDetailsDataList) Method returns a new instance of FareInfoData with the list of FareDetailsData addedprotected List<FareInfoData>createFareInfosForPassengerTypes(List<AbstractOrderEntryModel> bundledEntries, String passengerTypeCode) Retrieves Fare information from entries based on passengerTypeprotected ItineraryPricingInfoDatacreateItineraryPricingInfo(AbstractOrderModel abstractOrderModel, ReservationItemData reservationItem) Creates a new Itinerary Pricing Info to hold fare products summary for each leg of the journeyprotected PTCFareBreakdownDatacreatePTCFareBreakdown(List<AbstractOrderEntryModel> bundledEntries, PassengerTypeQuantityData passengerTypeQuantity) Creates a new instance of price breakdown for given passengerTypeprotected List<PTCFareBreakdownData>createPTCFareBreakdowns(List<AbstractOrderEntryModel> bundledEntries, ReservationItemData reservationItem) Creates price breakdown for each passenger type.protected TravellerBreakdownDatacreateTravellerBreakdown(List<AbstractOrderEntryModel> bundledEntries, TravellerData traveller) Create a new travellerBreakdownData for the given traveller.protected List<TravellerBreakdownData>createTravellerBreakdowns(List<AbstractOrderEntryModel> bundledEntries, ReservationItemData reservationItem) Creates price breakdown for each traveller.protected de.hybris.platform.configurablebundleservices.bundle.BundleTemplateServiceGets bundle template service.protected de.hybris.platform.servicelayer.i18n.CommonI18NServiceGets common I18N service.protected de.hybris.platform.enumeration.EnumerationServiceGets enumeration service.protected de.hybris.platform.servicelayer.dto.converter.Converter<FareProductModel,FareProductData> Gets fare product converter.protected StringRetrieves passenger type code from given abstract order entryprotected PassengerTypeQuantityDatagetPassengerTypeQuantityFromList(List<PassengerTypeQuantityData> passengerTypeQuantities, String passengerTypeCode) Checks whether there is already an entry for given passenger typeprotected de.hybris.platform.commercefacades.product.PriceDataFactoryGets price data factory.protected TravelCommercePriceFacadevoidhandle(AbstractOrderModel abstractOrderModel, ReservationData reservationData) Handle method.retreiveFareBasisCodesForPassengerType(List<AbstractOrderEntryModel> bundledEntries, String passengerTypeCode) Retrieves fare basis codes from entries based on passenger type.retreiveFareBasisCodesForTraveller(List<AbstractOrderEntryModel> bundledEntries, TravellerData traveller) Collects all fare basis codes for given travellerprotected PassengerFareDataretreivePerPassengerTypeFare(List<AbstractOrderEntryModel> bundledEntries, String passengerTypeCode) Calculates the fare price per passenger type based on bundled entriesprotected List<PassengerTypeQuantityData>Creates a list of Passenger Type Quantities which will define how many PTCFareBreakdowns are neededvoidsetBundleTemplateService(de.hybris.platform.configurablebundleservices.bundle.BundleTemplateService bundleTemplateService) Sets bundle template service.voidsetCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) Sets common I18N service.voidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) Sets enumeration service.voidsetFareProductConverter(de.hybris.platform.servicelayer.dto.converter.Converter<FareProductModel, FareProductData> fareProductConverter) Sets fare product converter.voidsetPriceDataFactory(de.hybris.platform.commercefacades.product.PriceDataFactory priceDataFactory) Sets price data factory.voidsetTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade)
-
Constructor Details
-
ReservationItineraryPricingInfoHandler
public ReservationItineraryPricingInfoHandler()
-
-
Method Details
-
handle
Description copied from interface:ReservationHandlerHandle method.- Specified by:
handlein interfaceReservationHandler- Parameters:
abstractOrderModel- the abstract order modelreservationData- 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 OrderreservationItem- - 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 legreservationItem- - 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 entriestraveller- 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 entriestraveller- 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 entriestraveller- 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 legreservationItem- - 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 entriespassengerTypeQuantity- 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 entriespassengerTypeCode- 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 entriespassengerTypeCode- the passenger type code- Returns:
- list
-
createFareInfo
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
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 legpassengerTypeCode- - 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 quantitiespassengerTypeCode- the passenger type code- Returns:
- passenger type quantity from list
-
getPassengerTypeCodeFromEntry
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
- Returns:
- the travelCommercePriceFacade
-
setTravelCommercePriceFacade
- 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
-