public async Task HandleAsync(ParticipantUpdatedIntegrationEvent eventMessage)
        {
            var conferenceResponse = await _videoApiService.GetConferenceByHearingRefId(eventMessage.HearingId, true);

            var participantResponse = conferenceResponse.Participants.SingleOrDefault(x => x.RefId == eventMessage.Participant.ParticipantId);

            if (participantResponse != null)
            {
                _logger.LogError("Unable to find participant by ref id {ParticipantRefId} in {ConferenceId}", eventMessage.Participant.ParticipantId, conferenceResponse.Id);
                var request = ParticipantToUpdateParticipantMapper.MapToParticipantRequest(eventMessage.Participant);
                await _videoApiService.UpdateParticipantDetails(conferenceResponse.Id, participantResponse.Id, request);
            }
        }
Пример #2
0
        public void should_map_participant_dto_to_participant_request()
        {
            var participantDto = CreateParticipantDto();

            var request = ParticipantToUpdateParticipantMapper.MapToParticipantRequest(participantDto);

            request.Should().NotBeNull();
            request.Fullname.Should().Be(participantDto.Fullname);
            request.FirstName.Should().Be(participantDto.FirstName);
            request.LastName.Should().Be(participantDto.LastName);
            request.ContactEmail.Should().Be(participantDto.ContactEmail);
            request.ContactTelephone.Should().Be(participantDto.ContactTelephone);
            request.Representee.Should().Be(participantDto.Representee);
            request.DisplayName.Should().Be(participantDto.DisplayName);
            request.Username.Should().Be(participantDto.Username);
            request.LinkedParticipants.Should().BeEquivalentTo(new List <LinkedParticipantRequest>());
        }
Пример #3
0
        public async Task HandleAsync(HearingParticipantsUpdatedIntegrationEvent eventMessage)
        {
            var conferenceResponse = await _videoApiService.GetConferenceByHearingRefId(eventMessage.HearingId, true);

            var updateConferenceParticipantsRequest = new UpdateConferenceParticipantsRequest
            {
                ExistingParticipants =
                    eventMessage.ExistingParticipants.Select(x => ParticipantToUpdateParticipantMapper.MapToParticipantRequest(x)).ToList(),
                NewParticipants =
                    eventMessage.NewParticipants.Select(x => ParticipantToParticipantRequestMapper.MapToParticipantRequest(x)).ToList(),
                RemovedParticipants = eventMessage.RemovedParticipants,
                LinkedParticipants  =
                    eventMessage.LinkedParticipants.Select(x => LinkedParticipantToRequestMapper.MapToLinkedParticipantRequest(x)).ToList(),
            };

            await _videoApiService.UpdateConferenceParticipantsAsync(conferenceResponse.Id, updateConferenceParticipantsRequest);

            await _videoWebService.PushParticipantsUpdatedMessage(conferenceResponse.Id, updateConferenceParticipantsRequest);
        }
Пример #4
0
        public void should_map_participant_dto_with_linked_participant_to_participant_request()
        {
            var participantDto = CreateParticipantDtoWithLinkedParticipants();

            var request = ParticipantToUpdateParticipantMapper.MapToParticipantRequest(participantDto);

            request.Should().NotBeNull();
            request.Fullname.Should().Be(participantDto.Fullname);
            request.FirstName.Should().Be(participantDto.FirstName);
            request.LastName.Should().Be(participantDto.LastName);
            request.ContactEmail.Should().Be(participantDto.ContactEmail);
            request.ContactTelephone.Should().Be(participantDto.ContactTelephone);
            request.Representee.Should().Be(participantDto.Representee);
            request.DisplayName.Should().Be(participantDto.DisplayName);
            request.Username.Should().Be(participantDto.Username);
            var linkedParticipant = request.LinkedParticipants.First();

            linkedParticipant.Type.Should().Be(LinkedParticipantType.Interpreter);
            linkedParticipant.LinkedRefId.Should().Be(participantDto.LinkedParticipants[0].LinkedId);
            linkedParticipant.ParticipantRefId.Should().Be(participantDto.LinkedParticipants[0].ParticipantId);
        }