Пример #1
0
        public async Task <ActionResult> Checkin([FromBody] CheckinViewModel model)
        {
            var flight = await _flightRepository.GetAsync(model.FlightId);

            var passenger = new Passenger(model.PassengerName, flight);


            model.Baggages.ForEach(b => {
                passenger.AddBaggage(b.Label, b.Weight);
            });

            var validationResponse = await _bookingService.ValidateAndEndBookingSessionAsync(model.FlightId, model.BookingSessionId);

            _passengerRepository.Add(passenger);

            await _passengerRepository.UnitOfWork.SaveChangesAsync();

            return(Ok());
        }
Пример #2
0
 public PassengerBuilder AddOne(string label, int weight)
 {
     passenger.AddBaggage(label, weight);
     return(this);
 }