Class DefaultNDCTravelCommercePriceFacade

java.lang.Object
de.hybris.platform.travelfacades.facades.impl.DefaultTravelCommercePriceFacade
de.hybris.platform.ndc182facades.facades.impl.DefaultNDCTravelCommercePriceFacade
All Implemented Interfaces:
NDCTravelCommercePriceFacade, TravelCommercePriceFacade

public class DefaultNDCTravelCommercePriceFacade extends DefaultTravelCommercePriceFacade implements NDCTravelCommercePriceFacade
The ndc 18.2 implementation of NDCTravelCommercePriceFacade interface. This class extends the DefaultTravelCommercePriceFacade in order to use all the methods for retrieving the price informations.
  • Constructor Details

    • DefaultNDCTravelCommercePriceFacade

      public DefaultNDCTravelCommercePriceFacade()
  • Method Details

    • populatePricesForMultiSectorBundle

      public void populatePricesForMultiSectorBundle(List<ProductModel> fareProducts, List<BundleTemplateModel> includedAncillaries, String routeCode, Map<String,Double> productCodeBaseFareMap)
      Populates prices for multi sector bundle.
      Specified by:
      populatePricesForMultiSectorBundle in interface NDCTravelCommercePriceFacade
      Parameters:
      fareProducts - the fare products
      includedAncillaries - the included ancillaries
      routeCode - the route code
      productCodeBaseFareMap - the productCodeBaseFareMap
    • populatePricesForPointToPointBundle

      public void populatePricesForPointToPointBundle(List<ProductModel> fareProducts, List<BundleTemplateModel> ancillaryBundles, String routeCode, List<String> transportOfferings, Map<String,Double> productCodeBaseFareMap)
      Populates prices for point to point bundle.
      Specified by:
      populatePricesForPointToPointBundle in interface NDCTravelCommercePriceFacade
      Parameters:
      fareProducts - the fare products
      ancillaryBundles - the ancillary bundles
      routeCode - the route code
      transportOfferings - the transportOfferings
      productCodeBaseFareMap - the productCodeBaseFareMap
    • populateProductPricesForOptions

      protected void populateProductPricesForOptions(List<ProductModel> productList, String transportOfferingCode, String sectorCode, String routeCode, BundleTemplateModel bundleTemplate, Map<String,Double> productCodeBaseFareMap)
      Populates product prices for options.
      Parameters:
      productList - the product list
      transportOfferingCode - the transport offering code
      sectorCode - the sector code
      routeCode - the route code
      bundleTemplate - the bundle template
      productCodeBaseFareMap - the productCodeBaseFareMap
    • populateProductPrices

      protected void populateProductPrices(List<ProductModel> productList, String searchKey, String searchValue, BundleTemplateModel bundleTemplate, Map<String,Double> productCodeBaseFareMap)
      This method populates the price information for all the fare products and ancillary products. The prices are searched for the search key and search value.
      Parameters:
      productList - the product list
      searchKey - the search key
      searchValue - the search value
      bundleTemplate - the bundleTemplate
      productCodeBaseFareMap - the productCodeBaseFareMap
    • calculateTaxSummaries

      public List<TaxData> calculateTaxSummaries(List<ProductModel> fareProducts, List<BundleTemplateModel> includedAncillaries, int ptcQty, Map<String,Double> productCodeBaseFareMap, List<String> transportOfferings)
      Calculates tax summaries.
      Specified by:
      calculateTaxSummaries in interface NDCTravelCommercePriceFacade
      Parameters:
      fareProducts - the fare products
      includedAncillaries - the included ancillaries
      ptcQty - the ptc qty
      productCodeBaseFareMap - the productCodeBaseFareMap
      transportOfferings - the transportOfferings
      Returns:
      the list
    • setTaxSearchCriteria

      public void setTaxSearchCriteria(List<String> transportOfferingCodes, String ptc)
      Sets tax search criteria.
      Specified by:
      setTaxSearchCriteria in interface NDCTravelCommercePriceFacade
      Parameters:
      transportOfferingCodes - the transport offering codes
      ptc - the ptc
    • getTaxesForProduct

      protected List<TaxData> getTaxesForProduct(List<ProductModel> fareProducts, Map<String,Double> productCodeBaseFareMap)
      Method to retrieve taxes for the product based on transportFacility, country and passenger type.
      Parameters:
      fareProducts - the fare products
      productCodeBaseFareMap - the productCodeBaseFareMap
      Returns:
      taxes for product
    • createPriceValue

      protected List<TaxData> createPriceValue(Double 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.
    • calculateTaxForExtras

      protected List<TaxData> calculateTaxForExtras(BundleTemplateModel ancillaryBundleTemplateModel, Map<String,Double> productCodeBaseFareMap, List<String> transportOfferings)
      Method to calculate tax for every product included in bundle.
      Parameters:
      ancillaryBundleTemplateModel - the ancillary bundle template model
      productCodeBaseFareMap - the product code base fare map
      transportOfferings - the transportOfferings
      Returns:
      the list of taxes
    • calculateTaxForProduct

      protected List<TaxData> calculateTaxForProduct(ProductModel productModel, Map<String,String> transportOfferingCountryCodeMap, List<String> transportOfferings, Map<String,Double> productCodeBaseFareMap)
      Method to calculate tax for every product on the basis of whether given product is per transportOfferingCode or per route.
      Parameters:
      productModel - the product model
      transportOfferingCountryCodeMap - the transport offering country code map
      transportOfferings - the transportOfferings
      productCodeBaseFareMap - the productCodeBaseFareMap
    • checkIfProductPerTO

      protected boolean checkIfProductPerTO(ProductModel productModel)
      Returns true if given ProductData is per transport offering otherwise false.
      Parameters:
      productModel - the product model
      Returns:
      the boolean
    • calculateTax

      protected List<TaxData> calculateTax(String transportOfferingCode, Map<String,String> transportOfferingCountryCodeMap, ProductModel productModel, Map<String,Double> productCodeBaseFareMap)
      Method to calculate tax for given ProductModel, TransportOfferingModel and passengerType
      Parameters:
      transportOfferingCode - the transport offering code
      transportOfferingCountryCodeMap - the transport offering country code map
      productModel - the product model
      productCodeBaseFareMap - the product code base fare map
      Returns:
      the list
    • getTransportFacilityFacade

      protected TransportFacilityFacade getTransportFacilityFacade()
      Gets transport facility facade.
      Returns:
      the transport facility facade
    • setTransportFacilityFacade

      public void setTransportFacilityFacade(TransportFacilityFacade transportFacilityFacade)
    • 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
    • getCommerceProductService

      protected de.hybris.platform.commerceservices.product.CommerceProductService getCommerceProductService()
      Gets commerce product service.
      Returns:
      the commerce product service
    • setCommerceProductService

      public void setCommerceProductService(de.hybris.platform.commerceservices.product.CommerceProductService commerceProductService)
      Sets commerce product service.
      Parameters:
      commerceProductService - the commerce product service
    • getSessionService

      protected de.hybris.platform.servicelayer.session.SessionService getSessionService()
      Gets session service.
      Returns:
      the session service
    • setSessionService

      public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService)
      Sets session service.
      Parameters:
      sessionService - the session service
    • getNdcPassengerTypeService

      protected NDCPassengerTypeService getNdcPassengerTypeService()
      Gets ndc passenger type service.
      Returns:
      the ndc passenger type service
    • setNdcPassengerTypeService

      public void setNdcPassengerTypeService(NDCPassengerTypeService ndcPassengerTypeService)
      Sets ndc passenger type service.
      Parameters:
      ndcPassengerTypeService - the ndc passenger type service