public ConferenceBuilder WithParticipants(int numberOfParticipants)
        {
            var participants = new Builder(_builderSettings).CreateListOfSize <Participant>(numberOfParticipants).All()
                               .WithFactory(() =>
                                            new Participant(Guid.NewGuid(), Name.FullName(), Name.First(), Name.Last(), Name.FullName(),
                                                            $"Video_Api_Integration_Test_{Internet.Email()}", UserRole.Individual, "Litigant in person", "Claimant", $"Video_Api_Integration_Test_{Internet.Email()}",
                                                            Phone.Number())).Build();

            foreach (var participant in participants)
            {
                _conference.AddParticipant(participant);
            }

            return(this);
        }
Beispiel #2
0
        public ConferenceBuilder WithParticipants(int numberOfParticipants)
        {
            var participants = new Builder(_builderSettings).CreateListOfSize <Participant>(numberOfParticipants).All()
                               .WithFactory(() =>
                                            new Participant(Guid.NewGuid(), Name.FullName(), Name.First(), Name.Last(), Name.FullName(),
                                                            $"Video_Api_Integration_Test_{RandomNumber.Next()}@hmcts.net", UserRole.Individual, "Litigant in person", "Applicant", $"Video_Api_Integration_Test_{RandomNumber.Next()}@hmcts.net",
                                                            Phone.Number()))
                               .All().With(x => x.CurrentConsultationRoomId = null)
                               .Build();

            foreach (var participant in participants)
            {
                _conference.AddParticipant(participant);
            }

            return(this);
        }
Beispiel #3
0
        public async Task Handle(CreateConferenceCommand command)
        {
            var conference = new Conference(command.HearingRefId, command.CaseType, command.ScheduledDateTime,
                                            command.CaseNumber, command.CaseName, command.ScheduledDuration, command.HearingVenueName, command.AudioRecordingRequired, command.IngestUrl);

            foreach (var participant in command.Participants)
            {
                conference.AddParticipant(participant);
            }

            foreach (var endpoint in command.Endpoints)
            {
                conference.AddEndpoint(endpoint);
            }

            _context.Conferences.Add(conference);

            await _context.SaveChangesAsync();

            command.NewConferenceId = conference.Id;
        }
        public async Task Handle(CreateConferenceCommand command)
        {
            var conference = new Conference(command.HearingRefId, command.CaseType, command.ScheduledDateTime,
                                            command.CaseNumber, command.CaseName, command.ScheduledDuration, command.HearingVenueName, command.AudioRecordingRequired, command.IngestUrl);

            foreach (var participant in command.Participants)
            {
                conference.AddParticipant(participant);
            }

            foreach (var linkedParticipant in command.LinkedParticipants)
            {
                try
                {
                    var primaryParticipant =
                        conference.Participants.Single(x => x.ParticipantRefId == linkedParticipant.ParticipantRefId);

                    var secondaryParticipant =
                        conference.Participants.Single(x => x.ParticipantRefId == linkedParticipant.LinkedRefId);

                    primaryParticipant.AddLink(secondaryParticipant.Id, linkedParticipant.Type);
                }
                catch (Exception)
                {
                    throw new ParticipantLinkException(linkedParticipant.ParticipantRefId, linkedParticipant.LinkedRefId);
                }
            }

            foreach (var endpoint in command.Endpoints)
            {
                conference.AddEndpoint(endpoint);
            }

            _context.Conferences.Add(conference);

            await _context.SaveChangesAsync();

            command.NewConferenceId = conference.Id;
        }