Skip to content

Commit

Permalink
Update admin web
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaed Parkar committed Oct 13, 2023
1 parent b1b2cf8 commit d8d4666
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 40 deletions.
6 changes: 3 additions & 3 deletions AdminWebsite/AdminWebsite.AcceptanceTests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
},
"BookingsApi.Client": {
"type": "Transitive",
"resolved": "1.47.11",
"contentHash": "9YUrBx5oFEzDKXeaj2CBX8Hm032DD6/OD2jJJtKJ8uAFCQTOg+peWrJQjukMV+jYhAsXOP+UrCXjyAjgrwQM+w==",
"resolved": "1.47.15",
"contentHash": "sd5lILWV3aiku/U/tFu16n7Fi9wAELGP0rVpLhaDFq3YzwxEL8JshbN0BUin3F/QZM3T8+DsnMKbMDcU449cqA==",
"dependencies": {
"Microsoft.AspNetCore.Mvc.Core": "2.2.5"
}
Expand Down Expand Up @@ -2669,7 +2669,7 @@
"type": "Project",
"dependencies": {
"AspNetCore.HealthChecks.Uris": "[6.0.3, )",
"BookingsApi.Client": "[1.47.11, )",
"BookingsApi.Client": "[1.47.15, )",
"FluentValidation.AspNetCore": "[10.4.0, )",
"LaunchDarkly.ServerSdk": "[7.0.3, )",
"MicroElements.Swashbuckle.FluentValidation": "[5.7.0, )",
Expand Down
6 changes: 3 additions & 3 deletions AdminWebsite/AdminWebsite.IntegrationTests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
},
"BookingsApi.Client": {
"type": "Transitive",
"resolved": "1.47.11",
"contentHash": "9YUrBx5oFEzDKXeaj2CBX8Hm032DD6/OD2jJJtKJ8uAFCQTOg+peWrJQjukMV+jYhAsXOP+UrCXjyAjgrwQM+w==",
"resolved": "1.47.15",
"contentHash": "sd5lILWV3aiku/U/tFu16n7Fi9wAELGP0rVpLhaDFq3YzwxEL8JshbN0BUin3F/QZM3T8+DsnMKbMDcU449cqA==",
"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.11, )",
"BookingsApi.Client": "[1.47.15, )",
"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 @@ -390,18 +390,15 @@ public void Setup()
_v2HearingDetailsResponse = new HearingDetailsResponseV2
{
Id = _validId,
ScheduledDateTime = new DateTime(),
ScheduledDateTime = DateTime.UtcNow,
ServiceId = "ServiceId",
HearingTypeCode = "HearingTypeCode",
Participants = new List<ParticipantResponseV2>
{
new()
{
Id = Guid.NewGuid(),
UserRoleName = "Individual",
ContactEmail = "[email protected]",
Username = "[email protected]",
CaseRoleName = "caseRoleName",
ContactEmail = "[email protected]"
}
},
Cases = new List<CaseResponseV2>
Expand All @@ -415,12 +412,12 @@ public void Setup()
},
HearingRoomName = "hearingRoomName",
OtherInformation = "otherInformation",
CreatedDate = new DateTime(),
CreatedDate = DateTime.UtcNow,
CreatedBy = "createdBy",
UpdatedBy = "updatedBy",
UpdatedDate = new DateTime(),
UpdatedDate = DateTime.UtcNow,
ConfirmedBy = "confirmedBy",
ConfirmedDate = new DateTime(),
ConfirmedDate = DateTime.UtcNow,
Status = BookingStatusV2.Booked,
AudioRecordingRequired = true,
CancelReason = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using BookingsApi.Contract.V1.Enums;
using BookingsApi.Contract.V2.Enums;
using BookingsApi.Contract.V2.Responses;
using Moq.Language.Flow;
using VideoApi.Contract.Responses;

namespace AdminWebsite.UnitTests.Controllers.HearingsController
Expand Down Expand Up @@ -105,18 +104,15 @@ public void Initialise()
_vhExistingHearingV2 = new HearingDetailsResponseV2
{
Id = _guid,
ScheduledDateTime = new DateTime(),
ScheduledDateTime = DateTime.UtcNow,
ServiceId = "ServiceId",
HearingTypeCode = "HearingTypeCode",
Participants = new List<ParticipantResponseV2>
{
new()
{
Id = Guid.NewGuid(),
UserRoleName = "Individual",
ContactEmail = "[email protected]",
Username = "[email protected]",
CaseRoleName = "caseRoleName",
}
},
Cases = new List<CaseResponseV2>
Expand All @@ -130,12 +126,12 @@ public void Initialise()
},
HearingRoomName = "hearingRoomName",
OtherInformation = "otherInformation",
CreatedDate = new DateTime(),
CreatedDate = DateTime.UtcNow,
CreatedBy = "createdBy",
UpdatedBy = "updatedBy",
UpdatedDate = new DateTime(),
UpdatedDate = DateTime.UtcNow,
ConfirmedBy = "confirmedBy",
ConfirmedDate = new DateTime(),
ConfirmedDate = DateTime.UtcNow,
Status = BookingStatusV2.Booked,
AudioRecordingRequired = true,
CancelReason = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public static HearingDetailsResponseV2 WithEndPoints(this HearingDetailsResponse
return hearingDetailsResponse;
}

public static HearingDetailsResponseV2 WithParticipant(this HearingDetailsResponseV2 hearingDetailsResponse, string userRoleName, string userName =null)
public static HearingDetailsResponseV2 WithParticipant(this HearingDetailsResponseV2 hearingDetailsResponse, string userRoleName, string contactEmail =null)
{
var participant = Builder<ParticipantResponseV2>.CreateNew()
.With(x => x.Id = Guid.NewGuid())
.With(x => x.UserRoleName = userRoleName);

if(!string.IsNullOrEmpty(userName))
if(!string.IsNullOrEmpty(contactEmail))
{
participant.With(x => x.Username = userName);
participant.With(x => x.ContactEmail = contactEmail);
}

hearingDetailsResponse.Participants.Add(participant.Build());
Expand Down
6 changes: 3 additions & 3 deletions AdminWebsite/AdminWebsite.UnitTests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
},
"BookingsApi.Client": {
"type": "Transitive",
"resolved": "1.47.11",
"contentHash": "9YUrBx5oFEzDKXeaj2CBX8Hm032DD6/OD2jJJtKJ8uAFCQTOg+peWrJQjukMV+jYhAsXOP+UrCXjyAjgrwQM+w==",
"resolved": "1.47.15",
"contentHash": "sd5lILWV3aiku/U/tFu16n7Fi9wAELGP0rVpLhaDFq3YzwxEL8JshbN0BUin3F/QZM3T8+DsnMKbMDcU449cqA==",
"dependencies": {
"Microsoft.AspNetCore.Mvc.Core": "2.2.5"
}
Expand Down Expand Up @@ -1979,7 +1979,7 @@
"type": "Project",
"dependencies": {
"AspNetCore.HealthChecks.Uris": "[6.0.3, )",
"BookingsApi.Client": "[1.47.11, )",
"BookingsApi.Client": "[1.47.15, )",
"FluentValidation.AspNetCore": "[10.4.0, )",
"LaunchDarkly.ServerSdk": "[7.0.3, )",
"MicroElements.Swashbuckle.FluentValidation": "[5.7.0, )",
Expand Down
2 changes: 1 addition & 1 deletion AdminWebsite/AdminWebsite/AdminWebsite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="6.0.3" />
<PackageReference Include="BookingsApi.Client" Version="1.47.11" />
<PackageReference Include="BookingsApi.Client" Version="1.47.15" />
<PackageReference Include="LaunchDarkly.ServerSdk" Version="7.0.3" />
<PackageReference Include="MicroElements.Swashbuckle.FluentValidation" Version="5.7.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.51.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public static V2.BookNewHearingRequestV2 MapToV2(this BookingDetailsRequest book
ScheduledDuration = bookingDetails.ScheduledDuration,
HearingVenueCode = bookingDetails.HearingVenueCode,
ServiceId = bookingDetails.CaseTypeServiceId,
HearingTypeCode = bookingDetails.HearingTypeCode,
Cases = bookingDetails.Cases?
.Select(cr => new V2.CaseRequestV2
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public static HearingDetailsResponse Map(this V2.HearingDetailsResponseV2 hearin
HearingVenueCode = hearingDetails.HearingVenueCode,
ServiceId = hearingDetails.ServiceId,
CaseTypeName = hearingDetails.ServiceName,
HearingTypeCode = hearingDetails.HearingTypeCode,
Cases = hearingDetails.Cases?.Select(e => new CaseResponse
{
IsLeadCase = e.IsLeadCase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public static V2.ParticipantRequestV2 MapToV2(this ParticipantRequest participan
Representee = participantRequest.Representee,
TelephoneNumber = participantRequest.TelephoneNumber,
Title = participantRequest.Title,
Username = participantRequest.Username,
OrganisationName = participantRequest.OrganisationName,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public static List<ParticipantResponse> Map(this List<V2.ParticipantResponseV2>
{
Id = p.Id,
DisplayName = p.DisplayName,
CaseRoleName = p.CaseRoleName,
HearingRoleName = p.HearingRoleName,
HearingRoleCode = p.HearingRoleCode,
UserRoleName = p.UserRoleName,
Title = p.Title,
Expand All @@ -48,7 +46,6 @@ public static List<ParticipantResponse> Map(this List<V2.ParticipantResponseV2>
LastName = p.LastName,
ContactEmail = p.ContactEmail,
TelephoneNumber = p.TelephoneNumber,
Username = p.Username,
Organisation = p.Organisation,
Representee = p.Representee,
LinkedParticipants = p.LinkedParticipants?.Select(lp => lp.Map()).ToList()
Expand Down
7 changes: 5 additions & 2 deletions AdminWebsite/AdminWebsite/Services/HearingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ public async Task<IParticipantRequest> ProcessNewParticipant(
//If the judge already exists in the database, there is no need to add again.
return null;
}

newParticipant.Username = participant.ContactEmail;

if (newParticipant is ParticipantRequest v1Request)
{
v1Request.Username = participant.ContactEmail;
}
}

_logger.LogDebug("Adding participant {Participant} to hearing {Hearing}",
Expand Down
6 changes: 3 additions & 3 deletions AdminWebsite/AdminWebsite/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
},
"BookingsApi.Client": {
"type": "Direct",
"requested": "[1.47.11, )",
"resolved": "1.47.11",
"contentHash": "9YUrBx5oFEzDKXeaj2CBX8Hm032DD6/OD2jJJtKJ8uAFCQTOg+peWrJQjukMV+jYhAsXOP+UrCXjyAjgrwQM+w==",
"requested": "[1.47.15, )",
"resolved": "1.47.15",
"contentHash": "sd5lILWV3aiku/U/tFu16n7Fi9wAELGP0rVpLhaDFq3YzwxEL8JshbN0BUin3F/QZM3T8+DsnMKbMDcU449cqA==",
"dependencies": {
"Microsoft.AspNetCore.Mvc.Core": "2.2.5"
}
Expand Down

0 comments on commit d8d4666

Please sign in to comment.