Class AncillaryResponseDataAncillariesPopulator

java.lang.Object
de.hybris.platform.shoppingfacades.converters.populator.AncillaryResponseDataAncillariesPopulator
All Implemented Interfaces:
de.hybris.platform.converters.Populator<OfferResponseData,AncillaryResponseData>

public class AncillaryResponseDataAncillariesPopulator extends Object implements de.hybris.platform.converters.Populator<OfferResponseData,AncillaryResponseData>
The Shopping populator to populate the ancillaries from OfferResponseData to AncillaryResponseData.
  • Constructor Details

    • AncillaryResponseDataAncillariesPopulator

      public AncillaryResponseDataAncillariesPopulator()
  • Method Details

    • populate

      public void populate(OfferResponseData offerResponseData, AncillaryResponseData ancillaryResponseData) throws de.hybris.platform.servicelayer.dto.converter.ConversionException
      Specified by:
      populate in interface de.hybris.platform.converters.Populator<OfferResponseData,AncillaryResponseData>
      Throws:
      de.hybris.platform.servicelayer.dto.converter.ConversionException
    • getAncillaryData

      protected AncillaryData getAncillaryData(OfferPricingInfoData offerPricingInfoData, List<TravellerData> travellerDataList, List<TransportOfferingData> transportOfferings, List<OfferGroupData> categories)
      Gets ancillary data.
      Parameters:
      offerPricingInfoData - the offer pricing info data
      travellerDataList - the traveller data list
      transportOfferings - the transport offerings
      categories -
      Returns:
      the ancillary data
    • createDefaultAddToCartInfo

      protected AddToCartInfoData createDefaultAddToCartInfo()
      Creates the default add to cart info data.
      Returns:
      the add to cart info
    • getPassengerIds

      protected List<String> getPassengerIds(List<TravellerData> allowedTravellers)
      Return traveller uids if present otherwise shopping traveller ids.
      Parameters:
      allowedTravellers - the allowed travellers
      Returns:
      the passenger ids
    • createCategories

      protected List<OfferGroupData> createCategories(OfferGroupData offerGroupData)
      Creates the categories list.
      Parameters:
      offerGroupData - the offer group data
      Returns:
      the list
    • isRestrictedTraveller

      protected boolean isRestrictedTraveller(TravellerData travellerData, TravelRestrictionData travelRestrictionData)
      checks if the traveller can add a commerce ancillary product to the cart.
      Parameters:
      travellerData - the traveller data
      travelRestrictionData - the travel restriction data
      Returns:
      true if the traveller is allowed to purchase the ancillary.
    • createAddToCartInfo

      protected AddToCartInfoData createAddToCartInfo(ProductModel productModel, TravelRestrictionData travelRestrictionData)
      Return the Add to Cart info object for the given travelRestrictionData and product code
      Parameters:
      productModel - the product model
      travelRestrictionData - the travel restriction data
      Returns:
      add to cart info
    • getCategoryCode

      protected String getCategoryCode(ProductModel productModel)
      Get category code for product
      Parameters:
      productModel - the product model
      Returns:
      the category code
    • createCommerceAncillaryPricingInfo

      protected List<AncillaryPricingInfoData> createCommerceAncillaryPricingInfo(List<TravellerData> travellers, List<TransportOfferingData> transportOfferings, ProductModel commerceAncillaryProduct)
      Creates the list of commerce ancillary pricing infos.
      Parameters:
      travellers - the travellers
      transportOfferings - the transport offerings
      commerceAncillaryProduct - the commerce ancillary product
      Returns:
      the list
    • getTransportOfferingsForProduct

      protected List<TransportOfferingData> getTransportOfferingsForProduct(ProductModel commerceAncillaryProduct, List<TransportOfferingData> transportOfferings)
      Gets transport offerings for product.
      Parameters:
      commerceAncillaryProduct - the commerce ancillary product
      transportOfferings - the transport offerings
      Returns:
      the transport offerings for product
    • getCommercePricingInformation

      protected de.hybris.platform.jalo.order.price.PriceInformation getCommercePricingInformation(TransportOfferingData transportOfferingData, ProductModel commerceAncillaryProduct)
      Gets offer pricing information.
      Parameters:
      transportOfferingData - the transport offering code
      commerceAncillaryProduct - the commerce ancillary product
      Returns:
      offer pricing information
    • getPriceInformationFromTransportOfferingOrSector

      protected de.hybris.platform.jalo.order.price.PriceInformation getPriceInformationFromTransportOfferingOrSector(TransportOfferingData transportOfferingData, ProductModel commerceAncillaryProduct)
      If the Product category (offerGroupCode) is configured at TransportOfferingLevel, check if there is a priceRow at TransportOffering and offer. if not, check if there is a priceRow for travelSector and offer.
      Parameters:
      transportOfferingData - the transport offering code
      commerceAncillaryProduct - the commerce ancillary product
      Returns:
      price information from transport offering or sector
    • createPriceData

      protected PriceData createPriceData(de.hybris.platform.jalo.order.price.PriceInformation priceInfo)
      Method takes a PriceInformation object and performs a null check. If the object a is null then null will be returned otherwise a new PriceData object is created and returned using the PriceValue on the PriceInformation object
      Parameters:
      priceInfo - the price info
      Returns:
      PriceData price data
    • 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.
    • getProductService

      protected de.hybris.platform.product.ProductService getProductService()
      Gets product service.
      Returns:
      the product service
    • setProductService

      public void setProductService(de.hybris.platform.product.ProductService productService)
      Sets product service.
      Parameters:
      productService - the product service
    • getTravelRestrictionFacade

      protected TravelRestrictionFacade getTravelRestrictionFacade()
      Gets travel restriction facade.
      Returns:
      the travel restriction facade
    • setTravelRestrictionFacade

      public void setTravelRestrictionFacade(TravelRestrictionFacade travelRestrictionFacade)
      Sets travel restriction facade.
      Parameters:
      travelRestrictionFacade - the travel restriction facade
    • getTravelCommercePriceService

      protected TravelCommercePriceService getTravelCommercePriceService()
      Gets travel commerce price service.
      Returns:
      the travel commerce price service
    • setTravelCommercePriceService

      public void setTravelCommercePriceService(TravelCommercePriceService travelCommercePriceService)
      Sets travel commerce price service.
      Parameters:
      travelCommercePriceService - the travel commerce price service
    • getCommonI18NService

      protected de.hybris.platform.servicelayer.i18n.CommonI18NService getCommonI18NService()
      Gets common i 18 n service.
      Returns:
      the common i 18 n service
    • setCommonI18NService

      public void setCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService)
      Sets common i 18 n service.
      Parameters:
      commonI18NService - the common i 18 n service
    • getTravelCommercePriceFacade

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

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