diff --git a/VideoAPI/Video.API/Controllers/ConsultationController.cs b/VideoAPI/Video.API/Controllers/ConsultationController.cs index 225c3d128..600c304ab 100644 --- a/VideoAPI/Video.API/Controllers/ConsultationController.cs +++ b/VideoAPI/Video.API/Controllers/ConsultationController.cs @@ -190,6 +190,9 @@ public async Task RespondToAdminConsultationRequest(AdminConsulta { await _videoPlatformService.TransferParticipantAsync(conference.Id, participant.Id, participant.CurrentRoom.Value, request.ConsultationRoom); + await _hubContext.Clients.Group(participant.Username.ToLowerInvariant()).AdminConsultationMessage + (conference.Id, request.ConsultationRoom, participant.Username.ToLowerInvariant(), + ConsultationAnswer.Accepted); } return NoContent(); diff --git a/VideoAPI/VideoApi.Events/Hub/EventHubClient.cs b/VideoAPI/VideoApi.Events/Hub/EventHubClient.cs index 9d6d899c2..b0113ca9a 100644 --- a/VideoAPI/VideoApi.Events/Hub/EventHubClient.cs +++ b/VideoAPI/VideoApi.Events/Hub/EventHubClient.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; +using VideoApi.Contract.Requests; using VideoApi.Domain.Enums; using VideoApi.Services; @@ -12,7 +13,9 @@ public interface IEventHubClient Task ParticipantStatusMessage(string email, ParticipantState participantState); Task ConferenceStatusMessage(Guid conferenceId, ConferenceState conferenceState); Task ConsultationMessage(Guid conferenceId, string requestedBy, string requestedFor, string result); - Task AdminConsultationMessage(Guid conferenceId, RoomType room, string requestedFor); + + Task AdminConsultationMessage(Guid conferenceId, RoomType room, string requestedFor, + ConsultationAnswer? answer = null); Task HelpMessage(Guid conferenceId, string participantName); } diff --git a/VideoAPI/VideoApi.Events/VideoApi.Events.csproj b/VideoAPI/VideoApi.Events/VideoApi.Events.csproj index efeb6e3d8..024e4246b 100644 --- a/VideoAPI/VideoApi.Events/VideoApi.Events.csproj +++ b/VideoAPI/VideoApi.Events/VideoApi.Events.csproj @@ -12,6 +12,7 @@ + diff --git a/VideoAPI/VideoApi.UnitTests/Events/VhOfficerCallEventHandlerTests.cs b/VideoAPI/VideoApi.UnitTests/Events/VhOfficerCallEventHandlerTests.cs index ed6a87a4f..d6a132c76 100644 --- a/VideoAPI/VideoApi.UnitTests/Events/VhOfficerCallEventHandlerTests.cs +++ b/VideoAPI/VideoApi.UnitTests/Events/VhOfficerCallEventHandlerTests.cs @@ -66,7 +66,7 @@ public async Task should_raise_admin_consultation_message(RoomType? transferTo) EventHubClientMock.Verify(x => x.AdminConsultationMessage(conference.Id, transferTo.Value, - participantForEvent.Username.ToLowerInvariant()), + participantForEvent.Username.ToLowerInvariant(), null), Times.Once); } }