public Booking Retrieve(RetrieveBookingRequest request)
        {
            var booking = this._distributedCache.Get <Booking>($"ConfirmedBooking_{request.RecordLocator}");

            if (booking == null ||
                (booking.Contacts.All(contact =>
                                      !contact.Channels.Any(channel =>
                                                            channel.Type == ChannelType.Email && channel.Info == request.ContactEmail)) &&
                 booking.Pax.All(pax =>
                                 pax.Name.Last != request.PaxSurname)))
            {
                throw new BookingNotFoundException();
            }

            this._sessionStorage.Add("DomainBooking", booking);
            this._sessionStorage.Add("DomainPayments", booking.Payments);
            this._sessionStorage.Add("DomainContacts", booking.Contacts);
            this._sessionStorage.Add("DomainServices", booking.Services);

            return(booking);
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> Get([FromRoute] RetrieveBookingRequest retrieveBookingRequest)
 {
     return(new OkObjectResult(await _bookingService.RetrieveBooking(retrieveBookingRequest)));
 }