Class NewTicketItineraryRepricerRequestPopulationHandler

java.lang.Object
de.hybris.platform.prosfacades.repricer.handler.impl.NewTicketItineraryRepricerRequestPopulationHandler
All Implemented Interfaces:
RepricerRequestPopulationHandler

public class NewTicketItineraryRepricerRequestPopulationHandler extends Object implements RepricerRequestPopulationHandler
This class populates the new ticket itinerary information to the RepricerRequest.
  • Constructor Details

    • NewTicketItineraryRepricerRequestPopulationHandler

      public NewTicketItineraryRepricerRequestPopulationHandler()
  • Method Details

    • handle

      public void handle(AbstractOrderModel order, RepricingRequestData repricingRequestData, RepricerRequest repricerRequest) throws RepricingException
      Description copied from interface: RepricerRequestPopulationHandler
      Populates RepricerRequest using data from order and repricing request data.
      Specified by:
      handle in interface RepricerRequestPopulationHandler
      Parameters:
      order - the order
      repricingRequestData - the repricing request data
      repricerRequest - the repricer request
      Throws:
      RepricingException
    • getTransportEntriesForTraveller

      protected List<AbstractOrderEntryModel> getTransportEntriesForTraveller(List<AbstractOrderEntryModel> entries, Integer solutionId, List<String> passengers)
      Gets transport entries for traveller.
      Parameters:
      entries - the valid entries
      solutionId - the solution id
      passengers - the passengers
      Returns:
      the transport entries for traveller
    • getEntriesWithValidConsignments

      protected List<AbstractOrderEntryModel> getEntriesWithValidConsignments(AbstractOrderModel orderModel)
      Gets all the entries that have the consignment in the allowed status for an amendment.
      Parameters:
      orderModel - the order model
      Returns:
      the valid consignment entries
    • getLastReissuedOrder

      protected AbstractOrderModel getLastReissuedOrder(AbstractOrderModel order)
      Retrieves the first original order having either a repricer response or an intelliPricer response not null.
      Parameters:
      order - the order
      Returns:
      the abstract order model
    • createOriginDestinationGroups

      protected List<OriginDestinationGroup> createOriginDestinationGroups(ChangeOriginDestinationGroupData changeOriginDestinationGroupData, List<TransportOfferingModel> transportOfferingsNotChanged, int originDestinationGroupId, AbstractOrderModel previousOrder, int flightId)
      Create origin destination groups list from the flights that have to be changed (contained in changeOriginDestinationGroupData) and flights that have not been changed. To set the origin destination group id and flight id, last created ids are incremented and passed to the method to create further origin destination groups.
      Parameters:
      changeOriginDestinationGroupData - the change origin destination group data
      transportOfferingsNotChanged - the transport offerings not changed
      originDestinationGroupId - the origin destination group id
      previousOrder - the previous order
      flightId -
      Returns:
      the list of originDestinationGroups
    • createOriginDestinationGroupsFromTransportOfferings

      protected List<OriginDestinationGroup> createOriginDestinationGroupsFromTransportOfferings(List<TransportOfferingModel> transportOfferings, int originDestinationGroupId, AbstractOrderModel previousOrder, int flightId)
      Create origin destination group from transport offerings not changed list.
      Parameters:
      transportOfferings - the transport offerings not changed
      originDestinationGroupId - the origin destination group id
      previousOrder - the previous order
      flightId - the flight id
      Returns:
      the list or originDestinationGroups not changed
    • populateFlightMapByNumber

      protected void populateFlightMapByNumber(Map<String,RepricerFlight> flightNumberRepricerFlightMap, RepricerResponseMessage prosRepricerResponseMessage, List<TransportOfferingModel> transportOfferings)
      Populate flight number repricer flight map from repricing response.
      Parameters:
      flightNumberRepricerFlightMap - the flight number Repricer Flight amp
      prosRepricerResponseMessage - the pros repricer response message
      transportOfferings - the transport offerings
    • createPaxRBDs

      protected List<PaxRBD> createPaxRBDs(List<PaxRBD> paxRBDs)
      Creates the pax rbd list from repricing response list.
      Parameters:
      paxRBDs - the pax rbd list
      Returns:
      the list of pax rbd
    • populateFlightMapByNumber

      protected void populateFlightMapByNumber(Map<String,RepricerFlight> flightNumberRepricerFlightMap, PROSSearchResponse prosSearchResponse, List<TransportOfferingModel> transportOfferings)
      Populate flight number repricer flight map from search response.
      Parameters:
      flightNumberRepricerFlightMap - the flight number repricer flight map
      prosSearchResponse - the pros search response
      transportOfferings - the transport offerings
    • populateFlightMapByNumber

      protected void populateFlightMapByNumber(BookingSolution bookingSolution, Map<String,RepricerFlight> flightNumberRepricerFlightMap, Map<Integer,RepricerFlight> searchResponseFlightIdNumbersMap)
      Populate flight number repricer flight map from booking solution.
      Parameters:
      bookingSolution - the booking solution
      flightNumberRepricerFlightMap - the flight number repricer flight map
      searchResponseFlightIdNumbersMap - the search response flight id numbers map
    • createOriginDestinationGroup

      protected OriginDestinationGroup createOriginDestinationGroup(ChangeOriginDestinationGroupData changeOriginDestinationGroupData, int originDestinationGroupId, int flightId)
      Creates the origin destination group only for the flight/itinerary that has to be changed.
      Parameters:
      changeOriginDestinationGroupData - the change origin destination group data
      originDestinationGroupId - the origin destination group id
      flightId - the flight id
      Returns:
      the origin destination group
    • populateDepartureDates

      protected List<String> populateDepartureDates(List<String> departureDates)
      Populates the departure dates list.
      Parameters:
      departureDates - the departure dates
      Returns:
      the list
    • populateFlights

      protected List<RepricerFlight> populateFlights(List<SelectedFlightData> flights, int flightId)
      Populates the flights list.
      Parameters:
      flights - the flights
      flightId - the flight id
      Returns:
      the list
    • distinctByCode

      protected static <T> Predicate<T> distinctByCode(Function<? super T,?> codeExtractor)
      Filter used for filtering all the objects having duplicated code.
      Type Parameters:
      T - the type parameter
      Parameters:
      codeExtractor - the code extractor
      Returns:
      the predicate
    • getTransportOfferingService

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

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

      protected List<String> getNotAllowedStatusesForConsignmentEntries()
      Gets not allowed statuses for consignment entries.
      Returns:
      the not allowed statuses for consignment entries
    • setNotAllowedStatusesForConsignmentEntries

      public void setNotAllowedStatusesForConsignmentEntries(List<String> notAllowedStatusesForConsignmentEntries)
      Sets not allowed statuses for consignment entries.
      Parameters:
      notAllowedStatusesForConsignmentEntries - the not allowed statuses for consignment entries
    • getBookingService

      protected BookingService getBookingService()
      Gets booking service.
      Returns:
      the booking service
    • setBookingService

      public void setBookingService(BookingService bookingService)
      Sets booking service.
      Parameters:
      bookingService - the booking service
    • getShoppingRepricingService

      protected ShoppingRepricingService getShoppingRepricingService()
      Gets shopping repricing service.
      Returns:
      the shopping repricing service
    • setShoppingRepricingService

      public void setShoppingRepricingService(ShoppingRepricingService shoppingRepricingService)
      Sets shopping repricing service.
      Parameters:
      shoppingRepricingService - the shopping repricing service
    • getSearchResponseService

      protected SearchResponseService getSearchResponseService()
      Gets search response service.
      Returns:
      the search response service
    • setSearchResponseService

      public void setSearchResponseService(SearchResponseService searchResponseService)
      Sets search response service.
      Parameters:
      searchResponseService - the search response service