Class TaxHandler
java.lang.Object
de.hybris.platform.travelfacades.fare.search.handlers.impl.TaxHandler
- All Implemented Interfaces:
FareSearchHandler
- Direct Known Subclasses:
DealPTCWasRateHandler
Concrete implementation of the
FareSearchHandler interface. Handler is responsible for populating the taxed
for all the scheduled routes on the FareSelectionData-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateTax(TransportOfferingData transportOffering, Map<String, String> transportOfferingCountryCodeMap, ProductData productData, String passengerType) Method to calculate tax for givenProductData,TransportOfferingDataand passengerTypeprotected voidcalculateTaxForExtras(ItineraryPricingInfoData itineraryPricingInfoData, List<TaxData> taxes, String passengerType, PricedItineraryData pricedItinerary) Method to calculate tax for every product included in bundle.protected voidcalculateTaxForProduct(ProductData productData, TravelBundleTemplateData bundleTemplateData, List<TaxData> taxes, Map<String, String> transportOfferingCountryCodeMap, String passengerType, PricedItineraryData pricedItinerary) Method to calculate tax for every product on the basis of whether given product is per transportOfferingCode or per route.protected booleancheckIfProductPerTO(ProductData productData) Returns true if givenProductDatais per transport offering otherwise false.protected PriceDatacreatePriceData(double priceValue, String currencyIsoCode) Deprecated.Deprecated since version 3.0.createTaxData(PriceData priceData, List<de.hybris.platform.jalo.order.price.TaxInformation> taxInfos) Method to convert the Tax Information to Tax Data objects.protected voidevaluateTaxesForPTCs(List<String> transportFacilityCodes, List<String> countryCodes, ItineraryPricingInfoData itineraryPricingInfoData) Deprecated.since Travel Accelerator 3.0 - please use evaluateTaxesForPTCs(transportFacilityCodes, countryCodes, itineraryPricingInfos, pricedItinerary)protected voidevaluateTaxesForPTCs(List<String> transportFacilityCodes, List<String> countryCodes, ItineraryPricingInfoData itineraryPricingInfoData, PricedItineraryData pricedItinerary) Evaluate taxes for pt cs.protected de.hybris.platform.store.services.BaseStoreServiceGets base store service.protected de.hybris.platform.servicelayer.config.ConfigurationServiceGets configuration service.Gets offer group to origin destination mapping.protected de.hybris.platform.commercefacades.product.PriceDataFactoryDeprecated.Deprecated since version 3.0.protected de.hybris.platform.product.ProductServiceGets product service.protected de.hybris.platform.servicelayer.session.SessionServiceGets session service.getTaxesForProduct(ProductData productData, List<String> transportFacilityCodes, List<String> countryCodes, String passengerType) Method to retrieve taxes for the product based on transportFacility, country and passenger type.protected TransportFacilityFacadeGets transport facility facade.protected TravelCommercePriceFacadeGets travel commerce price facade.protected TravelCommercePriceServiceGets travel commerce price service.voidhandle(List<ScheduledRouteData> scheduledRoutes, FareSearchRequestData fareSearchRequestData, FareSelectionData fareSelectionData) Handle method.protected voidpopulateTransportFacilityInfoFromItinerary(PricedItineraryData pricedItinerary, List<String> transportFacilityCodes, List<String> countryCodes) Populate transport facility info from itinerary.voidsetBaseStoreService(de.hybris.platform.store.services.BaseStoreService baseStoreService) Sets base store service.voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.voidsetOfferGroupToOriginDestinationMapping(Map<String, String> offerGroupToOriginDestinationMapping) Sets offer group to origin destination mapping.voidsetPriceDataFactory(de.hybris.platform.commercefacades.product.PriceDataFactory priceDataFactory) Deprecated.Deprecated since version 3.0.voidsetProductService(de.hybris.platform.product.ProductService productService) Sets product service.voidsetSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets session service.protected voidsetTaxSearchCriteriaInContext(List<String> transportFacilityCodes, List<String> countryCodes, String passengerType) Method to set values in Session Context.voidsetTransportFacilityFacade(TransportFacilityFacade transportFacilityFacade) Sets transport facility facade.voidsetTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade) Sets travel commerce price facade.voidsetTravelCommercePriceService(TravelCommercePriceService travelCommercePriceService) Sets travel commerce price service.protected voidupdateGrossPrice(PTCFareBreakdownData ptcData, List<TaxData> taxes) Method to update base price.
-
Constructor Details
-
TaxHandler
public TaxHandler()
-
-
Method Details
-
handle
public void handle(List<ScheduledRouteData> scheduledRoutes, FareSearchRequestData fareSearchRequestData, FareSelectionData fareSelectionData) Description copied from interface:FareSearchHandlerHandle method.- Specified by:
handlein interfaceFareSearchHandler- Parameters:
scheduledRoutes- the scheduled routesfareSearchRequestData- the fare search request datafareSelectionData- the fare selection data
-
evaluateTaxesForPTCs
@Deprecated protected void evaluateTaxesForPTCs(List<String> transportFacilityCodes, List<String> countryCodes, ItineraryPricingInfoData itineraryPricingInfoData) Deprecated.since Travel Accelerator 3.0 - please use evaluateTaxesForPTCs(transportFacilityCodes, countryCodes, itineraryPricingInfos, pricedItinerary)Evaluate taxes for pt cs.- Parameters:
transportFacilityCodes- the transport facility codescountryCodes- the country codesitineraryPricingInfoData- the itinerary pricing info data
-
evaluateTaxesForPTCs
protected void evaluateTaxesForPTCs(List<String> transportFacilityCodes, List<String> countryCodes, ItineraryPricingInfoData itineraryPricingInfoData, PricedItineraryData pricedItinerary) Evaluate taxes for pt cs.- Parameters:
transportFacilityCodes- the transport facility codescountryCodes- the country codesitineraryPricingInfoData- the itinerary pricing info datapricedItinerary- priced itinerary
-
calculateTaxForExtras
protected void calculateTaxForExtras(ItineraryPricingInfoData itineraryPricingInfoData, List<TaxData> taxes, String passengerType, PricedItineraryData pricedItinerary) Method to calculate tax for every product included in bundle.- Parameters:
itineraryPricingInfoData-taxes-passengerType-
-
calculateTaxForProduct
protected void calculateTaxForProduct(ProductData productData, TravelBundleTemplateData bundleTemplateData, List<TaxData> taxes, Map<String, String> transportOfferingCountryCodeMap, String passengerType, PricedItineraryData pricedItinerary) Method to calculate tax for every product on the basis of whether given product is per transportOfferingCode or per route.- Parameters:
productData-bundleTemplateData-taxes-transportOfferingCountryCodeMap-passengerType-
-
calculateTax
protected List<TaxData> calculateTax(TransportOfferingData transportOffering, Map<String, String> transportOfferingCountryCodeMap, ProductData productData, String passengerType) Method to calculate tax for givenProductData,TransportOfferingDataand passengerType- Parameters:
transportOffering-transportOfferingCountryCodeMap-productData-passengerType-
-
checkIfProductPerTO
Returns true if givenProductDatais per transport offering otherwise false.- Parameters:
productData-
-
updateGrossPrice
Method to update base price. If the prices are to be calculated in gross, taxes will be added to base price.- Parameters:
ptcData- the ptc datataxes- the taxes
-
populateTransportFacilityInfoFromItinerary
protected void populateTransportFacilityInfoFromItinerary(PricedItineraryData pricedItinerary, List<String> transportFacilityCodes, List<String> countryCodes) Populate transport facility info from itinerary.- Parameters:
pricedItinerary- the priced itinerarytransportFacilityCodes- the transport facility codescountryCodes- the country codes
-
getTaxesForProduct
protected List<TaxData> getTaxesForProduct(ProductData productData, List<String> transportFacilityCodes, List<String> countryCodes, String passengerType) Method to retrieve taxes for the product based on transportFacility, country and passenger type.- Parameters:
productData- the product datatransportFacilityCodes- the transport facility codescountryCodes- the country codespassengerType- the passenger type- Returns:
- taxes for product
-
createTaxData
protected List<TaxData> createTaxData(PriceData priceData, List<de.hybris.platform.jalo.order.price.TaxInformation> taxInfos) Method to convert the Tax Information to Tax Data objects. Tax amount is calculated based on the absolute/relative value.- Parameters:
priceData- the price datataxInfos- the tax infos- Returns:
- list of TaxData objects.
-
createPriceData
Deprecated.Deprecated since version 3.0.Method to create a new PriceData Object using PriceDataFactory- Parameters:
priceValue- the price valuecurrencyIsoCode- the currency iso code- Returns:
- PriceData price data
-
setTaxSearchCriteriaInContext
protected void setTaxSearchCriteriaInContext(List<String> transportFacilityCodes, List<String> countryCodes, String passengerType) Method to set values in Session Context. These values will be used to retrieve taxes during cart calculation when the product is added to cart.- Parameters:
transportFacilityCodes- the transport facility codescountryCodes- the country codespassengerType- the passenger type
-
getTransportFacilityFacade
Gets transport facility facade.- Returns:
- instance of transportFacilityFacade
-
setTransportFacilityFacade
Sets transport facility facade.- Parameters:
transportFacilityFacade- the transport facility facade
-
getTravelCommercePriceService
Gets travel commerce price service.- Returns:
- instance of travelCommercePriceService
-
setTravelCommercePriceService
Sets travel commerce price service.- Parameters:
travelCommercePriceService- the travel commerce price service
-
getProductService
protected de.hybris.platform.product.ProductService getProductService()Gets product service.- Returns:
- instance of productService
-
setProductService
public void setProductService(de.hybris.platform.product.ProductService productService) Sets product service.- Parameters:
productService- the product service
-
getPriceDataFactory
@Deprecated protected de.hybris.platform.commercefacades.product.PriceDataFactory getPriceDataFactory()Deprecated.Deprecated since version 3.0.Gets price data factory.- Returns:
- instance of priceDataFactory
-
setPriceDataFactory
@Deprecated public void setPriceDataFactory(de.hybris.platform.commercefacades.product.PriceDataFactory priceDataFactory) Deprecated.Deprecated since version 3.0.Sets price data factory.- Parameters:
priceDataFactory- the price data factory
-
getSessionService
protected de.hybris.platform.servicelayer.session.SessionService getSessionService()Gets session service.- Returns:
- the sessionService
-
setSessionService
public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets session service.- Parameters:
sessionService- the sessionService to set
-
getBaseStoreService
protected de.hybris.platform.store.services.BaseStoreService getBaseStoreService()Gets base store service.- Returns:
- the baseStoreService
-
setBaseStoreService
public void setBaseStoreService(de.hybris.platform.store.services.BaseStoreService baseStoreService) Sets base store service.- Parameters:
baseStoreService- the baseStoreService to set
-
getConfigurationService
protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()Gets configuration service.- Returns:
- the configuration service
-
setConfigurationService
public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.- Parameters:
configurationService- the configuration service
-
getTravelCommercePriceFacade
Gets travel commerce price facade.- Returns:
- the travelCommercePriceFacade
-
setTravelCommercePriceFacade
Sets travel commerce price facade.- Parameters:
travelCommercePriceFacade- the travelCommercePriceFacade to set
-
getOfferGroupToOriginDestinationMapping
Gets offer group to origin destination mapping.- Returns:
- the offer group to origin destination mapping
-
setOfferGroupToOriginDestinationMapping
public void setOfferGroupToOriginDestinationMapping(Map<String, String> offerGroupToOriginDestinationMapping) Sets offer group to origin destination mapping.- Parameters:
offerGroupToOriginDestinationMapping- the offer group to origin destination mapping
-