java.lang.Object
de.hybris.platform.travelfacades.ancillary.search.handlers.impl.OfferGroupHandler
de.hybris.platform.prosfacades.ancillary.search.handlers.impl.PROSOfferGroupHandler
All Implemented Interfaces:
AncillarySearchHandler

public class PROSOfferGroupHandler extends OfferGroupHandler implements AncillarySearchHandler
Handler to populate the ancillaries coming from the pros along with the ancillaries from the hybris that have stock against the transport offering. Firstly, all the ancillary products to which we have stock in hybris are retrieved. Then, the ancillaries coming from the PROS are converted to respective ancillary product model. Then, all the products are combined and grouped by categories. Finally, the offer group data, origin destination info data and offer pricing info are populated.
  • Constructor Details

    • PROSOfferGroupHandler

      public PROSOfferGroupHandler()
  • Method Details

    • handle

      public void handle(OfferRequestData offerRequestData, OfferResponseData offerResponseData)
      Description copied from interface: AncillarySearchHandler
      Handle method.
      Specified by:
      handle in interface AncillarySearchHandler
      Overrides:
      handle in class OfferGroupHandler
      Parameters:
      offerRequestData - the offer request data
      offerResponseData - the offer response data
    • populateOfferPricingInfo

      protected void populateOfferPricingInfo(OfferResponseData offerResponseData, Map<CategoryModel,List<ProductModel>> categoryProductMap)
      Populate offer pricing info.
      Parameters:
      offerResponseData - the offer response data
      categoryProductMap - the category product map
    • populateOriginDestinationInfo

      protected void populateOriginDestinationInfo(OfferRequestData offerRequestData, OfferResponseData offerResponseData)
      Populate origin destination info.
      Parameters:
      offerRequestData - the offer request data
      offerResponseData - the offer response data
    • populateOfferGroupData

      protected void populateOfferGroupData(Map<CategoryModel,List<ProductModel>> categoryProductMap, OfferResponseData offerResponseData)
      Populate offer group data.
      Parameters:
      categoryProductMap - the category product map
      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
    • getSearchResponseWrapper

      protected SearchResponseWrapper getSearchResponseWrapper()
      Gets search response wrapper.
      Returns:
      the search response wrapper
    • getFilteredOfferGroups

      protected List<OfferGroupData> getFilteredOfferGroups(OfferResponseData offerResponseData)
      Filters the offerGroups based of the AddToCartCriteriaType, returning the list of offerGroups with type PER_LEG or PER_LEG_PER_PAX
      Parameters:
      offerResponseData - the offer response data
      Returns:
      filtered offer groups
    • getOriginDestinationInfos

      protected final List<OriginDestinationOfferInfoData> getOriginDestinationInfos(OfferGroupData offerGroupData, ItineraryData itineraryData)
      Will update the OfferGroupData with a list of OriginDestinationOfferInfo based on the given ItineraryData
      Parameters:
      offerGroupData - the OfferGroupData to update
      itineraryData - the ItineraryData
      Returns:
      list of OriginDestinationOfferInfoData
    • getProsTravelAncillaryService

      protected PROSTravelAncillaryService getProsTravelAncillaryService()
      Gets pros travel ancillary service.
      Returns:
      the pros travel ancillary service
    • setProsTravelAncillaryService

      public void setProsTravelAncillaryService(PROSTravelAncillaryService prosTravelAncillaryService)
      Sets pros travel ancillary service.
      Parameters:
      prosTravelAncillaryService - the pros travel ancillary service
    • getTravelCartService

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

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

      protected PROSSearchResponseService getProsSearchResponseService()
      Gets pros search response service.
      Returns:
      the pros search response service
    • setProsSearchResponseService

      public void setProsSearchResponseService(PROSSearchResponseService prosSearchResponseService)
      Sets pros search response service.
      Parameters:
      prosSearchResponseService - the pros search response service
    • 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
    • getTravelPromotionsFacade

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

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

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

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

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

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

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

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

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

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

      protected de.hybris.platform.servicelayer.dto.converter.Converter<MediaModel,ImageData> getImageConverter()
      Gets the image converter
      Returns:
      the image converter
    • setImageConverter

      public void setImageConverter(de.hybris.platform.servicelayer.dto.converter.Converter<MediaModel,ImageData> imageConverter)
      Sets the image converter
      Parameters:
      imageConverter - the image converter