Class 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.
  • Constructor Details

    • DefaultShoppingOriginDestinationValidationStrategy

      public DefaultShoppingOriginDestinationValidationStrategy()
  • Method Details

    • validate

      public AddToCartResponseData validate(AddBundleToCartRequestData addBundleToCartRequestData)
      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:
      validate in interface AddBundleToCartValidationStrategy
      Overrides:
      validate in class OriginDestinationValidationStrategy
      Parameters:
      addBundleToCartRequestData - the addBundleToCartRequestData
      Returns:
      the add to cart response.
    • getShoppingTransportOfferingService

      protected ShoppingTransportOfferingService 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