public PassengerFlightLogistics Process(PassengerProcessorContext passengerProcessorContext)
 {
     return(new PassengerFlightLogistics()
     {
         ExpectedBaggage = passengerProcessorContext.Passenger.AllowedBags
     });
 }
 public PassengerFlightLogistics Process(PassengerProcessorContext passengerProcessorContext)
 {
     return(new PassengerFlightLogistics()
     {
         ProfitFromFlight = passengerProcessorContext.FlightRoute.BasePrice,
         ExpectedBaggage = passengerProcessorContext.Passenger.AllowedBags
     });
 }
예제 #3
0
        public PassengerFlightLogistics Process(PassengerProcessorContext passengerProcessorContext)
        {
            var result = new PassengerFlightLogistics()
            {
                ExpectedBaggage = passengerProcessorContext.Passenger.AllowedBags
            };

            if (passengerProcessorContext.Passenger.IsUsingLoyaltyPoints)
            {
                var loyaltyPointsRedeemed = Convert.ToInt32(Math.Ceiling(passengerProcessorContext.FlightRoute.BasePrice));

                passengerProcessorContext.Passenger.LoyaltyPoints -= loyaltyPointsRedeemed;

                result.LoyaltyPointsRedeemed = loyaltyPointsRedeemed;
            }
            else
            {
                result.LoyaltyPointsAccrued = passengerProcessorContext.FlightRoute.LoyaltyPointsGained;

                result.ProfitFromFlight += passengerProcessorContext.FlightRoute.BasePrice;
            }

            return(result);
        }