Interface TravelRestrictionFacade
- All Known Implementing Classes:
DefaultShoppingTravelRestrictionFacade,DefaultTravelRestrictionFacade
public interface TravelRestrictionFacade
Exposes the services relevant to TravelRestrictionDTO
-
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 orderModel) 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 TravelRestrictiongetAddToCartCriteria(String productCode) Returns the code of the AddToCartCriteria restriction for the given productCode.Method to perform a validation on the quantity of distinct products for all the categories based on the categoryRestriction.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 productCode
-
Method Details
-
checkIfProductCanBeAdded
boolean checkIfProductCanBeAdded(String productCode, long quantity, String travelRouteCode, List<String> transportOfferingCodes, String travellerUid) Method to perform a validation on the product quantity against the TravelRestriction- 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
boolean checkIfProductCanBeAdded(ProductModel productModel, long quantity, String travelRouteCode, List<String> transportOfferingCodes, String travellerUid, AbstractOrderModel orderModel) Method to perform a validation on the product quantity against the TravelRestriction on the provided orderModel- 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 idorderModel- 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
-
checkCategoryRestrictions
boolean checkCategoryRestrictions()Method to perform a validation on the quantity of distinct products for all the categories- Returns:
- true if the TravelRestriction are fulfilled, false otherwise
-
getCategoryRestrictionErrors
Method to perform a validation on the quantity of distinct products for all the categories based on the categoryRestriction.- 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.
-
getTravelRestrictionForProduct
This method returns the TravelRestrictionData of the product specified by the productCode- Parameters:
productCode- as the code of the product- Returns:
- the TravelRestrictionData of the product
-
getTravelRestrictionForCategory
This method returns the TravelRestrictionData of the category specified by the categoryCode- Parameters:
categoryCode- as the code of the category- Returns:
- the TravelRestrictionData of the category
-
getAddToCartCriteria
Returns 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.- Parameters:
productCode- the product code- Returns:
- the code of the AddToCartCriteria restriction for the given product
-
checkIfProductCanBeAdded
boolean checkIfProductCanBeAdded(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 orderModel- 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
-