Class DefaultShoppingOriginDestinationValidationStrategy
java.lang.Object
de.hybris.platform.travelfacades.strategies.AbstractAddBundleToCartValidationStrategy
de.hybris.platform.travelfacades.strategies.impl.OriginDestinationValidationStrategy
de.hybris.platform.shoppingfacades.strategies.impl.DefaultShoppingOriginDestinationValidationStrategy
- All Implemented Interfaces:
AddBundleToCartValidationStrategy
public class DefaultShoppingOriginDestinationValidationStrategy
extends OriginDestinationValidationStrategy
Shopping Strategy that extends the
OriginDestinationValidationStrategy.
The strategy is used to validate the addBundleToCart, that will be valid only if the origin location given by the
TransportOfferingModel transport offerings of the entry
with the originDestinationRefNumber specified in the AddBundleToCartRequestData is
equals to the destination location of the entry with the previous originDestinationRefNumber.-
Field Summary
Fields inherited from class de.hybris.platform.travelfacades.strategies.impl.OriginDestinationValidationStrategy
ADD_BUNDLE_TO_CART_VALIDATION_ERROR_ORIGIN_DESTINATIONFields inherited from class de.hybris.platform.travelfacades.strategies.AbstractAddBundleToCartValidationStrategy
ADD_BUNDLE_TO_CART_VALIDATION_ERROR_NO_SESSION_CART -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ShoppingTransportOfferingServiceGets the shopping transport offering servicevoidsetShoppingTransportOfferingService(ShoppingTransportOfferingService shoppingTransportOfferingService) Sets the shopping transport offering servicevalidate(AddBundleToCartRequestData addBundleToCartRequestData) Check if a return flight is present in the cart.Methods inherited from class de.hybris.platform.travelfacades.strategies.impl.OriginDestinationValidationStrategy
getCartService, getTravelRouteService, setCartService, setTravelRouteServiceMethods inherited from class de.hybris.platform.travelfacades.strategies.AbstractAddBundleToCartValidationStrategy
createAddToCartResponse
-
Constructor Details
-
DefaultShoppingOriginDestinationValidationStrategy
public DefaultShoppingOriginDestinationValidationStrategy()
-
-
Method Details
-
validate
Check if a return flight is present in the cart. If yes, verify if the destinationLocation of the outbound flight is equal to the originLocation of the inbound one.- Specified by:
validatein interfaceAddBundleToCartValidationStrategy- Overrides:
validatein classOriginDestinationValidationStrategy- Parameters:
addBundleToCartRequestData- the addBundleToCartRequestData- Returns:
- the add to cart response.
-
getShoppingTransportOfferingService
Gets the shopping transport offering service- Returns:
- the shopping transport offering service
-
setShoppingTransportOfferingService
public void setShoppingTransportOfferingService(ShoppingTransportOfferingService shoppingTransportOfferingService) Sets the shopping transport offering service- Parameters:
shoppingTransportOfferingService- the shopping transport offering service
-