Class OfferPricingInfoHandler
java.lang.Object
de.hybris.platform.travelfacades.ancillary.search.handlers.impl.OfferPricingInfoHandler
- All Implemented Interfaces:
AncillarySearchHandler
- Direct Known Subclasses:
ShoppingCommerceOfferPricingInfoHandler
Handler class to populate OfferPricingInfoData for each category of products available to offer as ancillaries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateOfferPricingInfos(boolean applyPromotion, List<ProductModel> productsForCategory, OriginDestinationOfferInfoData originDestinationOfferInfo) Create offer pricing infos.protected voiddiscardProducts(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 evaluationprotected Map<String,List<ProductModel>> getAvailableProductsForTransportOffering(List<ProductModel> productsForCategory, OriginDestinationOfferInfoData originDestinationOfferInfo) This method returns available products for each transportOffering.protected List<ProductModel>getAvailableProductsInOffer(List<ProductModel> productsForCategory, TransportOfferingModel transportOfferingModel) Gets available products in offer.protected de.hybris.platform.category.CategoryServiceGets category service.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.protected de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel,ProductData> Gets product converter.protected de.hybris.platform.product.ProductServiceGets product service.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.protected TransportOfferingServiceGets transport offering service.protected TravelCartServiceGets travel cart service.protected TravelPromotionsFacadeGets travel promotions facade.protected TravelRulesServiceGets travel rules service.voidhandle(OfferRequestData offerRequestData, OfferResponseData offerResponseData) Creates and populates OfferPricingInfoData for products of each category.voidsetCategoryService(de.hybris.platform.category.CategoryService categoryService) Sets category service.voidsetProductConverter(de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel, ProductData> productConverter) Sets product converter.voidsetProductService(de.hybris.platform.product.ProductService productService) Sets product service.voidsetTransportOfferingService(TransportOfferingService transportOfferingService) Sets transport offering service.voidsetTravelCartService(TravelCartService travelCartService) Sets travel cart service.voidsetTravelPromotionsFacade(TravelPromotionsFacade travelPromotionsFacade) Sets travel promotions facade.voidsetTravelRulesService(TravelRulesService travelRulesService) Sets travel rules service.protected voidshowProducts(OfferRequestData offerRequestData, OfferResponseData offerResponseData) This method shows products that are evaluated using rules
-
Constructor Details
-
OfferPricingInfoHandler
public OfferPricingInfoHandler()
-
-
Method Details
-
handle
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:
handlein interfaceAncillarySearchHandler- Parameters:
offerRequestData- the offer request dataofferResponseData- the offer response data
-
showProducts
This method shows products that are evaluated using rules- Parameters:
offerRequestData- the offer request dataofferResponseData- the offer response data
-
discardProducts
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 productsofferResponseData- the offer response data
-
createOfferPricingInfos
protected void createOfferPricingInfos(boolean applyPromotion, List<ProductModel> productsForCategory, OriginDestinationOfferInfoData originDestinationOfferInfo) Create offer pricing infos.- Parameters:
applyPromotion- the apply promotionproductsForCategory- the products for categoryoriginDestinationOfferInfo- 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 categoryoriginDestinationOfferInfo- 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 categoryoriginDestinationOfferInfo- 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 categorytransportOfferingModel- 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
Gets transport offering service.- Returns:
- the transportOfferingService
-
setTransportOfferingService
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
Gets travel promotions facade.- Returns:
- the travelPromotionsFacade
-
setTravelPromotionsFacade
Sets travel promotions facade.- Parameters:
travelPromotionsFacade- the travelPromotionsFacade to set
-
getTravelCartService
Gets travel cart service.- Returns:
- the travelCartService
-
setTravelCartService
Sets travel cart service.- Parameters:
travelCartService- the travelCartService to set
-
getTravelRulesService
Gets travel rules service.- Returns:
- the travelRulesService
-
setTravelRulesService
Sets travel rules service.- Parameters:
travelRulesService- the travelRulesService to set
-