/// <summary> /// Adds new booking details data to the log table /// </summary> /// <param name="newBookingDetails">Booking details that will be written to the booking table</param> /// <param name="currentBookingData">Current booking data from the booking table where BookingDetails value will be rewritten by the newBookingDetails value</param> /// <returns></returns> public async Task Add(Booking newBookingDetails, Data.Bookings.Booking currentBookingData = null) { if (currentBookingData is null) { currentBookingData = await _edoContext.Bookings.SingleOrDefaultAsync(i => i.ReferenceCode.Equals(newBookingDetails.ReferenceCode)); } await Add(currentBookingData.Id, currentBookingData.AgentId, newBookingDetails); }
private async Task ProcessBookingNotFound(Data.Bookings.Booking booking, Booking bookingResponse, BookingChangeEvents eventType) { // If booking was confirmed or if (_dateTimeProvider.UtcNow() < booking.Created + BookingCheckTimeout && booking.Status != BookingStatuses.Confirmed) { _logger.LogBookingResponseProcessSuccess(bookingResponse.ReferenceCode, $"Has not been processed due to '{BookingStatusCodes.NotFound}' status."); } else { await _recordsUpdater.ChangeStatus(booking, BookingStatuses.ManualCorrectionNeeded, _dateTimeProvider.UtcNow(), ApiCaller.InternalServiceAccount, new Data.Bookings.BookingChangeReason { Source = BookingChangeSources.System, Event = eventType }); _logger.LogBookingResponseProcessSuccess(bookingResponse.ReferenceCode, "Set as needed manual processing."); } }