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));
        }
示例#2
0
        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}'");
            }
        }
示例#3
0
 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}'")
     });
示例#4
0
 public Booking(string referenceCode, BookingStatusCodes status, string accommodationId, string supplierReferenceCode,
                in DateTime checkInDate, in DateTime checkOutDate, List <SlimRoomOccupation> rooms, BookingUpdateModes bookingUpdateMode)