diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index c6ab0ff0d..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dotnet.defaultSolution": "Dfe.Academies.Academisation.sln" -} \ No newline at end of file diff --git a/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteProjectSuccessResponse.cs b/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteConversionProjectSuccessResponse.cs similarity index 68% rename from Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteProjectSuccessResponse.cs rename to Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteConversionProjectSuccessResponse.cs index 95580b75f..94aed4572 100644 --- a/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteProjectSuccessResponse.cs +++ b/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteConversionProjectSuccessResponse.cs @@ -6,7 +6,7 @@ namespace Dfe.Academies.Academisation.IService.ServiceModels.Complete { - public record CreateCompleteProjectSuccessResponse (Guid conversion_project_id) + public record CreateCompleteConversionProjectSuccessResponse (Guid conversion_project_id) { } } diff --git a/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteProjectErrorResponse.cs b/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteProjectErrorResponse.cs index 506745f3e..f7c9a2e38 100644 --- a/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteProjectErrorResponse.cs +++ b/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteProjectErrorResponse.cs @@ -35,7 +35,9 @@ public string GetAllErrors() ValidationErrors.InadequateOfsted?.Select(e => $"inadequate_ofsted: {e.Error}"), ValidationErrors.FinancialSafeguardingGovernanceIssues?.Select(e => $"financial_safeguarding_governance_issues: {e.Error}"), ValidationErrors.OutgoingTrustToClose?.Select(e => $"outgoing_trust_to_close: {e.Error}"), - ValidationErrors.OutgoingTrustUkprn?.Select(e => $"outgoing_trust_to_close: {e.Error}"), + ValidationErrors.OutgoingTrustUkprn?.Select(e => $"outgoing_trust_ukprn: {e.Error}"), + ValidationErrors.NewTrustReferenceNumber?.Select(e => $"new_trust_reference_number: {e.Error}"), + ValidationErrors.NewTrustName?.Select(e => $"new_trust_name: {e.Error}"), }; @@ -110,6 +112,14 @@ public class ValidationErrors [JsonPropertyName("outgoing_trust_ukprn")] public List OutgoingTrustUkprn { get; set; } + + [JsonPropertyName("new_trust_reference_number")] + + public List NewTrustReferenceNumber { get; set; } + + [JsonPropertyName("new_trust_name")] + + public List NewTrustName { get; set; } } public class ErrorDetail diff --git a/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteTransferProjectSuccessResponse.cs b/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteTransferProjectSuccessResponse.cs new file mode 100644 index 000000000..f70263791 --- /dev/null +++ b/Dfe.Academies.Academisation.IService/ServiceModels/Complete/CreateCompleteTransferProjectSuccessResponse.cs @@ -0,0 +1,6 @@ +namespace Dfe.Academies.Academisation.IService.ServiceModels.Complete +{ + public record CreateCompleteTransferProjectSuccessResponse (Guid transfer_project_id) + { + } +} diff --git a/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteConversionProjectsCommandHandlerTests.cs b/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteConversionProjectsCommandHandlerTests.cs index b018e355b..dfc805c06 100644 --- a/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteConversionProjectsCommandHandlerTests.cs +++ b/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteConversionProjectsCommandHandlerTests.cs @@ -125,7 +125,7 @@ public async Task Handle_ConversionProjectsExist_SuccessfulResponse_ReturnsComma var command = _fixture.Create(); var conversionProjects = _fixture.CreateMany().ToList(); var advisoryDecision = _fixture.Create(); - var successResponse = _fixture.Create(); + var successResponse = _fixture.Create(); var projectGroup = _fixture.Create(); var mockContext = new Mock(); diff --git a/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteFormAMatConversionProjectsCommandHandlerTests.cs b/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteFormAMatConversionProjectsCommandHandlerTests.cs index 7ccdedc11..d2baa4b71 100644 --- a/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteFormAMatConversionProjectsCommandHandlerTests.cs +++ b/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteFormAMatConversionProjectsCommandHandlerTests.cs @@ -126,7 +126,7 @@ public async Task Handle_ConversionProjectsExist_SuccessfulResponse_ReturnsComma var command = _fixture.Create(); var conversionProjects = _fixture.CreateMany().ToList(); var advisoryDecision = _fixture.Create(); - var successResponse = _fixture.Create(); + var successResponse = _fixture.Create(); var projectGroup = _fixture.Create(); var mockContext = new Mock(); diff --git a/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteFormAMatTransferProjectsCommandHandlerTests.cs b/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteFormAMatTransferProjectsCommandHandlerTests.cs index a173bb69f..b74bf5b2f 100644 --- a/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteFormAMatTransferProjectsCommandHandlerTests.cs +++ b/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteFormAMatTransferProjectsCommandHandlerTests.cs @@ -160,7 +160,7 @@ public async Task Handle_ConversionProjectsExist_SuccessfulResponse_ReturnsComma } var advisoryDecision = _fixture.Create(); - var successResponse = _fixture.Create(); + var successResponse = _fixture.Create(); var projectGroup = _fixture.Create(); var mockContext = new Mock(); diff --git a/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteTransferProjectsCommandHandlerTests.cs b/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteTransferProjectsCommandHandlerTests.cs index 8d4bfead1..820ee0004 100644 --- a/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteTransferProjectsCommandHandlerTests.cs +++ b/Dfe.Academies.Academisation.Service.UnitTest/Commands/CompleteProject/CreateCompleteTransferProjectsCommandHandlerTests.cs @@ -156,7 +156,7 @@ public async Task Handle_ConversionProjectsExist_SuccessfulResponse_ReturnsComma } var advisoryDecision = _fixture.Create(); - var successResponse = _fixture.Create(); + var successResponse = _fixture.Create(); var projectGroup = _fixture.Create(); var mockContext = new Mock(); diff --git a/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteConversionProjectsCommandHandler.cs b/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteConversionProjectsCommandHandler.cs index fd5c900c9..3a8827f9b 100644 --- a/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteConversionProjectsCommandHandler.cs +++ b/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteConversionProjectsCommandHandler.cs @@ -83,7 +83,7 @@ public async Task Handle(CreateCompleteConversionProjectsCommand if (response.IsSuccessStatusCode) { - var successResponse = await response.Content.ReadFromJsonAsync(); + var successResponse = await response.Content.ReadFromJsonAsync(); completeProjectId = successResponse.conversion_project_id; _logger.LogInformation("Success sending conversion project to complete with project urn: {project} with Status code 201 ", completeObject.urn); diff --git a/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteFormAMatConversionProjectsCommandHandler.cs b/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteFormAMatConversionProjectsCommandHandler.cs index 2cd0ac37c..31c2c2659 100644 --- a/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteFormAMatConversionProjectsCommandHandler.cs +++ b/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteFormAMatConversionProjectsCommandHandler.cs @@ -86,7 +86,7 @@ public async Task Handle(CreateCompleteFormAMatConversionProjects if (response.IsSuccessStatusCode) { - var successResponse = await response.Content.ReadFromJsonAsync(); + var successResponse = await response.Content.ReadFromJsonAsync(); completeProjectId = successResponse.conversion_project_id; _logger.LogInformation("Success sending conversion project to complete with project urn: {project} with Status code 201 ", completeObject.urn); diff --git a/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteFormAMatTransferProjectsCommandHandler.cs b/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteFormAMatTransferProjectsCommandHandler.cs index f3516b16d..b6bcd19c2 100644 --- a/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteFormAMatTransferProjectsCommandHandler.cs +++ b/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteFormAMatTransferProjectsCommandHandler.cs @@ -95,9 +95,9 @@ public async Task Handle(CreateCompleteFormAMatTransferProjectsCo if (response.IsSuccessStatusCode) { var successResponse = - await response.Content.ReadFromJsonAsync(); + await response.Content.ReadFromJsonAsync(); - completeProjectId = successResponse.conversion_project_id; + completeProjectId = successResponse.transfer_project_id; _logger.LogInformation( "Success sending transfer to complete with project urn: {project} with Status code 201 ", diff --git a/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteTransferProjectsCommandHandler.cs b/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteTransferProjectsCommandHandler.cs index 008c41e2b..135b8c87d 100644 --- a/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteTransferProjectsCommandHandler.cs +++ b/Dfe.Academies.Academisation.Service/Commands/CompleteProject/CreateCompleteTransferProjectsCommandHandler.cs @@ -103,9 +103,9 @@ public async Task Handle(CreateCompleteTransferProjectsCommand re if (response.IsSuccessStatusCode) { var successResponse = - await response.Content.ReadFromJsonAsync(); + await response.Content.ReadFromJsonAsync(); - completeProjectId = successResponse.conversion_project_id; + completeProjectId = successResponse.transfer_project_id; _logger.LogInformation( "Success sending transfer project to complete with project urn: {project} with Status code 201 ", diff --git a/Dfe.Academies.Academisation.Service/Commands/TransferProject/SetTransferProjectTrustCommand.cs b/Dfe.Academies.Academisation.Service/Commands/TransferProject/SetTransferProjectTrustCommand.cs index d90bcee70..201c5f446 100644 --- a/Dfe.Academies.Academisation.Service/Commands/TransferProject/SetTransferProjectTrustCommand.cs +++ b/Dfe.Academies.Academisation.Service/Commands/TransferProject/SetTransferProjectTrustCommand.cs @@ -8,5 +8,6 @@ public class SetTransferProjectTrustCommand : SetTransferProjectCommand { public string ProjectName { get; set; } public string? IncomingTrustUKPRN { get; set; } + public string? IncomingTrustReferenceNumber { get; set; } } } diff --git a/Dfe.Academies.Academisation.Service/Mappers/CompleteProjects/CompleteConversionProjectServiceModelMapper.cs b/Dfe.Academies.Academisation.Service/Mappers/CompleteProjects/CompleteConversionProjectServiceModelMapper.cs index 69c41b644..73eaae123 100644 --- a/Dfe.Academies.Academisation.Service/Mappers/CompleteProjects/CompleteConversionProjectServiceModelMapper.cs +++ b/Dfe.Academies.Academisation.Service/Mappers/CompleteProjects/CompleteConversionProjectServiceModelMapper.cs @@ -1,4 +1,5 @@ -using Dfe.Academies.Academisation.IDomain.ConversionAdvisoryBoardDecisionAggregate; +using System; +using Dfe.Academies.Academisation.IDomain.ConversionAdvisoryBoardDecisionAggregate; using Dfe.Academies.Academisation.IDomain.ProjectAggregate; using Dfe.Academies.Academisation.IDomain.TransferProjectAggregate; using Dfe.Academies.Academisation.IService.ServiceModels.Complete; @@ -22,7 +23,7 @@ internal static CompleteConversionProjectServiceModel FromDomain(IProject projec project.Details.HeadTeacherBoardDate.ToString(), conditions, project.Details.ProposedConversionDate.ToString(), - true, + project.Details.AcademyTypeAndRoute?.Equals("Sponsored") ?? false, email, firstName, lastName, @@ -47,7 +48,7 @@ internal static CompleteFormAMatConversionProjectServiceModel FormAMatFromDomain project.Details.HeadTeacherBoardDate.ToString(), conditions, project.Details.ProposedConversionDate.ToString(), - true, + project.Details.AcademyTypeAndRoute?.Equals("Sponsored") ?? false, email, firstName, lastName, diff --git a/Dfe.Academies.Academisation.Service/Mappers/CompleteProjects/CompleteTransferProjectServiceModelMapper.cs b/Dfe.Academies.Academisation.Service/Mappers/CompleteProjects/CompleteTransferProjectServiceModelMapper.cs index 9e0e04c06..feca23eae 100644 --- a/Dfe.Academies.Academisation.Service/Mappers/CompleteProjects/CompleteTransferProjectServiceModelMapper.cs +++ b/Dfe.Academies.Academisation.Service/Mappers/CompleteProjects/CompleteTransferProjectServiceModelMapper.cs @@ -81,7 +81,7 @@ internal static CompleteFormAMatTransferProjectServiceModel FormAMatFromDomain(I // Transfer projects aren't currently added to groups null, // Need the trust reference number, proposed trust name is held in the incoming trust name field - "TrustReferenceNumber", + "trustreferencenumber", incomingName ); } diff --git a/Dfe.Academies.Academisation.WebApi/Services/CreateCompleteProjectsService.cs b/Dfe.Academies.Academisation.WebApi/Services/CreateCompleteProjectsService.cs index 90bb93958..487c97d7e 100644 --- a/Dfe.Academies.Academisation.WebApi/Services/CreateCompleteProjectsService.cs +++ b/Dfe.Academies.Academisation.WebApi/Services/CreateCompleteProjectsService.cs @@ -41,6 +41,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) await mediator.Send(new CreateCompleteConversionProjectsCommand(), stoppingToken); await mediator.Send(new CreateCompleteTransferProjectsCommand(), stoppingToken); await mediator.Send(new CreateCompleteFormAMatConversionProjectsCommand(), stoppingToken); + //await mediator.Send(new CreateCompleteFormAMatTransferProjectsCommand(), stoppingToken); } catch (Exception ex) { diff --git a/Dfe.Academies.Academisation.WebApi/appsettings.json b/Dfe.Academies.Academisation.WebApi/appsettings.json index 91a9ea8b5..e344f762e 100644 --- a/Dfe.Academies.Academisation.WebApi/appsettings.json +++ b/Dfe.Academies.Academisation.WebApi/appsettings.json @@ -23,5 +23,5 @@ "TransferCreation": "", "SuperAdmin": "" }, - "SendProjectsToComplete" : "true" + "SendProjectsToComplete" : "false" }