Class PROSOfferGroupHandler
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
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 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 List<OfferGroupData>getFilteredOfferGroups(OfferResponseData offerResponseData) Filters the offerGroups based of theAddToCartCriteriaType, returning the list of offerGroups with type PER_LEG or PER_LEG_PER_PAXprotected de.hybris.platform.servicelayer.dto.converter.Converter<MediaModel,ImageData> Gets the image converterGets offer group to origin destination mapping.protected final List<OriginDestinationOfferInfoData>getOriginDestinationInfos(OfferGroupData offerGroupData, ItineraryData itineraryData) Will update the OfferGroupData with a list of OriginDestinationOfferInfo based on the given ItineraryDataprotected de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel,ProductData> Gets product converter.protected PROSSearchResponseServiceGets pros search response service.protected PROSTravelAncillaryServiceGets pros travel ancillary 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 SearchResponseWrapperGets search response wrapper.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) Handle method.protected voidpopulateOfferGroupData(Map<CategoryModel, List<ProductModel>> categoryProductMap, OfferResponseData offerResponseData) Populate offer group data.protected voidpopulateOfferPricingInfo(OfferResponseData offerResponseData, Map<CategoryModel, List<ProductModel>> categoryProductMap) Populate offer pricing info.protected voidpopulateOriginDestinationInfo(OfferRequestData offerRequestData, OfferResponseData offerResponseData) Populate origin destination info.voidsetCategoryService(de.hybris.platform.category.CategoryService categoryService) Sets category service.voidsetImageConverter(de.hybris.platform.servicelayer.dto.converter.Converter<MediaModel, ImageData> imageConverter) Sets the image convertervoidsetOfferGroupToOriginDestinationMapping(Map<String, String> offerGroupToOriginDestinationMapping) Sets offer group to origin destination mapping.voidsetProductConverter(de.hybris.platform.servicelayer.dto.converter.Converter<ProductModel, ProductData> productConverter) Sets product converter.voidsetProsSearchResponseService(PROSSearchResponseService prosSearchResponseService) Sets pros search response service.voidsetProsTravelAncillaryService(PROSTravelAncillaryService prosTravelAncillaryService) Sets pros travel ancillary 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 rulesMethods inherited from class de.hybris.platform.travelfacades.ancillary.search.handlers.impl.OfferGroupHandler
getCategoryConverter, getCategoryOptionList, getOfferGroupDataConfiguredPopulator, getOfferSortStrategy, getTransportOfferingCodes, getTravelCategoryService, setCategoryConverter, setCategoryOptionList, setOfferGroupDataConfiguredPopulator, setOfferSortStrategy, setTravelCategoryService
-
Constructor Details
-
PROSOfferGroupHandler
public PROSOfferGroupHandler()
-
-
Method Details
-
handle
Description copied from interface:AncillarySearchHandlerHandle method.- Specified by:
handlein interfaceAncillarySearchHandler- Overrides:
handlein classOfferGroupHandler- Parameters:
offerRequestData- the offer request dataofferResponseData- the offer response data
-
populateOfferPricingInfo
protected void populateOfferPricingInfo(OfferResponseData offerResponseData, Map<CategoryModel, List<ProductModel>> categoryProductMap) Populate offer pricing info.- Parameters:
offerResponseData- the offer response datacategoryProductMap- the category product map
-
populateOriginDestinationInfo
protected void populateOriginDestinationInfo(OfferRequestData offerRequestData, OfferResponseData offerResponseData) Populate origin destination info.- Parameters:
offerRequestData- the offer request dataofferResponseData- the offer response data
-
populateOfferGroupData
protected void populateOfferGroupData(Map<CategoryModel, List<ProductModel>> categoryProductMap, OfferResponseData offerResponseData) Populate offer group data.- Parameters:
categoryProductMap- the category product mapofferResponseData- 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
-
getSearchResponseWrapper
Gets search response wrapper.- Returns:
- the search response wrapper
-
getFilteredOfferGroups
Filters the offerGroups based of theAddToCartCriteriaType, 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 updateitineraryData- the ItineraryData- Returns:
- list of OriginDestinationOfferInfoData
-
getProsTravelAncillaryService
Gets pros travel ancillary service.- Returns:
- the pros travel ancillary service
-
setProsTravelAncillaryService
Sets pros travel ancillary service.- Parameters:
prosTravelAncillaryService- the pros travel ancillary service
-
getTravelCartService
Gets travel cart service.- Returns:
- the travel cart service
-
setTravelCartService
Sets travel cart service.- Parameters:
travelCartService- the travel cart service
-
getProsSearchResponseService
Gets pros search response service.- Returns:
- the pros search response service
-
setProsSearchResponseService
Sets pros search response service.- Parameters:
prosSearchResponseService- the pros search response service
-
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
Gets travel promotions facade.- Returns:
- the travel promotions facade
-
setTravelPromotionsFacade
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
Gets travel rules service.- Returns:
- the travel rules service
-
setTravelRulesService
Sets travel rules service.- Parameters:
travelRulesService- the travel rules service
-
getTransportOfferingService
Gets transport offering service.- Returns:
- the transport offering service
-
setTransportOfferingService
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
-