Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIH-10965 map audio playback language. Default to not welsh #285

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static BookNewConferenceRequest MapToBookNewConferenceRequest(HearingDto
Endpoints = PopulateAddEndpointRequests(endpointDtos, participantDtos).ToList(),
CaseTypeServiceId = hearingDto.CaseTypeServiceId,
Supplier = (Supplier)hearingDto.VideoSupplier,
ConferenceRoomType = (ConferenceRoomType)hearingDto.ConferenceRoomType
ConferenceRoomType = (ConferenceRoomType)hearingDto.ConferenceRoomType,
AudioPlaybackLanguage = hearingDto.IsVenueWelsh ? AudioPlaybackLanguage.EnglishAndWelsh : AudioPlaybackLanguage.English
};

return request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public class HearingDto
public string CaseTypeServiceId { get; set; }
public VideoSupplier VideoSupplier { get; set; }
public ConferenceRoomType ConferenceRoomType { get; set; }

public bool IsVenueWelsh { get; set; } = false;

public bool IsMultiDayHearing() => GroupId.HasValue && GroupId.GetValueOrDefault() != Guid.Empty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void should_map_hearing_dto_to_book_new_conference_request()
.Excluding(o => o.HearingId).ExcludingMissingMembers()
);
request.AudioRecordingRequired.Should().Be(hearingDto.RecordAudio);
request.AudioPlaybackLanguage.Should().Be(AudioPlaybackLanguage.English);
request.HearingRefId.Should().Be(hearingDto.HearingId);
request.Participants.Count.Should().Be(participants.Count);
request.Endpoints.Count.Should().Be(endpoints.Count);
Expand All @@ -39,6 +40,18 @@ public void should_map_hearing_dto_to_book_new_conference_request()
thirdEndpoint.ConferenceRole.Should().Be(ConferenceRole.Guest);
}

[Test]
public void should_map_iswelsh_to_english_and_welsh_playback_language()
{
var hearingDto = CreateHearingDto();
hearingDto.IsVenueWelsh = true;

var request = HearingToBookConferenceMapper
.MapToBookNewConferenceRequest(hearingDto, new List<ParticipantDto>(), new List<EndpointDto>());

request.AudioPlaybackLanguage.Should().Be(AudioPlaybackLanguage.EnglishAndWelsh);
}

private static HearingDto CreateHearingDto()
{
var dto = new HearingDto
Expand All @@ -51,8 +64,9 @@ private static HearingDto CreateHearingDto()
ScheduledDateTime = DateTime.UtcNow,
HearingVenueName = "MyVenue",
RecordAudio = true,
CaseTypeServiceId = "ZZY1",
VideoSupplier = VideoSupplier.Kinly
CaseTypeServiceId ="ZZY1",
VideoSupplier = VideoSupplier.Vodafone,
IsVenueWelsh = false
};
return dto;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private static HearingIsReadyForVideoIntegrationEvent CreateEvent(bool isMultiHe
HearingVenueName = "MyVenue",
RecordAudio = true,
GroupId = isMultiHearing ? Guid.NewGuid() : null,
VideoSupplier = VideoSupplier.Kinly
VideoSupplier = VideoSupplier.Vodafone
};
var participants = Builder<ParticipantDto>.CreateListOfSize(4)
.All().With(x => x.UserRole = UserRole.Individual.ToString()).Build().ToList();
Expand Down
Loading