Class RemoveTravellerFromAmendmentValidationStrategy

java.lang.Object
de.hybris.platform.travelfacades.strategies.impl.RemoveTravellerFromAmendmentValidationStrategy
All Implemented Interfaces:
RemoveTravellerFromCartValidationStrategy

public class RemoveTravellerFromAmendmentValidationStrategy extends Object implements RemoveTravellerFromCartValidationStrategy
Strategy to validate removal of traveller from amendment cart.
  • Constructor Details

    • RemoveTravellerFromAmendmentValidationStrategy

      public RemoveTravellerFromAmendmentValidationStrategy()
  • Method Details

    • validate

      public void validate(String travellerId) throws InvalidSessionCartException, InvalidTravellerException
      Validates if 1) the cart is empty 2) traveller is not final traveller in the cart 3) cart does not contain child only after removal of traveller.
      Specified by:
      validate in interface RemoveTravellerFromCartValidationStrategy
      Parameters:
      travellerId - the id of traveller
      Throws:
      InvalidSessionCartException - if session cart does not exist
      InvalidTravellerException - if traveller linked to cart entry or its last adult in cart
    • getActiveTravellers

      protected List<TravellerModel> getActiveTravellers(CartModel sessionCart)
      Return list of active travellers from cart.
      Parameters:
      sessionCart - the session cart
      Returns:
      list of travellers
    • isAdultExistAfterRemove

      protected boolean isAdultExistAfterRemove(List<TravellerModel> travellers)
      Is any adult traveller exist after removal of traveller.
      Parameters:
      travellers - the list of travellers
      Returns:
      true if any adult traveller exist after removal of traveller
    • getCartService

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

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