Class DefaultShoppingMerchandisingFacade

java.lang.Object
de.hybris.platform.shoppingfacades.facades.impl.DefaultShoppingMerchandisingFacade
All Implemented Interfaces:
ShoppingMerchandisingFacade
Direct Known Subclasses:
DefaultPROSMerchandisingFacade

public abstract class DefaultShoppingMerchandisingFacade extends Object implements ShoppingMerchandisingFacade
The Shopping implementation of the ShoppingMerchandisingFacade interface. This abstract class performs the ancillary search through the merchandising API.
  • Constructor Details

    • DefaultShoppingMerchandisingFacade

      public DefaultShoppingMerchandisingFacade()
  • Method Details

    • searchAncillaries

      This method performs the merchandising request for searching all the available ancillaries. The response will enriched with commerce ancillaries and will be filtered accordingly to the list of flights and by visibility rules.
      Specified by:
      searchAncillaries in interface ShoppingMerchandisingFacade
      Parameters:
      transportOfferingCodes - the list of flight codes to be used in order to filter the merchandising response
      Returns:
      the AncillaryResponseData
      Throws:
      MerchandisingRequestException - to be thrown when a bad request response is returned from the merchandising api call.
      InvalidSessionCartException - to be thrown either when there is no cart in the session or when the cart is empty.
      FarePriceException - to be thrown when a fare price response is missing in the cart.
    • searchBaggages

      This method performs the merchandising request for searching all the available baggages. The response will be enriched with commerce baggage products and filtered by visibility rules.
      Specified by:
      searchBaggages in interface ShoppingMerchandisingFacade
      Returns:
      the BaggageResponseData
      Throws:
      MerchandisingRequestException - thrown when an errors occurs during a merchandising request
      InvalidSessionCartException - thrown when there is no cart in the session
      FarePriceException - thrown when an error occurs during a fare price request.
    • populateCommerceBaggageProducts

      protected void populateCommerceBaggageProducts(BaggageResponseData baggageResponseData)
      Populates the baggage Response Data with commerce baggage products.
      Parameters:
      baggageResponseData - the baggage response data
    • validateMerchandisingEntries

      public abstract void validateMerchandisingEntries(AbstractOrderModel orderModel) throws TravelCartValidationException
      Description copied from interface: ShoppingMerchandisingFacade
      Validate shopping ancillaries in the cart with merchandising response.
      Specified by:
      validateMerchandisingEntries in interface ShoppingMerchandisingFacade
      Parameters:
      orderModel - the cart model
      Throws:
      TravelCartValidationException
    • searchBaggages

      This method performs the merchandising request for searching all the charged baggages. The response will be filtered accordingly to the list of flights.
      Specified by:
      searchBaggages in interface ShoppingMerchandisingFacade
      Parameters:
      transportOfferingCodes - the list of flight codes to be used in order to filter the merchandising response
      Returns:
      the BaggageResponseData
      Throws:
      MerchandisingRequestException - to be thrown when a bad request response is returned from the merchandising api call.
      InvalidSessionCartException - to be thrown either when there is no cart in the session or when the cart is empty.
      FarePriceException - to be thrown when a fare price response is missing in the cart.
    • createMerchandisingChangeFee

      public abstract void createMerchandisingChangeFee(Integer entryId) throws CancelFlightException
      Description copied from interface: ShoppingMerchandisingFacade
      This method creates a change fee when an existing merchandising entry is updated, removed or deleted.
      Specified by:
      createMerchandisingChangeFee in interface ShoppingMerchandisingFacade
      Parameters:
      entryId - the entry id
      Throws:
      CancelFlightException - the cancel flight exception
    • createShoppingBaggages

      protected abstract BaggageResponseData createShoppingBaggages(List<String> transportOfferingCodes) throws InvalidSessionCartException, FarePriceException, MerchandisingRequestException
      This method creates and sends a merchandising request in order to retrieve all the available charged baggages. The response will be filtered accordingly to the list of flights and converted in a BaggageResponseData.
      Parameters:
      transportOfferingCodes - the list of flight codes
      Returns:
      the BaggageResponseData
      Throws:
      InvalidSessionCartException
      FarePriceException
      MerchandisingRequestException
    • createShoppingAncillaries

      protected abstract AncillaryResponseData createShoppingAncillaries(List<String> transportOfferingCodes) throws MerchandisingRequestException, InvalidSessionCartException, FarePriceException
      This method creates and sends a merchandising request in order to retrieve all the available ancillaries. The response will be filtered accordingly to the list of flights and converted in an AncillaryResponseData.
      Parameters:
      transportOfferingCodes - the list of flight codes
      Returns:
      the AncillaryResponseData
      Throws:
      MerchandisingRequestException - the merchandising request exception
      InvalidSessionCartException - the invalid session cart exception
      FarePriceException - the fare price exception
    • populateCommerceAncillaries

      protected void populateCommerceAncillaries(OfferRequestData offerRequest, AncillaryResponseData ancillaryResponseData, List<String> transportOfferingCodes)
      Populate commerce ancillaries.
      Parameters:
      offerRequest - the offer request
      ancillaryResponseData - the ancillary response data
      transportOfferingCodes - the transport offering codes
    • filterAncillaryProducts

      protected void filterAncillaryProducts(OfferRequestData offerRequestData, AncillaryResponseData ancillaryResponseData)
      This method shows ancillary products that are evaluated using rules
      Parameters:
      offerRequestData - the offer request data
      ancillaryResponseData - the ancillary response data
    • discardAncillaryProducts

      protected void discardAncillaryProducts(List<String> returnedProducts, AncillaryResponseData ancillaryResponseData)
      This method filters out the ancillary products that should be evaluated as part of the rules but not returned after rule evaluation
      Parameters:
      returnedProducts - the returned products
      ancillaryResponseData - the ancillary response data
    • filterBaggageProducts

      protected void filterBaggageProducts(OfferRequestData offerRequestData, BaggageResponseData baggageResponseData)
      This method shows baggage products that are evaluated using rules
      Parameters:
      offerRequestData - the offer request data
      baggageResponseData - the baggage response data
    • discardBaggageProducts

      protected void discardBaggageProducts(List<String> returnedProducts, BaggageResponseData baggageResponseData)
      This method filters out the products that should be evaluated as part of the rules but not returned after rule evaluation
      Parameters:
      returnedProducts - the returned products
      baggageResponseData - the baggage response data
    • getCartService

      protected TravelCartService getCartService()
      Gets cart service.
      Returns:
      the cart service
    • setCartService

      public void setCartService(TravelCartService cartService)
      Sets cart service.
      Parameters:
      cartService - the cart service
    • getTransportOfferingService

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

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

      protected OffersFacade getOffersFacade()
      Gets offers facade.
      Returns:
      the offers facade
    • setOffersFacade

      public void setOffersFacade(OffersFacade offersFacade)
      Sets offers facade.
      Parameters:
      offersFacade - the offers facade
    • getTravelRulesService

      protected TravelRulesService getTravelRulesService()
      Gets travel rules service.
      Returns:
      the travelRulesService
    • setTravelRulesService

      public void setTravelRulesService(TravelRulesService travelRulesService)
      Sets travel rules service.
      Parameters:
      travelRulesService - the travelRulesService to set
    • getAncillaryResponseDataConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<OfferResponseData,AncillaryResponseData> getAncillaryResponseDataConverter()
      Gets ancillary response data converter.
      Returns:
      the ancillary response data converter
    • setAncillaryResponseDataConverter

      public void setAncillaryResponseDataConverter(de.hybris.platform.servicelayer.dto.converter.Converter<OfferResponseData,AncillaryResponseData> ancillaryResponseDataConverter)
      Sets ancillary response data converter.
      Parameters:
      ancillaryResponseDataConverter - the ancillary response data converter