8 #include <stdair/bom/BomKeyManager.hpp>
9 #include <stdair/bom/BookingClassKey.hpp>
10 #include <stdair/bom/BookingRequestStruct.hpp>
11 #include <stdair/bom/TravelSolutionStruct.hpp>
12 #include <stdair/bom/FareOptionStruct.hpp>
13 #include <stdair/service/Logger.hpp>
22 const stdair::BookingRequestStruct& iBookingRequest) {
23 stdair::TravelSolutionStruct* oChosenTS_ptr = NULL;
26 const stdair::NbOfSeats_T& lPartySize = iBookingRequest.getPartySize();
29 const stdair::WTP_T& lWTP = iBookingRequest.getWTP();
32 stdair::Fare_T lLowestFare = std::numeric_limits<stdair::Fare_T>::max();
33 for (stdair::TravelSolutionList_T::iterator itTS = ioTSList.begin();
34 itTS != ioTSList.end(); ++itTS) {
35 stdair::TravelSolutionStruct& lTS = *itTS;
38 const stdair::FareOptionList_T& lFOList = lTS.getFareOptionList();
39 for (stdair::FareOptionList_T::const_iterator itFO = lFOList.begin();
40 itFO != lFOList.end(); ++itFO) {
41 const stdair::FareOptionStruct& lFO = *itFO;
45 bool lHardRestrictionsSatisfied =
true;
46 if (lFO.getChangeFees() ==
true
47 && iBookingRequest.getChangeFees() ==
false) {
48 lHardRestrictionsSatisfied =
false;
49 }
else if (lFO.getNonRefundable() ==
true
50 && iBookingRequest.getNonRefundable() ==
false) {
51 lHardRestrictionsSatisfied =
false;
54 if (lHardRestrictionsSatisfied ==
true) {
57 const stdair::Fare_T& lFOFare = lFO.getFare();
58 const stdair::Availability_T& lFOAvl = lFO.getAvailability();
60 if (lFOFare < lLowestFare && lFOFare <= lWTP
61 && lFOAvl >= lPartySize) {
74 lLowestFare = lFOFare;
76 oChosenTS_ptr->setChosenFareOption (lFO);