public static ConferenceResponse MapConferenceDetailsToResponseModel(ConferenceDetailsResponse conference)
        {
            var response = new ConferenceResponse
            {
                Id                     = conference.Id,
                CaseName               = conference.Case_name,
                CaseNumber             = conference.Case_number,
                CaseType               = conference.Case_type,
                ScheduledDateTime      = conference.Scheduled_date_time,
                ScheduledDuration      = conference.Scheduled_duration,
                Status                 = GetStatus(conference.Current_status),
                Participants           = MapParticipants(conference),
                ClosedDateTime         = conference.Closed_date_time,
                HearingVenueName       = conference.Hearing_venue_name,
                AudioRecordingRequired = conference.Audio_recording_required,
                HearingRefId           = conference.Hearing_id,
                Endpoints              = MapEndpoints(conference)
            };

            if (conference.Meeting_room != null)
            {
                response.ParticipantUri       = conference.Meeting_room.Participant_uri;
                response.PexipNodeUri         = conference.Meeting_room.Pexip_node;
                response.PexipSelfTestNodeUri = conference.Meeting_room.Pexip_self_test_node;

                ParticipantTilePositionHelper.AssignTilePositions(response.Participants);
            }

            return(response);
        }
예제 #2
0
        public List <ParticipantForUserResponse> Map(IEnumerable <ParticipantSummaryResponse> participants)
        {
            var mappedParticipants = participants.Select(participant => new ParticipantForUserResponse
            {
                Id                 = participant.Id,
                DisplayName        = participant.DisplayName,
                Status             = Enum.Parse <ParticipantStatus>(participant.Status.ToString()),
                Role               = Enum.Parse <Role>(participant.UserRole.ToString()),
                Representee        = string.IsNullOrWhiteSpace(participant.Representee) ? null : participant.Representee,
                CaseTypeGroup      = participant.CaseGroup,
                FirstName          = participant.FirstName,
                LastName           = participant.LastName,
                HearingRole        = participant.HearingRole,
                CurrentRoom        = _roomResponseMapper.Map(participant.CurrentRoom),
                InterpreterRoom    = _roomResponseMapper.Map(participant.CurrentInterpreterRoom),
                LinkedParticipants = participant.LinkedParticipants.Select(x =>
                                                                           new Contract.Responses.LinkedParticipantResponse
                {
                    LinkedId = x.LinkedId,
                    LinkType = Enum.Parse <LinkType>(x.Type.ToString(), true)
                }).ToList()
            })
                                     .ToList();

            ParticipantTilePositionHelper.AssignTilePositions(mappedParticipants);

            return(mappedParticipants);
        }
        public ConferenceResponse Map(ConferenceDetailsResponse conference)
        {
            var response = new ConferenceResponse
            {
                Id                     = conference.Id,
                CaseName               = conference.CaseName,
                CaseNumber             = conference.CaseNumber,
                CaseType               = conference.CaseType,
                ScheduledDateTime      = conference.ScheduledDateTime,
                ScheduledDuration      = conference.ScheduledDuration,
                Status                 = ConferenceHelper.GetConferenceStatus(conference.CurrentStatus),
                Participants           = MapParticipants(conference),
                ClosedDateTime         = conference.ClosedDateTime,
                HearingVenueName       = conference.HearingVenueName,
                AudioRecordingRequired = conference.AudioRecordingRequired,
                HearingRefId           = conference.HearingId,
                Endpoints              = MapEndpoints(conference)
            };

            if (conference.MeetingRoom != null)
            {
                response.ParticipantUri       = conference.MeetingRoom.ParticipantUri;
                response.PexipNodeUri         = conference.MeetingRoom.PexipNode;
                response.PexipSelfTestNodeUri = conference.MeetingRoom.PexipSelfTestNode;

                ParticipantTilePositionHelper.AssignTilePositions(response.Participants);
            }

            return(response);
        }
예제 #4
0
        public void Should_set_tailed_display_names_for_non_judge_participants_number_participant()
        {
            var participants = GetParticipantResponses();

            ParticipantTilePositionHelper.AssignTilePositions(participants);


            participants[0].TiledDisplayName.Should().Contain("JUDGE;");
            participants[1].TiledDisplayName.Should().Contain("CIVILIAN;");
            participants[2].TiledDisplayName.Should().Contain("CIVILIAN;");
            participants[3].TiledDisplayName.Should().Contain("CIVILIAN;");
            participants[4].TiledDisplayName.Should().Contain("CIVILIAN;");
            participants[5].TiledDisplayName.Should().Contain("CIVILIAN;");
            participants[6].TiledDisplayName.Should().Contain("WITNESS;");
            participants[7].TiledDisplayName.Should().Contain("CIVILIAN;");
        }
예제 #5
0
        public static List <ParticipantForUserResponse> MapParticipants(IEnumerable <ParticipantSummaryResponse> participants)
        {
            var mappedParticipants = participants.Select(participant => new ParticipantForUserResponse
            {
                Id            = participant.Id,
                Username      = participant.Username,
                DisplayName   = participant.Display_name,
                Status        = Enum.Parse <ParticipantStatus>(participant.Status.ToString()),
                Role          = Enum.Parse <Role>(participant.User_role.ToString()),
                Representee   = string.IsNullOrWhiteSpace(participant.Representee) ? null : participant.Representee,
                CaseTypeGroup = participant.Case_group,
                FirstName     = participant.First_name,
                LastName      = participant.Last_name,
                HearingRole   = participant.Hearing_role
            })
                                     .ToList();

            ParticipantTilePositionHelper.AssignTilePositions(mappedParticipants);

            return(mappedParticipants);
        }