private async Task <bool> IsBookingAccepted(string bookingReferenceCode, BookingStatusCodes status) { var key = _flow.BuildKey(CacheKeyPrefix, bookingReferenceCode, status.ToString()); var acceptedReferenceCode = await _flow.GetAsync <string>(key); return(!string.IsNullOrWhiteSpace(acceptedReferenceCode)); }
public static BookingStatuses ToInternalStatus(this BookingStatusCodes code) { switch (code) { case BookingStatusCodes.InternalProcessing: return(BookingStatuses.InternalProcessing); case BookingStatusCodes.WaitingForResponse: return(BookingStatuses.Pending); case BookingStatusCodes.Pending: return(BookingStatuses.Pending); case BookingStatusCodes.Confirmed: return(BookingStatuses.Confirmed); case BookingStatusCodes.Cancelled: return(BookingStatuses.Cancelled); case BookingStatusCodes.Rejected: return(BookingStatuses.Rejected); case BookingStatusCodes.Invalid: return(BookingStatuses.Invalid); default: throw new ArgumentException($"Invalid '{nameof(code)}': '{code}'"); } }
public static BookingStatuses ToInternalStatus(this BookingStatusCodes code) { return(code switch { BookingStatusCodes.InternalProcessing => BookingStatuses.WaitingForResponse, BookingStatusCodes.WaitingForResponse => BookingStatuses.Pending, BookingStatusCodes.Pending => BookingStatuses.Pending, BookingStatusCodes.Confirmed => BookingStatuses.Confirmed, BookingStatusCodes.Cancelled => BookingStatuses.Cancelled, BookingStatusCodes.Rejected => BookingStatuses.Rejected, BookingStatusCodes.Invalid => BookingStatuses.Invalid, _ => throw new ArgumentException($"Invalid '{nameof(code)}': '{code}'") });
public Booking(string referenceCode, BookingStatusCodes status, string accommodationId, string supplierReferenceCode, in DateTime checkInDate, in DateTime checkOutDate, List <SlimRoomOccupation> rooms, BookingUpdateModes bookingUpdateMode)