Class DefaultTravelRestrictionFacade
java.lang.Object
de.hybris.platform.travelfacades.facades.impl.DefaultTravelRestrictionFacade
- All Implemented Interfaces:
TravelRestrictionFacade
- Direct Known Subclasses:
DefaultShoppingTravelRestrictionFacade
Default implementation of the
TravelRestrictionFacade interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethod to perform a validation on the quantity of distinct products for all the categoriesbooleancheckIfProductCanBeAdded(ProductModel productModel, long quantity, String travelRouteCode, List<String> transportOfferingCodes, String travellerUid, AbstractOrderModel abstractOrder) Method to perform a validation on the product quantity against the TravelRestriction on the provided orderModelbooleancheckIfProductCanBeAdded(String productCode, long quantity, String travelRouteCode, List<String> transportOfferingCodes, TravellerModel travellerModel) Method to perform a validation on the product quantity against the TravelRestriction on the provided orderModelbooleancheckIfProductCanBeAdded(String productCode, long quantity, String travelRouteCode, List<String> transportOfferingCodes, String travellerUid) Method to perform a validation on the product quantity against the TravelRestrictionprotected booleancheckIfTravellerTypeRestrictionApply(ProductModel productModel, TravellerModel travellerModel) protected voidevaluateRestrictionErrorsForEntry(Map<String, String> restrictionErrors, AbstractOrderEntryModel entry, List<String> travellers, List<String> transportOfferingCodes, List<CategoryModel> categories) protected StringgetAddToCartCriteria(ProductModel productModel) protected StringgetAddToCartCriteria(OfferGroupRestrictionModel offerGroupRestrictionModel) getAddToCartCriteria(String productCode) Returns the code of the AddToCartCriteria restriction for the given productCode.protected BookingServiceprotected de.hybris.platform.order.CartServiceMethod to perform a validation on the quantity of distinct products for all the categories based on the categoryRestriction.protected de.hybris.platform.product.ProductServiceprotected TravelCategoryServiceprotected TravelCommerceCartServiceprotected de.hybris.platform.servicelayer.dto.converter.Converter<TravelRestrictionModel,TravelRestrictionData> getTravelRestrictionForCategory(String categoryCode) This method returns the TravelRestrictionData of the category specified by the categoryCodegetTravelRestrictionForProduct(String productCode) This method returns the TravelRestrictionData of the product specified by the productCodeprotected TravelRestrictionServiceprotected TravelRestrictionStrategyvoidsetBookingService(BookingService bookingService) voidsetCartService(de.hybris.platform.order.CartService cartService) voidsetProductService(de.hybris.platform.product.ProductService productService) voidsetTravelCategoryService(TravelCategoryService travelCategoryService) voidsetTravelCommerceCartService(TravelCommerceCartService travelCommerceCartService) voidsetTravelRestrictionConverter(de.hybris.platform.servicelayer.dto.converter.Converter<TravelRestrictionModel, TravelRestrictionData> travelRestrictionConverter) voidsetTravelRestrictionService(TravelRestrictionService travelRestrictionService) voidsetTravelRestrictionStrategy(TravelRestrictionStrategy travelRestrictionStrategy)
-
Constructor Details
-
DefaultTravelRestrictionFacade
public DefaultTravelRestrictionFacade()
-
-
Method Details
-
checkIfProductCanBeAdded
public boolean checkIfProductCanBeAdded(String productCode, long quantity, String travelRouteCode, List<String> transportOfferingCodes, String travellerUid) Description copied from interface:TravelRestrictionFacadeMethod to perform a validation on the product quantity against the TravelRestriction- Specified by:
checkIfProductCanBeAddedin interfaceTravelRestrictionFacade- Parameters:
productCode- as the code of the product to be added/removed from the cartquantity- as the quantity of the product to be added/removedtravelRouteCode- as the travel Route CodetransportOfferingCodes- as the list of transportOffering codestravellerUid- as the Traveller unique id- Returns:
- true if the quantity to be added/removed fulfils the TravelRestriction and the product can be added/removed from the cart, false otherwise
-
checkIfProductCanBeAdded
public boolean checkIfProductCanBeAdded(ProductModel productModel, long quantity, String travelRouteCode, List<String> transportOfferingCodes, String travellerUid, AbstractOrderModel abstractOrder) Description copied from interface:TravelRestrictionFacadeMethod to perform a validation on the product quantity against the TravelRestriction on the provided orderModel- Specified by:
checkIfProductCanBeAddedin interfaceTravelRestrictionFacade- Parameters:
productModel- as the product to be added/removed from the cartquantity- as the quantity of the product to be added/removedtravelRouteCode- as the travel Route CodetransportOfferingCodes- as the list of transportOffering codestravellerUid- as the Traveller unique idabstractOrder- as that need to be check against- Returns:
- true if the quantity to be added/removed fulfils the TravelRestriction and the product can be added/removed from the cart, false otherwise
-
checkIfProductCanBeAdded
public boolean checkIfProductCanBeAdded(String productCode, long quantity, String travelRouteCode, List<String> transportOfferingCodes, TravellerModel travellerModel) Description copied from interface:TravelRestrictionFacadeMethod to perform a validation on the product quantity against the TravelRestriction on the provided orderModel- Specified by:
checkIfProductCanBeAddedin interfaceTravelRestrictionFacade- Parameters:
productCode- as the product to be added/removed from the cartquantity- as the quantity of the product to be added/removedtravelRouteCode- as the travel Route CodetransportOfferingCodes- as the list of transportOffering codestravellerModel- as the Traveller unique id- Returns:
- true if the quantity to be added/removed fulfils the TravelRestriction and the product can be added/removed from the cart, false otherwise
-
checkIfTravellerTypeRestrictionApply
protected boolean checkIfTravellerTypeRestrictionApply(ProductModel productModel, TravellerModel travellerModel) -
checkCategoryRestrictions
public boolean checkCategoryRestrictions()Description copied from interface:TravelRestrictionFacadeMethod to perform a validation on the quantity of distinct products for all the categories- Specified by:
checkCategoryRestrictionsin interfaceTravelRestrictionFacade- Returns:
- true if the TravelRestriction are fulfilled, false otherwise
-
getCategoryRestrictionErrors
Description copied from interface:TravelRestrictionFacadeMethod to perform a validation on the quantity of distinct products for all the categories based on the categoryRestriction.- Specified by:
getCategoryRestrictionErrorsin interfaceTravelRestrictionFacade- Returns:
- a map where the key is the localized name of the OfferGroup and the value is the string representing the minimum quantity of distinct products that should be added.
-
evaluateRestrictionErrorsForEntry
protected void evaluateRestrictionErrorsForEntry(Map<String, String> restrictionErrors, AbstractOrderEntryModel entry, List<String> travellers, List<String> transportOfferingCodes, List<CategoryModel> categories) -
getTravelRestrictionForProduct
Description copied from interface:TravelRestrictionFacadeThis method returns the TravelRestrictionData of the product specified by the productCode- Specified by:
getTravelRestrictionForProductin interfaceTravelRestrictionFacade- Parameters:
productCode- as the code of the product- Returns:
- the TravelRestrictionData of the product
-
getAddToCartCriteria
-
getTravelRestrictionForCategory
Description copied from interface:TravelRestrictionFacadeThis method returns the TravelRestrictionData of the category specified by the categoryCode- Specified by:
getTravelRestrictionForCategoryin interfaceTravelRestrictionFacade- Parameters:
categoryCode- as the code of the category- Returns:
- the TravelRestrictionData of the category
-
getAddToCartCriteria
-
getAddToCartCriteria
Description copied from interface:TravelRestrictionFacadeReturns the code of the AddToCartCriteria restriction for the given productCode. It retrieves the offerGroup of the product and returns its addToCartCriteria restriction if present, the default criteria otherwise.- Specified by:
getAddToCartCriteriain interfaceTravelRestrictionFacade- Parameters:
productCode- the product code- Returns:
- the code of the AddToCartCriteria restriction for the given product
-
getTravelCommerceCartService
- Returns:
- the travelCommerceCartService
-
setTravelCommerceCartService
- Parameters:
travelCommerceCartService- as the travelCommerceCartService to set
-
getCartService
protected de.hybris.platform.order.CartService getCartService()- Returns:
- the cartService
-
setCartService
public void setCartService(de.hybris.platform.order.CartService cartService) - Parameters:
cartService- as the cartService to set
-
getProductService
protected de.hybris.platform.product.ProductService getProductService()- Returns:
- the productService
-
setProductService
public void setProductService(de.hybris.platform.product.ProductService productService) - Parameters:
productService- as the productService to set
-
getTravelRestrictionStrategy
- Returns:
- the travelRestrictionStrategy
-
setTravelRestrictionStrategy
- Parameters:
travelRestrictionStrategy- as the travelRestrictionStrategy to set
-
getTravelCategoryService
- Returns:
- the travelCategoryService
-
setTravelCategoryService
- Parameters:
travelCategoryService- as the travelCategoryService to set
-
getBookingService
- Returns:
- the bookingService
-
setBookingService
- Parameters:
bookingService- the bookingService to set
-
getTravelRestrictionService
- Returns:
- the travelRestrictionService
-
setTravelRestrictionService
- Parameters:
travelRestrictionService- the travelRestrictionService to set
-
getTravelRestrictionConverter
protected de.hybris.platform.servicelayer.dto.converter.Converter<TravelRestrictionModel,TravelRestrictionData> getTravelRestrictionConverter()- Returns:
- the travelRestrictionConverter
-
setTravelRestrictionConverter
public void setTravelRestrictionConverter(de.hybris.platform.servicelayer.dto.converter.Converter<TravelRestrictionModel, TravelRestrictionData> travelRestrictionConverter) - Parameters:
travelRestrictionConverter- the travelRestrictionConverter to set
-