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-10086 add judicial office holders #1295

Merged
merged 51 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0226f7f
WIP add joh members
Oct 27, 2023
e083254
WIP search for joh and add to panel list.
Oct 27, 2023
2aa1b0f
add judicial members to hearing
Oct 30, 2023
4ec38f7
house keeping
Oct 30, 2023
804c75a
WIP add JOHs
Oct 31, 2023
6ca231d
horizontal align joh page
Oct 31, 2023
bfae35c
house keeping
Oct 31, 2023
bafa380
post demo changes
Oct 31, 2023
54f5c6f
navigate to correct edit page
Oct 31, 2023
f52cf0b
changes after final demo
Oct 31, 2023
6152d19
update client and remove unused components
Oct 31, 2023
be596a3
backward
Oct 31, 2023
77cd79a
add judiciary-participant-details.model.ts for booking details page
Oct 31, 2023
38f4a16
make isJudiciaryMember optional in participant.model.ts
Oct 31, 2023
2362104
fix breadcrumb tests
Oct 31, 2023
168c072
add more tests
Oct 31, 2023
0b3340c
fix tests
Oct 31, 2023
a0bf67a
updated setup
Nov 1, 2023
047d9c1
fix noise in test setup for missing dependencies
Nov 1, 2023
2f0ad7a
fix linting
Nov 1, 2023
6f5a6a6
get pr ready
Nov 1, 2023
e108946
fix dockerfile for build
Nov 1, 2023
7fa1364
Merge branch 'master' into feature/VIH-10086_add_judicial_office_holders
shaed-parkar Nov 2, 2023
48249a7
fic setup
Nov 2, 2023
fd5cbe9
swap to use api v2 toggle
Nov 2, 2023
9aa9645
update to use v2 toggle in hearings controller
Nov 2, 2023
55802b6
restore old judiciary search
Nov 6, 2023
760521b
Merge remote-tracking branch 'origin/master' into feature/VIH-10086_a…
Nov 6, 2023
2aa4771
fix post merge
Nov 6, 2023
b764ff3
fix code smells
Nov 6, 2023
49aea0a
restore commented test
Nov 7, 2023
0ea71d7
update using statments
Nov 7, 2023
a906067
add tests for judiciary methods in video-hearings.service.ts
Nov 7, 2023
d396750
remove focus
Nov 7, 2023
5ce9d4b
fix linting
Nov 7, 2023
83f4752
add more tests
Nov 7, 2023
e9fe8cb
fix linting
Nov 7, 2023
20478ca
bug fixes during local testing
Nov 7, 2023
d8c15ef
update validation timing for search johs
Nov 7, 2023
defb80f
style fixes post demo
Nov 8, 2023
b184eac
add ids to make it easier for automated UI testing
Nov 8, 2023
13bdf73
poll for status when edit hearing involves adding a judge
Nov 8, 2023
70bc220
remove focus
Nov 8, 2023
0eeba6e
bug fixes
Nov 9, 2023
f223208
bugfixes for v2 hearing
Nov 10, 2023
a4d3db4
remove excess code
Nov 10, 2023
235168d
remove unused model
Nov 10, 2023
642aa76
update test setup
Nov 13, 2023
6997f85
Use non-pr package version
Nov 15, 2023
84e7a53
remove dev temp url
Nov 15, 2023
968bc6c
Merge remote-tracking branch 'origin/master' into feature/VIH-10086_a…
Nov 15, 2023
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 @@ -102,8 +102,8 @@
},
"BookingsApi.Client": {
"type": "Transitive",
"resolved": "1.47.15",
"contentHash": "sd5lILWV3aiku/U/tFu16n7Fi9wAELGP0rVpLhaDFq3YzwxEL8JshbN0BUin3F/QZM3T8+DsnMKbMDcU449cqA==",
"resolved": "1.49.7-pr-0759-0029",
shaed-parkar marked this conversation as resolved.
Show resolved Hide resolved
"contentHash": "e3wbohej2QgPtAV6qk+Ib1QNBVlBogcBRfIZC88hOb9oV1S4S8lfMRP7Q9m4Nh4R8hTBaX09Q78/7jRiAMpCSQ==",
"dependencies": {
"Microsoft.AspNetCore.Mvc.Core": "2.2.5"
}
Expand Down Expand Up @@ -2101,7 +2101,7 @@
"type": "Project",
"dependencies": {
"AspNetCore.HealthChecks.Uris": "[6.0.3, )",
"BookingsApi.Client": "[1.47.15, )",
"BookingsApi.Client": "[1.49.7-pr-0759-0029, )",
"FluentValidation.AspNetCore": "[10.4.0, )",
"LaunchDarkly.ServerSdk": "[7.0.3, )",
"MicroElements.Swashbuckle.FluentValidation": "[5.7.0, )",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ public async Task Should_book_hearing_for_multi_day()
}

[Test]
public async Task Should_book_hearing_with_reference_data_flag_on()
public async Task Should_book_hearing_with_use_v2_api_flag_on()
{
// Arrange
_mocker.Mock<IFeatureToggles>().Setup(x => x.ReferenceDataToggle()).Returns(true);
_mocker.Mock<IFeatureToggles>().Setup(x => x.UseV2Api()).Returns(true);
var bookingDetails = InitHearingForV2Test();

var bookingRequest = new BookHearingRequest
Expand All @@ -259,7 +259,6 @@ public async Task Should_book_hearing_with_reference_data_flag_on()
.WithParticipant("Individual", "[email protected]")
.WithParticipant("Individual", "[email protected]")
.WithParticipant("Judicial Office Holder", "[email protected]")
.WithParticipant("Staff Member","[email protected]")
.WithParticipant("Judge", "[email protected]");
_mocker.Mock<IBookingsApiClient>().Setup(x => x.BookNewHearingWithCodeAsync(It.IsAny<BookNewHearingRequestV2>()))
.ReturnsAsync(hearingDetailsResponse);
Expand Down Expand Up @@ -415,65 +414,76 @@ private BookingDetailsRequest InitHearingForV2Test()
{
Participants = new List<ParticipantRequest>
{
new ()
new()
{
ContactEmail = "[email protected]",
HearingRoleCode = "APPL", DisplayName = "display name1",
FirstName = "fname", MiddleNames = "", LastName = "lname1", Username = "[email protected]",
OrganisationName = "", Representee = "", TelephoneNumber = ""
},
new ()
new()
{
ContactEmail = "[email protected]",
HearingRoleCode = "APPL", DisplayName = "display name2",
FirstName = "fname2", MiddleNames = "", LastName = "lname2", OrganisationName = "",
Representee = "", TelephoneNumber = "", Username = "[email protected]"
},
new ()
new()
{
ContactEmail = "[email protected]",
HearingRoleCode = "APPL", DisplayName = "display name3",
FirstName = "fname3", MiddleNames = "", LastName = "lname3", OrganisationName = "",
Representee = "", TelephoneNumber = "", Username = "[email protected]"
},
new ()
new()
{
ContactEmail = "[email protected]",
HearingRoleCode = "PANL", DisplayName = "display name4",
FirstName = "fname4", MiddleNames = "", LastName = "lname4", OrganisationName = "",
Representee = "", TelephoneNumber = "", Username = "[email protected]"
},
new ()
new()
{
ContactEmail = "[email protected]",
HearingRoleCode = "INTP", DisplayName = "display name2",
FirstName = "fname5", MiddleNames = "", LastName = "lname5", OrganisationName = "",
Representee = "", TelephoneNumber = "", Username = "[email protected]"
}
},
JudiciaryParticipants = new List<JudiciaryParticipantRequest>()
{
new()
{
DisplayName = "display name4", PersonalCode = "12345678", Role = "PanelMember"
},
new ()
new()
{
ContactEmail = "[email protected]",
HearingRoleCode = "JUDG", DisplayName = "Judge Fudge",
FirstName = "Jack", MiddleNames = "", LastName = "Fudge",
Username = "[email protected]", OrganisationName = "", Representee = "",
TelephoneNumber = ""
DisplayName = "Judge Fudge", PersonalCode = "12345678", Role = "Judge"
}
},
Endpoints = new List<EndpointRequest>
{
new ()
new()
{DisplayName = "displayname1", DefenceAdvocateContactEmail = "[email protected]"},
new ()
new()
{DisplayName = "displayname2", DefenceAdvocateContactEmail = "[email protected]"},
},
LinkedParticipants = new List<LinkedParticipantRequest>
{
new () { ParticipantContactEmail = "[email protected]", LinkedParticipantContactEmail = "[email protected]", Type = LinkedParticipantType.Interpreter },
new () { ParticipantContactEmail = "[email protected]", LinkedParticipantContactEmail = "[email protected]", Type = LinkedParticipantType.Interpreter }
new()
{
ParticipantContactEmail = "[email protected]",
LinkedParticipantContactEmail = "[email protected]", Type = LinkedParticipantType.Interpreter
},
new()
{
ParticipantContactEmail = "[email protected]",
LinkedParticipantContactEmail = "[email protected]", Type = LinkedParticipantType.Interpreter
}
},
Cases = new List<CaseRequest>
{
new ()
new()
{
Name = "Case1", Number = "001", IsLeadCase = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using AdminWebsite.UnitTests.Helper;
using BookingsApi.Client;
using BookingsApi.Contract.V1.Requests;
using BookingsApi.Contract.V1.Requests.Enums;
using BookingsApi.Contract.V1.Responses;
using BookingsApi.Contract.V2.Enums;
using BookingsApi.Contract.V2.Requests;
Expand All @@ -32,6 +33,7 @@
using BookingStatus = BookingsApi.Contract.V1.Enums.BookingStatus;
using CaseResponse = BookingsApi.Contract.V1.Responses.CaseResponse;
using EndpointResponse = BookingsApi.Contract.V1.Responses.EndpointResponse;
using JudiciaryParticipantRequest = AdminWebsite.Contracts.Requests.JudiciaryParticipantRequest;
using LinkedParticipantResponse = BookingsApi.Contract.V1.Responses.LinkedParticipantResponse;
using LinkedParticipantType = BookingsApi.Contract.V1.Enums.LinkedParticipantType;

Expand Down Expand Up @@ -358,6 +360,11 @@ public void Setup()
Pin = "pin",
Sip = "sip"
}
},
JudiciaryParticipants = new List<JudiciaryParticipantResponse>()
{
new (){FullName = "Judge Fudge", FirstName = "John", LastName = "Doe", HearingRoleCode = JudiciaryParticipantHearingRoleCode.Judge, PersonalCode = "1234"},
new (){FullName = "Jane Doe", FirstName = "Jane", LastName = "Doe", HearingRoleCode = JudiciaryParticipantHearingRoleCode.PanelMember, PersonalCode = "4567"}
}
};
}
Expand Down Expand Up @@ -570,7 +577,7 @@ public async Task Should_return_updated_hearing()
[Test]
public async Task Should_return_updated_hearingV2()
{
_featureToggle.Setup(e => e.ReferenceDataToggle()).Returns(true);
_featureToggle.Setup(e => e.UseV2Api()).Returns(true);
var updatedHearing = _v2HearingDetailsResponse;
_bookingsApiClient.SetupSequence(x => x.GetHearingDetailsByIdV2Async(It.IsAny<Guid>()))
.ReturnsAsync(updatedHearing)
Expand Down Expand Up @@ -605,15 +612,36 @@ public async Task Should_return_updated_hearingV2()
LinkedParticipantContactEmail = "[email protected]",
Type = AdminWebsite.Contracts.Enums.LinkedParticipantType.Interpreter
}
}
},
});
_addNewParticipantRequest.JudiciaryParticipants = new List<JudiciaryParticipantRequest>()
{
new()
{
PersonalCode = "4567", DisplayName = "Jane Doe 2", Role = JudiciaryParticipantHearingRoleCode.PanelMember.ToString()
},
new()
{
PersonalCode = "5678", DisplayName = "New Judge Fudge", Role = JudiciaryParticipantHearingRoleCode.Judge.ToString()
}
};
var result = await _controller.EditHearing(_validId, _addNewParticipantRequest);
var hearing = (AdminWebsite.Contracts.Responses.HearingDetailsResponse)((OkObjectResult)result.Result).Value;
hearing.Id.Should().Be(updatedHearing.Id);
_bookingsApiClient.Verify(x => x.UpdateHearingDetails2Async(It.IsAny<Guid>(),
It.Is<UpdateHearingRequestV2>(u =>
!u.Cases.IsNullOrEmpty())),
Times.Once);

_bookingsApiClient.Verify(x => x.RemoveJudiciaryParticipantFromHearingAsync(hearing.Id, "1234"),
Times.Once);

_bookingsApiClient.Verify(x => x.UpdateJudiciaryParticipantAsync(hearing.Id, "4567", It.IsAny<UpdateJudiciaryParticipantRequest>()),
Times.Once);

_bookingsApiClient.Verify(
x => x.AddJudiciaryParticipantsToHearingAsync(hearing.Id,
It.IsAny<IEnumerable<BookingsApi.Contract.V1.Requests.JudiciaryParticipantRequest>>()), Times.Once);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public async Task Should_return_ok_status_if_hearing_id_is_valid()
public async Task Should_return_ok_status_if_hearing_id_is_validV2()
{
// Arrange
_featureToggle.Setup(e => e.ReferenceDataToggle()).Returns(true);
_featureToggle.Setup(e => e.UseV2Api()).Returns(true);
_mocker.Mock<IBookingsApiClient>().Setup(x =>
x.GetHearingDetailsByIdV2Async(It.IsAny<Guid>())).ReturnsAsync(_vhExistingHearingV2);

Expand Down
Loading
Loading