java.lang.Object
de.hybris.platform.travelfacades.fare.search.handlers.impl.TaxHandler
All Implemented Interfaces:
FareSearchHandler
Direct Known Subclasses:
DealPTCWasRateHandler

public class TaxHandler extends Object implements FareSearchHandler
Concrete implementation of the FareSearchHandler interface. Handler is responsible for populating the taxed for all the scheduled routes on the FareSelectionData
  • Constructor Details

    • TaxHandler

      public TaxHandler()
  • Method Details

    • handle

      public void handle(List<ScheduledRouteData> scheduledRoutes, FareSearchRequestData fareSearchRequestData, FareSelectionData fareSelectionData)
      Description copied from interface: FareSearchHandler
      Handle method.
      Specified by:
      handle in interface FareSearchHandler
      Parameters:
      scheduledRoutes - the scheduled routes
      fareSearchRequestData - the fare search request data
      fareSelectionData - 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 codes
      countryCodes - the country codes
      itineraryPricingInfoData - 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 codes
      countryCodes - the country codes
      itineraryPricingInfoData - the itinerary pricing info data
      pricedItinerary - 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 given ProductData, TransportOfferingData and passengerType
      Parameters:
      transportOffering -
      transportOfferingCountryCodeMap -
      productData -
      passengerType -
    • checkIfProductPerTO

      protected boolean checkIfProductPerTO(ProductData productData)
      Returns true if given ProductData is per transport offering otherwise false.
      Parameters:
      productData -
    • updateGrossPrice

      protected void updateGrossPrice(PTCFareBreakdownData ptcData, List<TaxData> taxes)
      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 data
      taxes - the taxes
    • populateTransportFacilityInfoFromItinerary

      protected void populateTransportFacilityInfoFromItinerary(PricedItineraryData pricedItinerary, List<String> transportFacilityCodes, List<String> countryCodes)
      Populate transport facility info from itinerary.
      Parameters:
      pricedItinerary - the priced itinerary
      transportFacilityCodes - the transport facility codes
      countryCodes - 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 data
      transportFacilityCodes - the transport facility codes
      countryCodes - the country codes
      passengerType - 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 data
      taxInfos - the tax infos
      Returns:
      list of TaxData objects.
    • createPriceData

      @Deprecated protected PriceData createPriceData(double priceValue, String currencyIsoCode)
      Deprecated.
      Deprecated since version 3.0.
      Method to create a new PriceData Object using PriceDataFactory
      Parameters:
      priceValue - the price value
      currencyIsoCode - 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 codes
      countryCodes - the country codes
      passengerType - the passenger type
    • getTransportFacilityFacade

      protected TransportFacilityFacade getTransportFacilityFacade()
      Gets transport facility facade.
      Returns:
      instance of transportFacilityFacade
    • setTransportFacilityFacade

      public void setTransportFacilityFacade(TransportFacilityFacade transportFacilityFacade)
      Sets transport facility facade.
      Parameters:
      transportFacilityFacade - the transport facility facade
    • getTravelCommercePriceService

      protected TravelCommercePriceService getTravelCommercePriceService()
      Gets travel commerce price service.
      Returns:
      instance of travelCommercePriceService
    • setTravelCommercePriceService

      public void setTravelCommercePriceService(TravelCommercePriceService travelCommercePriceService)
      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

      protected TravelCommercePriceFacade getTravelCommercePriceFacade()
      Gets travel commerce price facade.
      Returns:
      the travelCommercePriceFacade
    • setTravelCommercePriceFacade

      public void setTravelCommercePriceFacade(TravelCommercePriceFacade travelCommercePriceFacade)
      Sets travel commerce price facade.
      Parameters:
      travelCommercePriceFacade - the travelCommercePriceFacade to set
    • getOfferGroupToOriginDestinationMapping

      protected Map<String,String> 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