Exemple #1
0
        public TimeStampResponse CheckValidTimeStamp(ZoomUser zoomUser)
        {
            //This is the utility to check if meeting is requested in the given interval
            TimeStampResponse timeStampResponse = new TimeStampResponse();
            var eventDetail = _eventDetailRepository.GetAllByEventId(zoomUser.EventId).FirstOrDefault();

            var currentUtcDateTime = DateTime.UtcNow.AddMinutes(60); //early 10 min access

            if (eventDetail.StartDateTime <= currentUtcDateTime && eventDetail.EndDateTime >= DateTime.UtcNow)
            {
                timeStampResponse.IsValid = true;
            }
            else
            {
                if (currentUtcDateTime < eventDetail.EndDateTime)
                {
                    timeStampResponse.Message = Constant.Zoom.Message.MeetingNotStarted;
                }
                else
                {
                    timeStampResponse.Message = Constant.Zoom.Message.MeetingEnd;
                }

                timeStampResponse.IsValid = false;
            }
            return(timeStampResponse);
        }
 public Task <bool> AddZoomUser(string O365Upn, ZoomUser zoomUser)
 {
     userDictionary[O365Upn].ZoomUser            = zoomUser;
     ZoomIdUserDictionary[zoomUser.Id.ToLower()] = userDictionary[O365Upn];
     ZoomEmailUserDictionary[zoomUser.Email]     = userDictionary[O365Upn];
     return(Task.FromResult(true));
 }
