Class TransportOfferingCodeValidationStrategy

java.lang.Object
de.hybris.platform.travelfacades.strategies.impl.TransportOfferingCodeValidationStrategy
All Implemented Interfaces:
AncillaryCartValidationStrategy

public class TransportOfferingCodeValidationStrategy extends Object implements AncillaryCartValidationStrategy
The strategy is used to validate the if transport offering is available to add ancillary to basket.
  • Constructor Details

    • TransportOfferingCodeValidationStrategy

      public TransportOfferingCodeValidationStrategy()
  • Method Details

    • validateAddToCart

      public void validateAddToCart(String productCode, long qty, TravellerModel travellerModel, List<String> transportOfferingCodes, String travelRouteCode) throws InvalidTransportOfferingException, TransportOfferingNotInCartException
      Description copied from interface: AncillaryCartValidationStrategy
      Method to validate the add to cart of an ancillary product
      Specified by:
      validateAddToCart in interface AncillaryCartValidationStrategy
      Parameters:
      productCode - as the product to be added or removed from the cart
      qty - as the quantity to add/remove
      travellerModel - the traveller to whom the product is added or removed
      transportOfferingCodes - as the codes of the transportOfferings the product is added to or removed from
      travelRouteCode - as the travelRouteCode the product is added to or removed from
      Throws:
      InvalidTransportOfferingException
      TransportOfferingNotInCartException
    • validateTransportOfferingInCart

      protected void validateTransportOfferingInCart(CartModel cartModel, List<String> transportOfferingCodes)
      Validates transportOfferingCodes are present in the current cart
      Parameters:
      cartModel - the cart
      transportOfferingCodes - the list of transportOfferingCodes
    • getTransportOfferingService

      protected TransportOfferingService getTransportOfferingService()
      Gets transport offering service.
      Returns:
      the transportOfferingService
    • setTransportOfferingService

      public void setTransportOfferingService(TransportOfferingService transportOfferingService)
      Sets transport offering service.
      Parameters:
      transportOfferingService - the transportOfferingService to set
    • setCartService

      public void setCartService(de.hybris.platform.order.CartService cartService)
      Sets the cart service
      Parameters:
      cartService - the cart service
    • getCartService

      protected de.hybris.platform.order.CartService getCartService()
      Gets the cart service
      Returns:
      the cart service