diff --git a/AdminWebsite/AdminWebsite.AcceptanceTests/packages.lock.json b/AdminWebsite/AdminWebsite.AcceptanceTests/packages.lock.json index 61e2b7bb3..e5de7851c 100644 --- a/AdminWebsite/AdminWebsite.AcceptanceTests/packages.lock.json +++ b/AdminWebsite/AdminWebsite.AcceptanceTests/packages.lock.json @@ -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" } @@ -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, )", diff --git a/AdminWebsite/AdminWebsite.IntegrationTests/packages.lock.json b/AdminWebsite/AdminWebsite.IntegrationTests/packages.lock.json index 19b297fe1..b9577ac4d 100644 --- a/AdminWebsite/AdminWebsite.IntegrationTests/packages.lock.json +++ b/AdminWebsite/AdminWebsite.IntegrationTests/packages.lock.json @@ -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" } @@ -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, )", diff --git a/AdminWebsite/AdminWebsite.UnitTests/Controllers/HearingsController/EditHearingTests.cs b/AdminWebsite/AdminWebsite.UnitTests/Controllers/HearingsController/EditHearingTests.cs index d1234c549..93323065e 100644 --- a/AdminWebsite/AdminWebsite.UnitTests/Controllers/HearingsController/EditHearingTests.cs +++ b/AdminWebsite/AdminWebsite.UnitTests/Controllers/HearingsController/EditHearingTests.cs @@ -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 { new() { Id = Guid.NewGuid(), UserRoleName = "Individual", - ContactEmail = "old@domain.net", - Username = "old@domain.net", - CaseRoleName = "caseRoleName", + ContactEmail = "old@domain.net" } }, Cases = new List @@ -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, diff --git a/AdminWebsite/AdminWebsite.UnitTests/Controllers/HearingsController/GetHearingTests.cs b/AdminWebsite/AdminWebsite.UnitTests/Controllers/HearingsController/GetHearingTests.cs index 7476a88b3..f9fcc58ec 100644 --- a/AdminWebsite/AdminWebsite.UnitTests/Controllers/HearingsController/GetHearingTests.cs +++ b/AdminWebsite/AdminWebsite.UnitTests/Controllers/HearingsController/GetHearingTests.cs @@ -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 @@ -105,9 +104,8 @@ public void Initialise() _vhExistingHearingV2 = new HearingDetailsResponseV2 { Id = _guid, - ScheduledDateTime = new DateTime(), + ScheduledDateTime = DateTime.UtcNow, ServiceId = "ServiceId", - HearingTypeCode = "HearingTypeCode", Participants = new List { new() @@ -115,8 +113,6 @@ public void Initialise() Id = Guid.NewGuid(), UserRoleName = "Individual", ContactEmail = "old@domain.net", - Username = "old@domain.net", - CaseRoleName = "caseRoleName", } }, Cases = new List @@ -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, diff --git a/AdminWebsite/AdminWebsite.UnitTests/Helper/HearingResponseV2Builder.cs b/AdminWebsite/AdminWebsite.UnitTests/Helper/HearingResponseV2Builder.cs index b4b2b7e40..ce4c61291 100644 --- a/AdminWebsite/AdminWebsite.UnitTests/Helper/HearingResponseV2Builder.cs +++ b/AdminWebsite/AdminWebsite.UnitTests/Helper/HearingResponseV2Builder.cs @@ -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.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()); diff --git a/AdminWebsite/AdminWebsite.UnitTests/packages.lock.json b/AdminWebsite/AdminWebsite.UnitTests/packages.lock.json index c27f4967a..80488eb19 100644 --- a/AdminWebsite/AdminWebsite.UnitTests/packages.lock.json +++ b/AdminWebsite/AdminWebsite.UnitTests/packages.lock.json @@ -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" } @@ -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, )", diff --git a/AdminWebsite/AdminWebsite/AdminWebsite.csproj b/AdminWebsite/AdminWebsite/AdminWebsite.csproj index 4671fdde9..244af60a7 100644 --- a/AdminWebsite/AdminWebsite/AdminWebsite.csproj +++ b/AdminWebsite/AdminWebsite/AdminWebsite.csproj @@ -32,7 +32,7 @@ - + diff --git a/AdminWebsite/AdminWebsite/Mappers/BookingDetailsRequestMapper.cs b/AdminWebsite/AdminWebsite/Mappers/BookingDetailsRequestMapper.cs index 6c728e049..05a583920 100644 --- a/AdminWebsite/AdminWebsite/Mappers/BookingDetailsRequestMapper.cs +++ b/AdminWebsite/AdminWebsite/Mappers/BookingDetailsRequestMapper.cs @@ -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 { diff --git a/AdminWebsite/AdminWebsite/Mappers/HearingDetailsResponseMapper.cs b/AdminWebsite/AdminWebsite/Mappers/HearingDetailsResponseMapper.cs index db2ca2eb2..d2d6679c1 100644 --- a/AdminWebsite/AdminWebsite/Mappers/HearingDetailsResponseMapper.cs +++ b/AdminWebsite/AdminWebsite/Mappers/HearingDetailsResponseMapper.cs @@ -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, diff --git a/AdminWebsite/AdminWebsite/Mappers/ParticipantRequestMapper.cs b/AdminWebsite/AdminWebsite/Mappers/ParticipantRequestMapper.cs index 5983d0219..42c77f781 100644 --- a/AdminWebsite/AdminWebsite/Mappers/ParticipantRequestMapper.cs +++ b/AdminWebsite/AdminWebsite/Mappers/ParticipantRequestMapper.cs @@ -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, }; } diff --git a/AdminWebsite/AdminWebsite/Mappers/ParticipantResponseMapper.cs b/AdminWebsite/AdminWebsite/Mappers/ParticipantResponseMapper.cs index 79b8b02be..2c754fc2d 100644 --- a/AdminWebsite/AdminWebsite/Mappers/ParticipantResponseMapper.cs +++ b/AdminWebsite/AdminWebsite/Mappers/ParticipantResponseMapper.cs @@ -38,8 +38,6 @@ public static List Map(this List { Id = p.Id, DisplayName = p.DisplayName, - CaseRoleName = p.CaseRoleName, - HearingRoleName = p.HearingRoleName, HearingRoleCode = p.HearingRoleCode, UserRoleName = p.UserRoleName, Title = p.Title, @@ -48,7 +46,6 @@ public static List Map(this List 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() diff --git a/AdminWebsite/AdminWebsite/Services/HearingsService.cs b/AdminWebsite/AdminWebsite/Services/HearingsService.cs index f7da8d4de..d5a11057f 100644 --- a/AdminWebsite/AdminWebsite/Services/HearingsService.cs +++ b/AdminWebsite/AdminWebsite/Services/HearingsService.cs @@ -181,8 +181,11 @@ public async Task 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}", diff --git a/AdminWebsite/AdminWebsite/packages.lock.json b/AdminWebsite/AdminWebsite/packages.lock.json index 1734bed69..4d3a40915 100644 --- a/AdminWebsite/AdminWebsite/packages.lock.json +++ b/AdminWebsite/AdminWebsite/packages.lock.json @@ -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" }