public async Task UpdateMeeting(CxMeetingModel meeting)
 {
     await this.dbContext.Meetings.UpdateAsync(m => m.Id == meeting.Id,
                                               new UpdateDefinitionBuilder <CxMeeting>()
                                               .Set(x => x.Title, meeting.Title)
                                               .Set(x => x.Description, meeting.Description)
                                               .Set(x => x.StartTime, meeting.StartTime)
                                               .Set(x => x.Duration, meeting.Duration)
                                               );
 }
        public Task CreateMeeting(CxMeetingModel meeting)
        {
            if (meeting.Attendees.All(x => x.UserId != meeting.OwnerId))
            {
                meeting.Attendees.Add(new CxMeetingAttendeeModel()
                {
                    UserId = meeting.OwnerId, Role = EnOvSessionRole.MODERATOR
                });
            }

            return(dbContext.Meetings.AddAsync(meeting.ToDbModel()));
        }
        public async Task Generate()
        {
            var user = await userBop.GetByEmail(forUser);

            var attendee = await userBop.GetByEmail(forAttendee);

            var meeting = new CxMeetingModel()
            {
                Id          = "",
                Title       = "Test Meeting",
                Description = "This meeting was created in DBGenerator",
                StartTime   = DateTime.UtcNow.AddHours(3),
                Duration    = 60,
                OwnerId     = user.Id,
                IsPublic    = true,
                Attendees   = new List <CxMeetingAttendeeModel>()
                {
                    new CxMeetingAttendeeModel()
                    {
                        UserId = attendee.Id,
                        Role   = EnOvSessionRole.PUBLISHER
                    }
                }
            };

            await meetingBop.CreateMeeting(meeting);

            meeting = new CxMeetingModel()
            {
                Id          = "",
                Title       = "Private Test Meeting",
                Description = "This meeting was created in DBGenerator",
                StartTime   = DateTime.UtcNow.AddHours(5),
                Duration    = 60,
                OwnerId     = user.Id,
                IsPublic    = false,
                Attendees   = new List <CxMeetingAttendeeModel>()
                {
                    new CxMeetingAttendeeModel()
                    {
                        UserId = attendee.Id,
                        Role   = EnOvSessionRole.PUBLISHER
                    }
                }
            };

            await meetingBop.CreateMeeting(meeting);

            this.logger.Log(LogLevel.Information, "Meetings are created");
        }
Beispiel #4
0
        public MeetingDto(CxMeetingModel model, CxUserModel currentUser)
        {
            this.Id          = model.Id;
            this.Title       = model.Title;
            this.Description = model.Description;
            this.StartTime   = model.StartTime;
            this.Duration    = model.Duration;
            this.IsPublic    = model.IsPublic;
            this.IsArchived  = model.IsArchived;

            this.IsOwner             = model.OwnerId == currentUser.Id;
            this.IsAttendee          = model.Attendees.Any(a => a.UserId == currentUser.Id);
            this.IsAttendeeRequested = model.AttendeeRequests.Any(a => a.UserId == currentUser.Id);

            this.IsStarted = !string.IsNullOrEmpty(model.SessionId);
        }