From 2487ac349e90aaf348577c851518d75b9c0742f6 Mon Sep 17 00:00:00 2001 From: Chris Dexter <109349584+chrisdexnimble@users.noreply.github.com> Date: Mon, 5 Jun 2023 11:23:43 +0100 Subject: [PATCH 1/2] Replaced 'Involuntary' with 'Sponsored' --- ... => CreateSponsoredProjectCommandTests.cs} | 24 +++++++++---------- ...s => CreateSponsoredProjectDataCommand.cs} | 8 +++---- .../ProjectAggregate/InvoluntaryProject.cs | 6 ----- .../ProjectAggregate/SponsoredProject.cs | 6 +++++ .../ProjectAggregate/Project.cs | 2 +- ... => ICreateSponsoredProjectDataCommand.cs} | 4 ++-- ...d.cs => ICreateSponsoredProjectCommand.cs} | 4 ++-- ...del.cs => SponsoredProjectServiceModel.cs} | 10 ++++---- ...nd.cs => CreateSponsoredProjectCommand.cs} | 14 +++++------ .../ApplicationSubmitTests.cs | 4 ++-- .../LegacyProjectAddNoteTests.cs | 6 ++--- .../LegacyProjectGetStatusesTests.cs | 2 +- .../ProjectAggregate/LegacyProjectGetTests.cs | 2 +- .../LegacyProjectListGetTests.cs | 2 +- .../LegacyProjectUpdateTests.cs | 6 ++--- .../AutoMapper/AutoMapperSetup.cs | 6 ++--- .../Controllers/LegacyProjectController.cs | 16 ++++++------- Dfe.Academies.Academisation.WebApi/Program.cs | 4 ++-- Dfe.Academies.Academisation.sln | 3 ++- release-notes.md | 4 ++++ 20 files changed, 69 insertions(+), 64 deletions(-) rename Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/{CreateInvoluntaryProjectCommandTests.cs => CreateSponsoredProjectCommandTests.cs} (62%) rename Dfe.Academies.Academisation.Data/ProjectAggregate/{CreateInvoluntaryProjectDataCommand.cs => CreateSponsoredProjectDataCommand.cs} (77%) delete mode 100644 Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/InvoluntaryProject.cs create mode 100644 Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/SponsoredProject.cs rename Dfe.Academies.Academisation.IData/ProjectAggregate/{ICreateInvoluntaryProjectDataCommand.cs => ICreateSponsoredProjectDataCommand.cs} (60%) rename Dfe.Academies.Academisation.IService/Commands/Legacy/Project/{ICreateInvoluntaryProjectCommand.cs => ICreateSponsoredProjectCommand.cs} (63%) rename Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/{InvoluntaryProjectServiceModel.cs => SponsoredProjectServiceModel.cs} (56%) rename Dfe.Academies.Academisation.Service/Commands/Legacy/Project/{CreateInvoluntaryProjectCommand.cs => CreateSponsoredProjectCommand.cs} (55%) create mode 100644 release-notes.md diff --git a/Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateInvoluntaryProjectCommandTests.cs b/Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateSponsoredProjectCommandTests.cs similarity index 62% rename from Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateInvoluntaryProjectCommandTests.cs rename to Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateSponsoredProjectCommandTests.cs index 64b3d1724..0b5af9d40 100644 --- a/Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateInvoluntaryProjectCommandTests.cs +++ b/Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateSponsoredProjectCommandTests.cs @@ -11,14 +11,14 @@ namespace Dfe.Academies.Academisation.Data.UnitTest.ProjectAggregate { - public class CreateInvoluntaryProjectCommandTests + public class CreateSponsoredProjectCommandTests { - private readonly InvoluntaryProject _newProject; + private readonly SponsoredProject _newProject; private readonly AcademisationContext _context; private readonly IProjectCreateDataCommand _projectCreateDataCommand; private readonly Fixture _fixture; - public CreateInvoluntaryProjectCommandTests() + public CreateSponsoredProjectCommandTests() { _fixture = new Fixture(); ProjectState projectState = _fixture.Create(); @@ -29,18 +29,18 @@ public CreateInvoluntaryProjectCommandTests() _context.Projects.Add(projectState); _context.SaveChanges(); - _newProject = _fixture.Create(); + _newProject = _fixture.Create(); } - private CreateInvoluntaryProjectDataCommand System_under_test() + private CreateSponsoredProjectDataCommand System_under_test() { - return new CreateInvoluntaryProjectDataCommand(_projectCreateDataCommand); + return new CreateSponsoredProjectDataCommand(_projectCreateDataCommand); } [Fact] - public async Task Should_add_the_new_involuntary_project() + public async Task Should_add_the_new_sponsored_project() { - CreateInvoluntaryProjectDataCommand command = System_under_test(); + CreateSponsoredProjectDataCommand command = System_under_test(); await command.Execute(_newProject); @@ -50,18 +50,18 @@ public async Task Should_add_the_new_involuntary_project() [Fact] public async Task Should_return_error_if_school_is_null() { - CreateInvoluntaryProjectDataCommand command = System_under_test(); + CreateSponsoredProjectDataCommand command = System_under_test(); - var result = await command.Execute(new InvoluntaryProject(null, _fixture.Create())); + var result = await command.Execute(new SponsoredProject(null, _fixture.Create())); result.Should().BeOfType(); } [Fact] public async Task Should_return_error_if_join_trust_is_null() { - CreateInvoluntaryProjectDataCommand command = System_under_test(); + CreateSponsoredProjectDataCommand command = System_under_test(); - var result = await command.Execute(new InvoluntaryProject(_fixture.Create(), null)); + var result = await command.Execute(new SponsoredProject(_fixture.Create(), null)); result.Should().BeOfType(); } diff --git a/Dfe.Academies.Academisation.Data/ProjectAggregate/CreateInvoluntaryProjectDataCommand.cs b/Dfe.Academies.Academisation.Data/ProjectAggregate/CreateSponsoredProjectDataCommand.cs similarity index 77% rename from Dfe.Academies.Academisation.Data/ProjectAggregate/CreateInvoluntaryProjectDataCommand.cs rename to Dfe.Academies.Academisation.Data/ProjectAggregate/CreateSponsoredProjectDataCommand.cs index d16f23a76..d439366fc 100644 --- a/Dfe.Academies.Academisation.Data/ProjectAggregate/CreateInvoluntaryProjectDataCommand.cs +++ b/Dfe.Academies.Academisation.Data/ProjectAggregate/CreateSponsoredProjectDataCommand.cs @@ -5,17 +5,17 @@ namespace Dfe.Academies.Academisation.Data.ProjectAggregate { - public class CreateInvoluntaryProjectDataCommand : ICreateInvoluntaryProjectDataCommand + public class CreateSponsoredProjectDataCommand : ICreateSponsoredProjectDataCommand { private readonly IProjectCreateDataCommand _projectCreateDataCommand; - public CreateInvoluntaryProjectDataCommand(IProjectCreateDataCommand projectCreateDataCommand) + public CreateSponsoredProjectDataCommand(IProjectCreateDataCommand projectCreateDataCommand) { _projectCreateDataCommand = projectCreateDataCommand; } - public async Task Execute(Core.ProjectAggregate.InvoluntaryProject project) + public async Task Execute(Core.ProjectAggregate.SponsoredProject project) { - var domainServiceResult = Project.CreateInvoluntaryProject(project); + var domainServiceResult = Project.CreateSponsoredProject(project); switch (domainServiceResult) { diff --git a/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/InvoluntaryProject.cs b/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/InvoluntaryProject.cs deleted file mode 100644 index f4ea937c6..000000000 --- a/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/InvoluntaryProject.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Dfe.Academies.Academisation.Core.ProjectAggregate -{ - public record InvoluntaryProject(InvoluntaryProjectSchool? School, InvoluntaryProjectTrust? Trust); - public record InvoluntaryProjectTrust(string Name, string ReferenceNumber); - public record InvoluntaryProjectSchool(string Name, int Urn, DateTime? OpeningDate, bool? PartOfPfiScheme); -} diff --git a/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/SponsoredProject.cs b/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/SponsoredProject.cs new file mode 100644 index 000000000..dc2447ac1 --- /dev/null +++ b/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/SponsoredProject.cs @@ -0,0 +1,6 @@ +namespace Dfe.Academies.Academisation.Core.ProjectAggregate +{ + public record SponsoredProject(SponsoredProjectSchool? School, SponsoredProjectTrust? Trust); + public record SponsoredProjectTrust(string Name, string ReferenceNumber); + public record SponsoredProjectSchool(string Name, int Urn, DateTime? OpeningDate, bool? PartOfPfiScheme); +} diff --git a/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs b/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs index 29c943a90..7d769dbb8 100644 --- a/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs +++ b/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs @@ -115,7 +115,7 @@ public static CreateResult CreateFormAMat(IApplication application) return new CreateSuccessResult>(projectList); } - public static CreateResult CreateInvoluntaryProject(InvoluntaryProject project) + public static CreateResult CreateSponsoredProject(SponsoredProject project) { if (project.Trust == null) { diff --git a/Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateInvoluntaryProjectDataCommand.cs b/Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateSponsoredProjectDataCommand.cs similarity index 60% rename from Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateInvoluntaryProjectDataCommand.cs rename to Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateSponsoredProjectDataCommand.cs index 9ec801f73..5f2c302b7 100644 --- a/Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateInvoluntaryProjectDataCommand.cs +++ b/Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateSponsoredProjectDataCommand.cs @@ -4,8 +4,8 @@ namespace Dfe.Academies.Academisation.IData.ProjectAggregate { - public interface ICreateInvoluntaryProjectDataCommand + public interface ICreateSponsoredProjectDataCommand { - Task Execute(InvoluntaryProject project); + Task Execute(SponsoredProject project); } } diff --git a/Dfe.Academies.Academisation.IService/Commands/Legacy/Project/ICreateInvoluntaryProjectCommand.cs b/Dfe.Academies.Academisation.IService/Commands/Legacy/Project/ICreateSponsoredProjectCommand.cs similarity index 63% rename from Dfe.Academies.Academisation.IService/Commands/Legacy/Project/ICreateInvoluntaryProjectCommand.cs rename to Dfe.Academies.Academisation.IService/Commands/Legacy/Project/ICreateSponsoredProjectCommand.cs index f9b0f6889..0fa9412d4 100644 --- a/Dfe.Academies.Academisation.IService/Commands/Legacy/Project/ICreateInvoluntaryProjectCommand.cs +++ b/Dfe.Academies.Academisation.IService/Commands/Legacy/Project/ICreateSponsoredProjectCommand.cs @@ -3,8 +3,8 @@ namespace Dfe.Academies.Academisation.IService.Commands.Legacy.Project { - public interface ICreateInvoluntaryProjectCommand + public interface ICreateSponsoredProjectCommand { - Task Execute(InvoluntaryProjectServiceModel model); + Task Execute(SponsoredProjectServiceModel model); } } diff --git a/Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/InvoluntaryProjectServiceModel.cs b/Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/SponsoredProjectServiceModel.cs similarity index 56% rename from Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/InvoluntaryProjectServiceModel.cs rename to Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/SponsoredProjectServiceModel.cs index a544ea44a..e9e31886d 100644 --- a/Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/InvoluntaryProjectServiceModel.cs +++ b/Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/SponsoredProjectServiceModel.cs @@ -1,18 +1,18 @@ namespace Dfe.Academies.Academisation.IService.ServiceModels.Legacy.ProjectAggregate { - public class InvoluntaryProjectServiceModel + public class SponsoredProjectServiceModel { - public InvoluntaryProjectSchoolServiceModel? School { get; init; } - public InvoluntaryProjectTrustServiceModel? Trust { get; init; } + public SponsoredProjectSchoolServiceModel? School { get; init; } + public SponsoredProjectTrustServiceModel? Trust { get; init; } } - public class InvoluntaryProjectTrustServiceModel + public class SponsoredProjectTrustServiceModel { public string? Name { get; init; } public string? ReferenceNumber { get; init; } } - public class InvoluntaryProjectSchoolServiceModel + public class SponsoredProjectSchoolServiceModel { public string? Name { get; init; } public int Urn { get; init; } diff --git a/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateInvoluntaryProjectCommand.cs b/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateSponsoredProjectCommand.cs similarity index 55% rename from Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateInvoluntaryProjectCommand.cs rename to Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateSponsoredProjectCommand.cs index 00ac68a9c..7b0d9d135 100644 --- a/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateInvoluntaryProjectCommand.cs +++ b/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateSponsoredProjectCommand.cs @@ -7,22 +7,22 @@ namespace Dfe.Academies.Academisation.Service.Commands.Legacy.Project { - public class CreateInvoluntaryProjectCommand : ICreateInvoluntaryProjectCommand + public class CreateSponsoredProjectCommand : ICreateSponsoredProjectCommand { private readonly IMapper _mapper; - private readonly ICreateInvoluntaryProjectDataCommand _createInvoluntaryProjectDataCommand; + private readonly ICreateSponsoredProjectDataCommand _createSponsoredProjectDataCommand; - public CreateInvoluntaryProjectCommand( + public CreateSponsoredProjectCommand( IMapper mapper, - ICreateInvoluntaryProjectDataCommand createInvoluntaryProjectDataCommand) + ICreateSponsoredProjectDataCommand createSponsoredProjectDataCommand) { _mapper = mapper; - _createInvoluntaryProjectDataCommand = createInvoluntaryProjectDataCommand; + _createSponsoredProjectDataCommand = createSponsoredProjectDataCommand; } - public async Task Execute(InvoluntaryProjectServiceModel model) + public async Task Execute(SponsoredProjectServiceModel model) { - var result = await _createInvoluntaryProjectDataCommand.Execute(_mapper.Map(model)); + var result = await _createSponsoredProjectDataCommand.Execute(_mapper.Map(model)); if (result is CommandValidationErrorResult) { diff --git a/Dfe.Academies.Academisation.SubcutaneousTest/ApplicationAggregate/ApplicationSubmitTests.cs b/Dfe.Academies.Academisation.SubcutaneousTest/ApplicationAggregate/ApplicationSubmitTests.cs index ed64ca461..c8671ea1e 100644 --- a/Dfe.Academies.Academisation.SubcutaneousTest/ApplicationAggregate/ApplicationSubmitTests.cs +++ b/Dfe.Academies.Academisation.SubcutaneousTest/ApplicationAggregate/ApplicationSubmitTests.cs @@ -139,7 +139,7 @@ public async Task JoinAMatApplicationExists___ApplicationIsSubmitted_And_Project var projectController = new LegacyProjectController(new LegacyProjectGetQuery(new ProjectGetDataQuery(_context)), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), - Mock.Of()); + Mock.Of()); var projectResult = await projectController.Get(1); (_, LegacyProjectServiceModel project) = DfeAssert.OkObjectResult(projectResult); @@ -194,7 +194,7 @@ public async Task FormAMatApplicationExists___ApplicationIsSubmitted_And_Project var projectController = new LegacyProjectController(new LegacyProjectGetQuery(new ProjectGetDataQuery(_context)), new LegacyProjectListGetQuery(new ProjectListGetDataQuery(_context)), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), - Mock.Of()); + Mock.Of()); var projectResults = await projectController.GetProjects(new GetAcademyConversionSearchModel(1, 3, null, null, null, null, new[] { $"A2B_{createdPayload.ApplicationReference!}" })); (_, LegacyApiResponse projects) = DfeAssert.OkObjectResult(projectResults); diff --git a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectAddNoteTests.cs b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectAddNoteTests.cs index 52f0e5062..dbb6fc614 100644 --- a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectAddNoteTests.cs +++ b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectAddNoteTests.cs @@ -17,7 +17,7 @@ public class LegacyProjectAddNoteTests private readonly ILegacyProjectGetQuery _projectGetQuery; private readonly ILegacyProjectListGetQuery _projectListGetQuery; private readonly ILegacyProjectUpdateCommand _projectUpdateCommand; - private readonly ICreateInvoluntaryProjectCommand _createInvoluntaryProjectCommand; + private readonly ICreateSponsoredProjectCommand _createSponsoredProjectCommand; private ILegacyProjectDeleteNoteCommand _projectDeleteNoteCommand; public LegacyProjectAddNoteTests() @@ -28,7 +28,7 @@ public LegacyProjectAddNoteTests() _projectUpdateCommand = Mock.Of(); _projectAddNoteCommand = new Mock(); _projectDeleteNoteCommand = Mock.Of(); - _createInvoluntaryProjectCommand = Mock.Of(); + _createSponsoredProjectCommand = Mock.Of(); } private LegacyProjectController System_under_test() @@ -40,7 +40,7 @@ private LegacyProjectController System_under_test() _projectUpdateCommand, _projectAddNoteCommand.Object, _projectDeleteNoteCommand, - _createInvoluntaryProjectCommand); + _createSponsoredProjectCommand); } [Fact] diff --git a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectGetStatusesTests.cs b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectGetStatusesTests.cs index 72dc4995f..1810213b7 100644 --- a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectGetStatusesTests.cs +++ b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectGetStatusesTests.cs @@ -24,7 +24,7 @@ public LegacyProjectGetStatusesTests() IProjectGetStatusesQuery query = new ProjectGetStatusesQuery(dataQuery); _legacyProjectController = new LegacyProjectController(Mock.Of(), Mock.Of(), - query, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of()); + query, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of()); } [Fact] diff --git a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectGetTests.cs b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectGetTests.cs index 75175c62e..bf044eb24 100644 --- a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectGetTests.cs +++ b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectGetTests.cs @@ -29,7 +29,7 @@ public ProjectGetTests() _legacyProjectController = new LegacyProjectController(legacyProjectGetQuery, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), - Mock.Of(), Mock.Of()); + Mock.Of(), Mock.Of()); } [Fact] diff --git a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectListGetTests.cs b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectListGetTests.cs index dcfe03d47..9fe160ce4 100644 --- a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectListGetTests.cs +++ b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectListGetTests.cs @@ -27,7 +27,7 @@ public LegacyProjectListGetTests() _subject = new LegacyProjectController(Mock.Of(), legacyProjectGetQuery, Mock.Of(), Mock.Of(), Mock.Of(), - Mock.Of(),Mock.Of()); + Mock.Of(),Mock.Of()); } [Fact] diff --git a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectUpdateTests.cs b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectUpdateTests.cs index 4b247a965..ff883f9bf 100644 --- a/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectUpdateTests.cs +++ b/Dfe.Academies.Academisation.SubcutaneousTest/ProjectAggregate/LegacyProjectUpdateTests.cs @@ -47,7 +47,7 @@ public async Task ProjectExists___FullProjectIsUpdated() // Arrange var legacyProjectController = new LegacyProjectController(_legacyProjectGetQuery, Mock.Of(), Mock.Of(), _legacyProjectUpdateCommand, Mock.Of(), - Mock.Of(), Mock.Of()); + Mock.Of(), Mock.Of()); var existingProject = _fixture.Create(); await _context.Projects.AddAsync(existingProject); await _context.SaveChangesAsync(); @@ -75,7 +75,7 @@ public async Task ProjectExists_FullProjectIsReturnedOnGet() // Arrange var legacyProjectController = new LegacyProjectController(_legacyProjectGetQuery, Mock.Of(), Mock.Of(), _legacyProjectUpdateCommand, Mock.Of(), - Mock.Of(), Mock.Of()); + Mock.Of(), Mock.Of()); var existingProject = _fixture.Create(); await _context.Projects.AddAsync(existingProject); await _context.SaveChangesAsync(); @@ -105,7 +105,7 @@ public async Task ProjectExists___PartialProjectIsUpdated() // Arrange var legacyProjectController = new LegacyProjectController(_legacyProjectGetQuery, Mock.Of(), Mock.Of(), _legacyProjectUpdateCommand, Mock.Of(), - Mock.Of(), Mock.Of()); + Mock.Of(), Mock.Of()); var existingProject = _fixture.Create(); await _context.Projects.AddAsync(existingProject); diff --git a/Dfe.Academies.Academisation.WebApi/AutoMapper/AutoMapperSetup.cs b/Dfe.Academies.Academisation.WebApi/AutoMapper/AutoMapperSetup.cs index 9b1b3028b..39df0d117 100644 --- a/Dfe.Academies.Academisation.WebApi/AutoMapper/AutoMapperSetup.cs +++ b/Dfe.Academies.Academisation.WebApi/AutoMapper/AutoMapperSetup.cs @@ -22,9 +22,9 @@ public static void AddMappings(Profile profile) // .ForMember(x => x.DynamicsApplicationId, opt => opt.Ignore()); //profile.CreateMap(); profile.CreateMap(); - profile.CreateMap(); - profile.CreateMap(); - profile.CreateMap(); + profile.CreateMap(); + profile.CreateMap(); + profile.CreateMap(); // the mapping for this object is awkward because of the use of records, may have to re-think someof this but this is the best for now //profile.CreateMap().ReverseMap(); diff --git a/Dfe.Academies.Academisation.WebApi/Controllers/LegacyProjectController.cs b/Dfe.Academies.Academisation.WebApi/Controllers/LegacyProjectController.cs index c6517e3fd..3592cfd23 100644 --- a/Dfe.Academies.Academisation.WebApi/Controllers/LegacyProjectController.cs +++ b/Dfe.Academies.Academisation.WebApi/Controllers/LegacyProjectController.cs @@ -21,7 +21,7 @@ public class LegacyProjectController : ControllerBase private readonly ILegacyProjectListGetQuery _legacyProjectListGetQuery; private readonly ILegacyProjectUpdateCommand _legacyProjectUpdateCommand; private readonly IProjectGetStatusesQuery _projectGetStatusesQuery; - private readonly ICreateInvoluntaryProjectCommand _createInvoluntaryProjectCommand; + private readonly ICreateSponsoredProjectCommand _createSponsoredProjectCommand; public LegacyProjectController(ILegacyProjectGetQuery legacyProjectGetQuery, ILegacyProjectListGetQuery legacyProjectListGetQuery, @@ -29,7 +29,7 @@ public LegacyProjectController(ILegacyProjectGetQuery legacyProjectGetQuery, ILegacyProjectUpdateCommand legacyProjectUpdateCommand, ILegacyProjectAddNoteCommand legacyProjectAddNoteCommand, ILegacyProjectDeleteNoteCommand legacyProjectDeleteNoteCommand, - ICreateInvoluntaryProjectCommand createInvoluntaryProjectCommand) + ICreateSponsoredProjectCommand createSponsoredProjectCommand) { _legacyProjectGetQuery = legacyProjectGetQuery; _legacyProjectListGetQuery = legacyProjectListGetQuery; @@ -37,7 +37,7 @@ public LegacyProjectController(ILegacyProjectGetQuery legacyProjectGetQuery, _legacyProjectUpdateCommand = legacyProjectUpdateCommand; _legacyProjectAddNoteCommand = legacyProjectAddNoteCommand; _legacyProjectDeleteNoteCommand = legacyProjectDeleteNoteCommand; - _createInvoluntaryProjectCommand = createInvoluntaryProjectCommand; + _createSponsoredProjectCommand = createSponsoredProjectCommand; } /// @@ -150,17 +150,17 @@ public async Task AddNote(int id, AddNoteRequest note) } /// - /// Adds a involuntary conversion project + /// Adds a sponsored conversion project /// - /// The model holding the data required to create an Involuntary conversion + /// The model holding the data required to create a sponsored conversion /// The project has been added - [HttpPost("project/involuntary-conversion-project")] + [HttpPost("project/sponsored-conversion-project")] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status201Created)] - public async Task AddInvoluntaryConversion(InvoluntaryProjectServiceModel project) + public async Task AddSponsoredConversion(SponsoredProjectServiceModel project) { - CommandResult result = await _createInvoluntaryProjectCommand.Execute(project); + CommandResult result = await _createSponsoredProjectCommand.Execute(project); return result switch { diff --git a/Dfe.Academies.Academisation.WebApi/Program.cs b/Dfe.Academies.Academisation.WebApi/Program.cs index a599529a4..103d059ba 100644 --- a/Dfe.Academies.Academisation.WebApi/Program.cs +++ b/Dfe.Academies.Academisation.WebApi/Program.cs @@ -104,8 +104,8 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddScoped(); -builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); //Repositories builder.Services.AddScoped(); diff --git a/Dfe.Academies.Academisation.sln b/Dfe.Academies.Academisation.sln index ef14c8b4d..a9724821a 100644 --- a/Dfe.Academies.Academisation.sln +++ b/Dfe.Academies.Academisation.sln @@ -31,6 +31,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig README.md = README.md + release-notes.md = release-notes.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{5D372A37-BC9B-4476-A5E2-BC4DB7375768}" @@ -49,7 +50,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dfe.Academies.Academisation EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dfe.Academies.Academisation.SubcutaneousTest", "Dfe.Academies.Academisation.SubcutaneousTest\Dfe.Academies.Academisation.SubcutaneousTest.csproj", "{DFF6043C-B40F-4DC7-AFB0-8796CEC70D4C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dfe.Academies.Academisation.Seed", "Dfe.Academies.Academisation.Seed\Dfe.Academies.Academisation.Seed.csproj", "{FDA48BDF-BEA9-4235-BC75-2108CD9F0ECD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dfe.Academies.Academisation.Seed", "Dfe.Academies.Academisation.Seed\Dfe.Academies.Academisation.Seed.csproj", "{FDA48BDF-BEA9-4235-BC75-2108CD9F0ECD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/release-notes.md b/release-notes.md new file mode 100644 index 000000000..751b56eab --- /dev/null +++ b/release-notes.md @@ -0,0 +1,4 @@ +## 8.0.0 +* The term 'Involuntary Conversion' has been replaced with 'Sponsored Conversion'. This includes all Api endpoints. Note this release is required for the corresponding changes in the prepare-conversions application to work. + +--- \ No newline at end of file From e2bda5e17b4e977e85a3faeb2a7c1dbb246b5043 Mon Sep 17 00:00:00 2001 From: Chris Dexter <109349584+chrisdexnimble@users.noreply.github.com> Date: Mon, 5 Jun 2023 11:33:15 +0100 Subject: [PATCH 2/2] corrected namespace --- .../ProjectAggregate/CreateSponsoredProjectCommandTests.cs | 2 +- .../ProjectAggregate/CreateSponsoredProjectDataCommand.cs | 3 ++- .../ProjectAggregate/SponsoredProject.cs | 2 +- Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs | 1 - .../ProjectAggregate/ICreateSponsoredProjectDataCommand.cs | 2 +- .../Commands/Legacy/Project/CreateSponsoredProjectCommand.cs | 2 +- .../AutoMapper/AutoMapperSetup.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateSponsoredProjectCommandTests.cs b/Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateSponsoredProjectCommandTests.cs index 0b5af9d40..5a2c6bf24 100644 --- a/Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateSponsoredProjectCommandTests.cs +++ b/Dfe.Academies.Academisation.Data.UnitTest/ProjectAggregate/CreateSponsoredProjectCommandTests.cs @@ -2,9 +2,9 @@ using System.Threading.Tasks; using AutoFixture; using Dfe.Academies.Academisation.Core; -using Dfe.Academies.Academisation.Core.ProjectAggregate; using Dfe.Academies.Academisation.Data.ProjectAggregate; using Dfe.Academies.Academisation.Data.UnitTest.Contexts; +using Dfe.Academies.Academisation.Domain.Core.ProjectAggregate; using Dfe.Academies.Academisation.IData.ProjectAggregate; using FluentAssertions; using Xunit; diff --git a/Dfe.Academies.Academisation.Data/ProjectAggregate/CreateSponsoredProjectDataCommand.cs b/Dfe.Academies.Academisation.Data/ProjectAggregate/CreateSponsoredProjectDataCommand.cs index d439366fc..12da2d6c6 100644 --- a/Dfe.Academies.Academisation.Data/ProjectAggregate/CreateSponsoredProjectDataCommand.cs +++ b/Dfe.Academies.Academisation.Data/ProjectAggregate/CreateSponsoredProjectDataCommand.cs @@ -1,4 +1,5 @@ using Dfe.Academies.Academisation.Core; +using Dfe.Academies.Academisation.Domain.Core.ProjectAggregate; using Dfe.Academies.Academisation.Domain.ProjectAggregate; using Dfe.Academies.Academisation.IData.ProjectAggregate; using Dfe.Academies.Academisation.IDomain.ProjectAggregate; @@ -13,7 +14,7 @@ public CreateSponsoredProjectDataCommand(IProjectCreateDataCommand projectCreate _projectCreateDataCommand = projectCreateDataCommand; } - public async Task Execute(Core.ProjectAggregate.SponsoredProject project) + public async Task Execute(SponsoredProject project) { var domainServiceResult = Project.CreateSponsoredProject(project); diff --git a/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/SponsoredProject.cs b/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/SponsoredProject.cs index dc2447ac1..7100408fd 100644 --- a/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/SponsoredProject.cs +++ b/Dfe.Academies.Academisation.Domain.Core/ProjectAggregate/SponsoredProject.cs @@ -1,4 +1,4 @@ -namespace Dfe.Academies.Academisation.Core.ProjectAggregate +namespace Dfe.Academies.Academisation.Domain.Core.ProjectAggregate { public record SponsoredProject(SponsoredProjectSchool? School, SponsoredProjectTrust? Trust); public record SponsoredProjectTrust(string Name, string ReferenceNumber); diff --git a/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs b/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs index 7d769dbb8..8a49f51cb 100644 --- a/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs +++ b/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs @@ -1,5 +1,4 @@ using Dfe.Academies.Academisation.Core; -using Dfe.Academies.Academisation.Core.ProjectAggregate; using Dfe.Academies.Academisation.Domain.Core.ApplicationAggregate; using Dfe.Academies.Academisation.Domain.Core.ProjectAggregate; using Dfe.Academies.Academisation.IDomain.ApplicationAggregate; diff --git a/Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateSponsoredProjectDataCommand.cs b/Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateSponsoredProjectDataCommand.cs index 5f2c302b7..c8d7cde5e 100644 --- a/Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateSponsoredProjectDataCommand.cs +++ b/Dfe.Academies.Academisation.IData/ProjectAggregate/ICreateSponsoredProjectDataCommand.cs @@ -1,6 +1,6 @@  using Dfe.Academies.Academisation.Core; -using Dfe.Academies.Academisation.Core.ProjectAggregate; +using Dfe.Academies.Academisation.Domain.Core.ProjectAggregate; namespace Dfe.Academies.Academisation.IData.ProjectAggregate { diff --git a/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateSponsoredProjectCommand.cs b/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateSponsoredProjectCommand.cs index 7b0d9d135..59047ef9e 100644 --- a/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateSponsoredProjectCommand.cs +++ b/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/CreateSponsoredProjectCommand.cs @@ -1,6 +1,6 @@ using AutoMapper; using Dfe.Academies.Academisation.Core; -using Dfe.Academies.Academisation.Core.ProjectAggregate; +using Dfe.Academies.Academisation.Domain.Core.ProjectAggregate; using Dfe.Academies.Academisation.IData.ProjectAggregate; using Dfe.Academies.Academisation.IService.Commands.Legacy.Project; using Dfe.Academies.Academisation.IService.ServiceModels.Legacy.ProjectAggregate; diff --git a/Dfe.Academies.Academisation.WebApi/AutoMapper/AutoMapperSetup.cs b/Dfe.Academies.Academisation.WebApi/AutoMapper/AutoMapperSetup.cs index 39df0d117..c7415acc2 100644 --- a/Dfe.Academies.Academisation.WebApi/AutoMapper/AutoMapperSetup.cs +++ b/Dfe.Academies.Academisation.WebApi/AutoMapper/AutoMapperSetup.cs @@ -1,7 +1,7 @@ using Ardalis.GuardClauses; using AutoMapper; -using Dfe.Academies.Academisation.Core.ProjectAggregate; using Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts; +using Dfe.Academies.Academisation.Domain.Core.ProjectAggregate; using Dfe.Academies.Academisation.IDomain.ApplicationAggregate; using Dfe.Academies.Academisation.IService.ServiceModels.Application; using Dfe.Academies.Academisation.IService.ServiceModels.Application.School;