public static ParticipantSummaryResponse MapParticipantToSummary(Participant participant, ParticipantRoom participantRoom = null) { var interpreterRoomMapped = participantRoom == null ? null : RoomToDetailsResponseMapper.MapConsultationRoomToResponse(participantRoom); var participantStatus = participant.GetCurrentStatus() != null ? participant.GetCurrentStatus().ParticipantState : ParticipantState.None; var caseGroup = participant.CaseTypeGroup ?? string.Empty; var links = participant.LinkedParticipants.Select(LinkedParticipantToResponseMapper.MapLinkedParticipantsToResponse) .ToList(); return(new ParticipantSummaryResponse { Id = participant.Id, Username = participant.Username, DisplayName = participant.DisplayName, Status = participantStatus.MapToContractEnum(), UserRole = participant.UserRole.MapToContractEnum(), HearingRole = participant.HearingRole, Representee = participant.Representee, CaseGroup = caseGroup, FirstName = participant.FirstName, LastName = participant.LastName, ContactEmail = participant.ContactEmail, ContactTelephone = participant.ContactTelephone, CurrentRoom = RoomToDetailsResponseMapper.MapConsultationRoomToResponse(participant.CurrentConsultationRoom), LinkedParticipants = links, CurrentInterpreterRoom = interpreterRoomMapped }); }
public static ParticipantDetailsResponse MapParticipantToResponse(Participant participant, ParticipantRoom participantRoom = null) { var participantRoomMapped = participantRoom == null ? null : RoomToDetailsResponseMapper.MapConsultationRoomToResponse(participantRoom); return(new ParticipantDetailsResponse { Id = participant.Id, RefId = participant.ParticipantRefId, Name = participant.Name, FirstName = participant.FirstName, LastName = participant.LastName, Username = participant.Username, DisplayName = participant.DisplayName, UserRole = participant.UserRole.MapToContractEnum(), HearingRole = participant.HearingRole, CaseTypeGroup = participant.CaseTypeGroup, Representee = participant.Representee, CurrentStatus = participant.State.MapToContractEnum(), ContactEmail = participant.ContactEmail, ContactTelephone = participant.ContactTelephone, LinkedParticipants = participant.LinkedParticipants .Select(LinkedParticipantToResponseMapper.MapLinkedParticipantsToResponse).ToList(), CurrentRoom = RoomToDetailsResponseMapper.MapConsultationRoomToResponse(participant.CurrentConsultationRoom), CurrentInterpreterRoom = participantRoomMapped }); }
public static EndpointResponse MapEndpointResponse(Endpoint endpoint) { return(new EndpointResponse { Id = endpoint.Id, Pin = endpoint.Pin, Status = endpoint.State.MapToContractEnum(), DisplayName = endpoint.DisplayName, SipAddress = endpoint.SipAddress, DefenceAdvocate = endpoint.DefenceAdvocate, CurrentRoom = RoomToDetailsResponseMapper.MapConsultationRoomToResponse(endpoint.CurrentConsultationRoom) }); }