Class DefaultTravelRestrictionFacade

java.lang.Object
de.hybris.platform.travelfacades.facades.impl.DefaultTravelRestrictionFacade
All Implemented Interfaces:
TravelRestrictionFacade
Direct Known Subclasses:
DefaultShoppingTravelRestrictionFacade

public class DefaultTravelRestrictionFacade extends Object implements TravelRestrictionFacade
Default implementation of the TravelRestrictionFacade interface.
  • 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: TravelRestrictionFacade
      Method to perform a validation on the product quantity against the TravelRestriction
      Specified by:
      checkIfProductCanBeAdded in interface TravelRestrictionFacade
      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

      public boolean checkIfProductCanBeAdded(ProductModel productModel, long quantity, String travelRouteCode, List<String> transportOfferingCodes, String travellerUid, AbstractOrderModel abstractOrder)
      Description copied from interface: TravelRestrictionFacade
      Method to perform a validation on the product quantity against the TravelRestriction on the provided orderModel
      Specified by:
      checkIfProductCanBeAdded in interface TravelRestrictionFacade
      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
      abstractOrder - 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: TravelRestrictionFacade
      Method to perform a validation on the product quantity against the TravelRestriction on the provided orderModel
      Specified by:
      checkIfProductCanBeAdded in interface TravelRestrictionFacade
      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
    • checkIfTravellerTypeRestrictionApply

      protected boolean checkIfTravellerTypeRestrictionApply(ProductModel productModel, TravellerModel travellerModel)
    • checkCategoryRestrictions

      public boolean checkCategoryRestrictions()
      Description copied from interface: TravelRestrictionFacade
      Method to perform a validation on the quantity of distinct products for all the categories
      Specified by:
      checkCategoryRestrictions in interface TravelRestrictionFacade
      Returns:
      true if the TravelRestriction are fulfilled, false otherwise
    • getCategoryRestrictionErrors

      public Map<String,String> getCategoryRestrictionErrors()
      Description copied from interface: TravelRestrictionFacade
      Method to perform a validation on the quantity of distinct products for all the categories based on the categoryRestriction.
      Specified by:
      getCategoryRestrictionErrors in interface TravelRestrictionFacade
      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

      public TravelRestrictionData getTravelRestrictionForProduct(String productCode)
      Description copied from interface: TravelRestrictionFacade
      This method returns the TravelRestrictionData of the product specified by the productCode
      Specified by:
      getTravelRestrictionForProduct in interface TravelRestrictionFacade
      Parameters:
      productCode - as the code of the product
      Returns:
      the TravelRestrictionData of the product
    • getAddToCartCriteria

      protected String getAddToCartCriteria(ProductModel productModel)
    • getTravelRestrictionForCategory

      public TravelRestrictionData getTravelRestrictionForCategory(String categoryCode)
      Description copied from interface: TravelRestrictionFacade
      This method returns the TravelRestrictionData of the category specified by the categoryCode
      Specified by:
      getTravelRestrictionForCategory in interface TravelRestrictionFacade
      Parameters:
      categoryCode - as the code of the category
      Returns:
      the TravelRestrictionData of the category
    • getAddToCartCriteria

      protected String getAddToCartCriteria(OfferGroupRestrictionModel offerGroupRestrictionModel)
    • getAddToCartCriteria

      public String getAddToCartCriteria(String productCode)
      Description copied from interface: TravelRestrictionFacade
      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.
      Specified by:
      getAddToCartCriteria in interface TravelRestrictionFacade
      Parameters:
      productCode - the product code
      Returns:
      the code of the AddToCartCriteria restriction for the given product
    • getTravelCommerceCartService

      protected TravelCommerceCartService getTravelCommerceCartService()
      Returns:
      the travelCommerceCartService
    • setTravelCommerceCartService

      public void setTravelCommerceCartService(TravelCommerceCartService travelCommerceCartService)
      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

      protected TravelRestrictionStrategy getTravelRestrictionStrategy()
      Returns:
      the travelRestrictionStrategy
    • setTravelRestrictionStrategy

      public void setTravelRestrictionStrategy(TravelRestrictionStrategy travelRestrictionStrategy)
      Parameters:
      travelRestrictionStrategy - as the travelRestrictionStrategy to set
    • getTravelCategoryService

      protected TravelCategoryService getTravelCategoryService()
      Returns:
      the travelCategoryService
    • setTravelCategoryService

      public void setTravelCategoryService(TravelCategoryService travelCategoryService)
      Parameters:
      travelCategoryService - as the travelCategoryService to set
    • getBookingService

      protected BookingService getBookingService()
      Returns:
      the bookingService
    • setBookingService

      public void setBookingService(BookingService bookingService)
      Parameters:
      bookingService - the bookingService to set
    • getTravelRestrictionService

      protected TravelRestrictionService getTravelRestrictionService()
      Returns:
      the travelRestrictionService
    • setTravelRestrictionService

      public void setTravelRestrictionService(TravelRestrictionService travelRestrictionService)
      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