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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected OriginDestinationGroupcreateOriginDestinationGroup(ChangeOriginDestinationGroupData changeOriginDestinationGroupData, int originDestinationGroupId, int flightId) Creates the origin destination group only for the flight/itinerary that has to be changed.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.protected List<OriginDestinationGroup>createOriginDestinationGroupsFromTransportOfferings(List<TransportOfferingModel> transportOfferings, int originDestinationGroupId, AbstractOrderModel previousOrder, int flightId) Create origin destination group from transport offerings not changed list.createPaxRBDs(List<PaxRBD> paxRBDs) Creates the pax rbd list from repricing response list.protected static <T> Predicate<T>distinctByCode(Function<? super T, ?> codeExtractor) Filter used for filtering all the objects having duplicated code.protected BookingServiceGets booking service.protected List<AbstractOrderEntryModel>getEntriesWithValidConsignments(AbstractOrderModel orderModel) Gets all the entries that have the consignment in the allowed status for an amendment.protected AbstractOrderModelRetrieves the first original order having either a repricer response or an intelliPricer response not null.Gets not allowed statuses for consignment entries.protected SearchResponseServiceGets search response service.protected ShoppingRepricingServiceGets shopping repricing service.protected List<AbstractOrderEntryModel>getTransportEntriesForTraveller(List<AbstractOrderEntryModel> entries, Integer solutionId, List<String> passengers) Gets transport entries for traveller.protected TransportOfferingServiceGets transport offering service.voidhandle(AbstractOrderModel order, RepricingRequestData repricingRequestData, RepricerRequest repricerRequest) PopulatesRepricerRequestusing data from order and repricing request data.populateDepartureDates(List<String> departureDates) Populates the departure dates list.protected voidpopulateFlightMapByNumber(BookingSolution bookingSolution, Map<String, RepricerFlight> flightNumberRepricerFlightMap, Map<Integer, RepricerFlight> searchResponseFlightIdNumbersMap) Populate flight number repricer flight map from booking solution.protected voidpopulateFlightMapByNumber(Map<String, RepricerFlight> flightNumberRepricerFlightMap, RepricerResponseMessage prosRepricerResponseMessage, List<TransportOfferingModel> transportOfferings) Populate flight number repricer flight map from repricing response.protected voidpopulateFlightMapByNumber(Map<String, RepricerFlight> flightNumberRepricerFlightMap, PROSSearchResponse prosSearchResponse, List<TransportOfferingModel> transportOfferings) Populate flight number repricer flight map from search response.protected List<RepricerFlight>populateFlights(List<SelectedFlightData> flights, int flightId) Populates the flights list.voidsetBookingService(BookingService bookingService) Sets booking service.voidsetNotAllowedStatusesForConsignmentEntries(List<String> notAllowedStatusesForConsignmentEntries) Sets not allowed statuses for consignment entries.voidsetSearchResponseService(SearchResponseService searchResponseService) Sets search response service.voidsetShoppingRepricingService(ShoppingRepricingService shoppingRepricingService) Sets shopping repricing service.voidsetTransportOfferingService(TransportOfferingService transportOfferingService) Sets transport offering service.
-
Constructor Details
-
NewTicketItineraryRepricerRequestPopulationHandler
public NewTicketItineraryRepricerRequestPopulationHandler()
-
-
Method Details
-
handle
public void handle(AbstractOrderModel order, RepricingRequestData repricingRequestData, RepricerRequest repricerRequest) throws RepricingException Description copied from interface:RepricerRequestPopulationHandlerPopulatesRepricerRequestusing data from order and repricing request data.- Specified by:
handlein interfaceRepricerRequestPopulationHandler- Parameters:
order- the orderrepricingRequestData- the repricing request datarepricerRequest- 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 entriessolutionId- the solution idpassengers- 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
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 datatransportOfferingsNotChanged- the transport offerings not changedoriginDestinationGroupId- the origin destination group idpreviousOrder- the previous orderflightId-- 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 changedoriginDestinationGroupId- the origin destination group idpreviousOrder- the previous orderflightId- 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 ampprosRepricerResponseMessage- the pros repricer response messagetransportOfferings- the transport offerings
-
createPaxRBDs
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 mapprosSearchResponse- the pros search responsetransportOfferings- 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 solutionflightNumberRepricerFlightMap- the flight number repricer flight mapsearchResponseFlightIdNumbersMap- 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 dataoriginDestinationGroupId- the origin destination group idflightId- the flight id- Returns:
- the origin destination group
-
populateDepartureDates
Populates the departure dates list.- Parameters:
departureDates- the departure dates- Returns:
- the list
-
populateFlights
Populates the flights list.- Parameters:
flights- the flightsflightId- the flight id- Returns:
- the list
-
distinctByCode
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
Gets transport offering service.- Returns:
- the transport offering service
-
setTransportOfferingService
Sets transport offering service.- Parameters:
transportOfferingService- the transport offering service
-
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
Gets booking service.- Returns:
- the booking service
-
setBookingService
Sets booking service.- Parameters:
bookingService- the booking service
-
getShoppingRepricingService
Gets shopping repricing service.- Returns:
- the shopping repricing service
-
setShoppingRepricingService
Sets shopping repricing service.- Parameters:
shoppingRepricingService- the shopping repricing service
-
getSearchResponseService
Gets search response service.- Returns:
- the search response service
-
setSearchResponseService
Sets search response service.- Parameters:
searchResponseService- the search response service
-