java.lang.Object
de.hybris.platform.travelfacades.ancillary.search.handlers.impl.OfferPricingInfoHandler
All Implemented Interfaces:
AncillarySearchHandler
Direct Known Subclasses:
ShoppingCommerceOfferPricingInfoHandler

public class OfferPricingInfoHandler extends Object implements AncillarySearchHandler
Handler class to populate OfferPricingInfoData for each category of products available to offer as ancillaries.
  • Constructor Details

    • OfferPricingInfoHandler

      public OfferPricingInfoHandler()
  • Method Details

    • handle

      public void handle(OfferRequestData offerRequestData, OfferResponseData offerResponseData)
      Creates and populates OfferPricingInfoData for products of each category. Retrieve list of products for each categoryCode (in this case its offerGroupData.getCode()) Collect common products across all transportOfferings, whose product code matches with the products from above list and stock level is more than zero. For each of those collected products create OfferPricingInfoData and set the productData.
      Specified by:
      handle in interface AncillarySearchHandler
      Parameters:
      offerRequestData - the offer request data
      offerResponseData - the offer response data
    • showProducts

      protected void showProducts(OfferRequestData offerRequestData, OfferResponseData offerResponseData)
      This method shows products that are evaluated using rules
      Parameters:
      offerRequestData - the offer request data
      offerResponseData - the offer response data
    • discardProducts

      protected void discardProducts(List<String> returnedProducts, OfferResponseData offerResponseData)
      This method filters out the products that should be evaluated as part of the rules but not returned after rule evaluation
      Parameters:
      returnedProducts - the returned products
      offerResponseData - the offer response data
    • createOfferPricingInfos

      protected void createOfferPricingInfos(boolean applyPromotion, List<ProductModel> productsForCategory, OriginDestinationOfferInfoData originDestinationOfferInfo)
      Create offer pricing infos.
      Parameters:
      applyPromotion - the apply promotion
      productsForCategory - the products for category
      originDestinationOfferInfo - the origin destination offer info
    • getQualifiedProductsForOfferGroup

      protected List<ProductModel> getQualifiedProductsForOfferGroup(List<ProductModel> productsForCategory, OriginDestinationOfferInfoData originDestinationOfferInfo)
      This method collects the products that belong to a category(offerGroupData.getCode()), common across all transportOfferings and stockLevel more than zero.
      Parameters:
      productsForCategory - List of ProductModels which belong to a category
      originDestinationOfferInfo - OriginDestinationOfferInfoData object, holds list of TransportOfferings.
      Returns:
      List of ProductModel.
    • getCommonProducts

      protected List<ProductModel> getCommonProducts(Map<String,List<ProductModel>> productsPerTransportOffering)
      This method collects the common products across transportOfferings in case of multisectors or returns the available products if single sector.
      Parameters:
      productsPerTransportOffering - the products per transport offering
      Returns:
      common products
    • getAvailableProductsForTransportOffering

      protected Map<String,List<ProductModel>> getAvailableProductsForTransportOffering(List<ProductModel> productsForCategory, OriginDestinationOfferInfoData originDestinationOfferInfo)
      This method returns available products for each transportOffering. The product in offer should be of category of products as retrieved using the category code(offerGroupData.getCode()) and the available stockLevel of the product should be more than zero.
      Parameters:
      productsForCategory - the products for category
      originDestinationOfferInfo - the origin destination offer info
      Returns:
      available products for transport offering
    • getAvailableProductsInOffer

      protected List<ProductModel> getAvailableProductsInOffer(List<ProductModel> productsForCategory, TransportOfferingModel transportOfferingModel)
      Gets available products in offer.
      Parameters:
      productsForCategory - the products for category
      transportOfferingModel - the transport offering model
      Returns:
      the available products in offer
    • getProductService

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

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

      protected de.hybris.platform.category.CategoryService getCategoryService()
      Gets category service.
      Returns:
      the categoryService
    • setCategoryService

      public void setCategoryService(de.hybris.platform.category.CategoryService categoryService)
      Sets category service.
      Parameters:
      categoryService - the categoryService to set
    • getTransportOfferingService

      protected TransportOfferingService getTransportOfferingService()
      Gets transport offering service.
      Returns:
      the transportOfferingService
    • setTransportOfferingService

      public void setTransportOfferingService(TransportOfferingService transportOfferingService)
      Sets transport offering service.
      Parameters:
      transportOfferingService - the transportOfferingService to set
    • getProductConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel,ProductData> getProductConverter()
      Gets product converter.
      Returns:
      the productConverter
    • setProductConverter

      public void setProductConverter(de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel,ProductData> productConverter)
      Sets product converter.
      Parameters:
      productConverter - the productConverter to set
    • getTravelPromotionsFacade

      protected TravelPromotionsFacade getTravelPromotionsFacade()
      Gets travel promotions facade.
      Returns:
      the travelPromotionsFacade
    • setTravelPromotionsFacade

      public void setTravelPromotionsFacade(TravelPromotionsFacade travelPromotionsFacade)
      Sets travel promotions facade.
      Parameters:
      travelPromotionsFacade - the travelPromotionsFacade to set
    • getTravelCartService

      protected TravelCartService getTravelCartService()
      Gets travel cart service.
      Returns:
      the travelCartService
    • setTravelCartService

      public void setTravelCartService(TravelCartService travelCartService)
      Sets travel cart service.
      Parameters:
      travelCartService - the travelCartService to set
    • getTravelRulesService

      protected TravelRulesService getTravelRulesService()
      Gets travel rules service.
      Returns:
      the travelRulesService
    • setTravelRulesService

      public void setTravelRulesService(TravelRulesService travelRulesService)
      Sets travel rules service.
      Parameters:
      travelRulesService - the travelRulesService to set