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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected de.hybris.platform.order.CartServiceGets the cart serviceprotected TransportOfferingServiceGets transport offering service.voidsetCartService(de.hybris.platform.order.CartService cartService) Sets the cart servicevoidsetTransportOfferingService(TransportOfferingService transportOfferingService) Sets transport offering service.voidvalidateAddToCart(String productCode, long qty, TravellerModel travellerModel, List<String> transportOfferingCodes, String travelRouteCode) Method to validate the add to cart of an ancillary productprotected voidvalidateTransportOfferingInCart(CartModel cartModel, List<String> transportOfferingCodes) Validates transportOfferingCodes are present in the current cart
-
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:AncillaryCartValidationStrategyMethod to validate the add to cart of an ancillary product- Specified by:
validateAddToCartin interfaceAncillaryCartValidationStrategy- Parameters:
productCode- as the product to be added or removed from the cartqty- as the quantity to add/removetravellerModel- the traveller to whom the product is added or removedtransportOfferingCodes- as the codes of the transportOfferings the product is added to or removed fromtravelRouteCode- as the travelRouteCode the product is added to or removed from- Throws:
InvalidTransportOfferingExceptionTransportOfferingNotInCartException
-
validateTransportOfferingInCart
protected void validateTransportOfferingInCart(CartModel cartModel, List<String> transportOfferingCodes) Validates transportOfferingCodes are present in the current cart- Parameters:
cartModel- the carttransportOfferingCodes- the list of transportOfferingCodes
-
getTransportOfferingService
Gets transport offering service.- Returns:
- the transportOfferingService
-
setTransportOfferingService
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
-