Exemple #3
0
        private long GetTimeStamp(ZoomUser zoomUserModel)
        {
            long timeStamp   = 0;
            var  eventDetail = _eventDetailRepository.GetAllByEventId(zoomUserModel.EventId).FirstOrDefault();

            if (eventDetail.StartDateTime > DateTime.UtcNow)
            {
                var differenceTime = eventDetail.StartDateTime - DateTime.UtcNow;
                timeStamp = (differenceTime.Ticks - 621355968000000000) / 10000;
            }

            return(timeStamp);
        }
 public Task <bool> AddMemberToZoomChannel(string channelId, ZoomUser user)
 {
     if ("member".Equals(user.Role))
     {
         if (!channelIdToMemberDictionary.ContainsKey(channelId))
         {
             channelIdToMemberDictionary[channelId] = new HashSet <string>();
         }
         channelIdToMemberDictionary[channelId].Add(user.Id);
     }
     else if ("owner".Equals(user.Role))
     {
         if (!channelIdToOwnerDictionary.ContainsKey(channelId))
         {
             channelIdToOwnerDictionary[channelId] = new HashSet <string>();
         }
         channelIdToOwnerDictionary[channelId].Add(user.Id);
     }
     return(Task.FromResult(true));
 }
        public FeelOrderConfirmationQueryResult Handle(FeelOrderConfirmationQuery query)
        {
            var transaction = _transactionRepository.GetByAltId(query.TransactionAltId);

            if (transaction == null)
            {
                return(new FeelOrderConfirmationQueryResult
                {
                });
            }
            var orderConfirmation = _orderConfirmationProvider.Get(transaction.Id,
                                                                   query.confirmationFrmMyOrders,
                                                                   query.Channel);

            // Check if transaction is Tiqets One
            var tiqetsTransactions = _tiqetsTransactionRepository.GetByTransactionId(transaction.Id);

            //for live online events
            var IsLiveOnline                        = false;
            var zoomUserModel                       = new ZoomUser();
            var liveOnlineDetailModelData           = new LiveOnlineTransactionDetailResponseModel();
            List <ZoomHostUserModel> hostUsersModel = new List <ZoomHostUserModel>();
            var liveOnlineDetailModel               = _transactionRepository.GetFeelOnlineDetails(transaction.Id);

            if (liveOnlineDetailModel.Any() &&
                liveOnlineDetailModel.Count() == 1 &&
                (liveOnlineDetailModel.Select(s => s.TicketCategoryId).Contains(19452) || liveOnlineDetailModel.Select(s => s.TicketCategoryId).Contains(12259)))
            {
                liveOnlineDetailModelData = liveOnlineDetailModel.FirstOrDefault();
            }
            else
            {
                liveOnlineDetailModelData = liveOnlineDetailModel.Where(s => s.TransactionType == Contracts.Enums.TransactionType.LiveOnline).FirstOrDefault();
            }
            if (liveOnlineDetailModelData != null && liveOnlineDetailModelData.EventcategoryId != 0)
            {
                if (orderConfirmation.orderConfirmationSubContainer.Any(s => s.Event.MasterEventTypeId == Contracts.Enums.MasterEventType.Online))
                {
                    IsLiveOnline  = true;
                    zoomUserModel = _zoomUserRepository.GetByTransactionId(transaction.Id);
                    if (zoomUserModel != null)
                    {
                        var transactionCount = _transactionRepository.GetTransactionCountByEvent(liveOnlineDetailModelData.EventId);
                        if (transactionCount == 1)
                        {
                            var eventHostUsersModel = _eventHostMappingRepository.GetAllByEventId(liveOnlineDetailModelData.EventId);
                            var zoomHostUserModel   = _zoomUserRepository.GetByHostUserIds(eventHostUsersModel.Select(s => s.Id));
                            foreach (var currentZoomUser in zoomHostUserModel)
                            {
                                var currentHostUsersModel = new ZoomHostUserModel();
                                var currentEventHost      = eventHostUsersModel.Where(s => s.Id == currentZoomUser.EventHostUserId).FirstOrDefault();
                                currentHostUsersModel.altId = currentZoomUser.AltId;
                                currentHostUsersModel.email = currentEventHost.Email;
                                hostUsersModel.Add(currentHostUsersModel);
                            }
                        }
                    }
                }
            }

            return(new FeelOrderConfirmationQueryResult
            {
                Transaction = orderConfirmation.Transaction,
                TransactionPaymentDetail = orderConfirmation.TransactionPaymentDetail,
                UserCardDetail = orderConfirmation.UserCardDetail,
                CurrencyType = orderConfirmation.CurrencyType,
                PaymentOption = orderConfirmation.PaymentOption,
                cardTypes = orderConfirmation.cardTypes,
                orderConfirmationSubContainer = orderConfirmation.orderConfirmationSubContainer,
                IsTiqets = tiqetsTransactions != null ? true : false,
                IsHoho = orderConfirmation.IsHoho,
                ZoomUser = zoomUserModel,
                liveOnlineDetailModel = liveOnlineDetailModelData,
                hostUsersModel = hostUsersModel,
                IsLiveOnline = IsLiveOnline
            });
        }
        public OrderConfirmationQueryResult Handle(OrderConfirmationQuery query)
        {
            var orderConfirmation = _orderConfirmationProvider.Get(query.TransactionId, false, Contracts.Enums.Channels.Website);

            if (orderConfirmation != null)
            {
                if (orderConfirmation.orderConfirmationSubContainer[0].Event.AltId.ToString().ToUpper() == "1F0257FA-EEA6-4469-A7BC-B878A215C8A9")
                {
                    orderConfirmation.Transaction.CreatedUtc = orderConfirmation.Transaction.CreatedUtc.AddHours(10);
                }

                // Check if transaction is Tiqets One
                var tiqetsTransactions = _tiqetsTransactionRepository.GetByTransactionId(query.TransactionId);

                //for live online events
                var zoomUserModel = new ZoomUser();
                List <ZoomHostUserModel> hostUsersModel = new List <ZoomHostUserModel>();
                var liveOnlineDetailModel = _transactionRepository.GetFeelOnlineDetails(query.TransactionId).FirstOrDefault();
                if (liveOnlineDetailModel != null)
                {
                    //check if subcategory is LiveOnline
                    var eventModel = _eventRepository.Get(liveOnlineDetailModel.EventId);
                    if (eventModel.EventCategoryId == 119)
                    {
                        zoomUserModel = _zoomUserRepository.GetByTransactionId(query.TransactionId);

                        var transactionCount = _transactionRepository.GetTransactionCountByEvent(liveOnlineDetailModel.EventId);
                        if (transactionCount == 1)
                        {
                            var eventHostUsersModel = _eventHostMappingRepository.GetAllByEventId(liveOnlineDetailModel.EventId);
                            var zoomHostUserModel   = _zoomUserRepository.GetByHostUserIds(eventHostUsersModel.Select(s => s.Id));
                            foreach (var currentZoomUser in zoomHostUserModel)
                            {
                                var currentHostUsersModel = new ZoomHostUserModel();
                                var currentEventHost      = eventHostUsersModel.Where(s => s.Id == currentZoomUser.EventHostUserId).FirstOrDefault();
                                currentHostUsersModel.altId = currentZoomUser.AltId;
                                currentHostUsersModel.email = currentEventHost.Email;
                                hostUsersModel.Add(currentHostUsersModel);
                            }
                        }
                    }
                }
                return(new OrderConfirmationQueryResult
                {
                    Transaction = orderConfirmation.Transaction,
                    TransactionPaymentDetail = orderConfirmation.TransactionPaymentDetail,
                    UserCardDetail = orderConfirmation.UserCardDetail,
                    CurrencyType = orderConfirmation.CurrencyType,
                    PaymentOption = orderConfirmation.PaymentOption,
                    cardTypes = orderConfirmation.cardTypes,
                    orderConfirmationSubContainer = orderConfirmation.orderConfirmationSubContainer,
                    TicketQuantity = orderConfirmation.TicketQuantity,
                    GoodsAndServiceTax = orderConfirmation.GoodsAndServiceTax,
                    IsASI = orderConfirmation.IsASI,
                    IsTiqets = tiqetsTransactions != null ? true : false,
                    liveOnlineDetailModel = liveOnlineDetailModel,
                    ZoomUser = zoomUserModel,
                    hostUsersModel = hostUsersModel
                });
            }
            else
            {
                return(new OrderConfirmationQueryResult
                {
                    Transaction = null,
                    TransactionPaymentDetail = null,
                    UserCardDetail = null,
                    CurrencyType = null,
                    PaymentOption = null,
                    cardTypes = null,
                    orderConfirmationSubContainer = null,
                    IsASI = false,
                    IsTiqets = false
                });
            }
        }