Interface TravelRestrictionFacade

All Known Implementing Classes:
DefaultShoppingTravelRestrictionFacade, DefaultTravelRestrictionFacade

public interface TravelRestrictionFacade
Exposes the services relevant to TravelRestrictionDTO
  • 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 cart
      quantity - as the quantity of the product to be added/removed
      travelRouteCode - as the travel Route Code
      transportOfferingCodes - as the list of transportOffering codes
      travellerUid - 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 cart
      quantity - as the quantity of the product to be added/removed
      travelRouteCode - as the travel Route Code
      transportOfferingCodes - as the list of transportOffering codes
      travellerUid - as the Traveller unique id
      orderModel - 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

      Map<String,String> 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

      TravelRestrictionData getTravelRestrictionForProduct(String productCode)
      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

      TravelRestrictionData getTravelRestrictionForCategory(String categoryCode)
      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

      String getAddToCartCriteria(String productCode)
      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 cart
      quantity - as the quantity of the product to be added/removed
      travelRouteCode - as the travel Route Code
      transportOfferingCodes - as the list of transportOffering codes
      travellerModel - 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