diff --git a/Dfe.Academies.Academisation.Data/Establishment/EstablishmentGetDataQuery.cs b/Dfe.Academies.Academisation.Data/Establishment/EstablishmentGetDataQuery.cs index 63e9ac92..3ac968b0 100644 --- a/Dfe.Academies.Academisation.Data/Establishment/EstablishmentGetDataQuery.cs +++ b/Dfe.Academies.Academisation.Data/Establishment/EstablishmentGetDataQuery.cs @@ -22,7 +22,7 @@ public EstablishmentGetDataQuery(ILogger logger, IAca public async Task GetEstablishment(int urn) { var client = _academiesApiClientFactory.Create(_correlationContext); - var response = await client.GetAsync($"/establishment/urn/{urn}"); + var response = await client.GetAsync($"/establishment/urn/{urn}"); if (!response.IsSuccessStatusCode) { diff --git a/Dfe.Academies.Academisation.Data/ProjectAggregate/IncompleteProjectsGetDataQuery.cs b/Dfe.Academies.Academisation.Data/ProjectAggregate/IncompleteProjectsGetDataQuery.cs index dd9ab89d..cb9fd17c 100644 --- a/Dfe.Academies.Academisation.Data/ProjectAggregate/IncompleteProjectsGetDataQuery.cs +++ b/Dfe.Academies.Academisation.Data/ProjectAggregate/IncompleteProjectsGetDataQuery.cs @@ -16,7 +16,7 @@ public IncompleteProjectsGetDataQuery(AcademisationContext context) public async Task?> GetIncompleteProjects() { var createdProjectState = await _context.Projects - .Where(p => string.IsNullOrEmpty(p.LocalAuthority) || string.IsNullOrEmpty(p.Region)) + .Where(p => string.IsNullOrEmpty(p.LocalAuthority) || string.IsNullOrEmpty(p.Region) || string.IsNullOrEmpty(p.SchoolPhase)) .ToListAsync(); return createdProjectState.Select(p => p.MapToDomain()); diff --git a/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs b/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs index 4d7bba64..8413b348 100644 --- a/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs +++ b/Dfe.Academies.Academisation.Domain/ProjectAggregate/Project.cs @@ -198,7 +198,7 @@ public CommandResult Update(ProjectDetails detailsToUpdate) Form7ReceivedDate = detailsToUpdate.Form7ReceivedDate, ProposedAcademyOpeningDate = detailsToUpdate.ProposedAcademyOpeningDate, SchoolAndTrustInformationSectionComplete = detailsToUpdate.SchoolAndTrustInformationSectionComplete, - ConversionSupportGrantAmount = CalculateDefaultSponsoredGrant(Details.ConversionSupportGrantType, detailsToUpdate.ConversionSupportGrantType, detailsToUpdate.ConversionSupportGrantAmount, detailsToUpdate.ConversionSupportGrantAmountChanged, detailsToUpdate.SchoolPhase), + ConversionSupportGrantAmount = CalculateDefaultSponsoredGrant(Details.ConversionSupportGrantType, detailsToUpdate.ConversionSupportGrantType, detailsToUpdate.ConversionSupportGrantAmount, detailsToUpdate.ConversionSupportGrantAmountChanged, detailsToUpdate.SchoolPhase ?? Details.SchoolPhase), ConversionSupportGrantChangeReason = NullifyGrantChangeReasonIfNeeded(detailsToUpdate.ConversionSupportGrantAmountChanged, detailsToUpdate.ConversionSupportGrantChangeReason, detailsToUpdate.AcademyTypeAndRoute), ConversionSupportGrantType = detailsToUpdate.ConversionSupportGrantType, ConversionSupportGrantEnvironmentalImprovementGrant = detailsToUpdate.ConversionSupportGrantEnvironmentalImprovementGrant, diff --git a/Dfe.Academies.Academisation.IData/Establishment/Establishment.cs b/Dfe.Academies.Academisation.IData/Establishment/Establishment.cs index a7449e33..d91070ef 100644 --- a/Dfe.Academies.Academisation.IData/Establishment/Establishment.cs +++ b/Dfe.Academies.Academisation.IData/Establishment/Establishment.cs @@ -8,11 +8,17 @@ public Establishment() } public string? LocalAuthorityName { get; set; } + public NameAndCodeResponse PhaseOfEducation { get; set; } public Region Gor { get; set; } public class Region { public string? Name { get; set; } } + public class NameAndCodeResponse + { + public string Name { get; set; } + public string Code { get; set; } + } } } diff --git a/Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/LegacyProjectServiceModel.cs b/Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/LegacyProjectServiceModel.cs index ce42022e..d58f12b5 100644 --- a/Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/LegacyProjectServiceModel.cs +++ b/Dfe.Academies.Academisation.IService/ServiceModels/Legacy/ProjectAggregate/LegacyProjectServiceModel.cs @@ -52,8 +52,8 @@ public LegacyProjectServiceModel(int id, int urn) public string? ConversionSupportGrantType { get; init; } public string? ConversionSupportGrantEnvironmentalImprovementGrant { get; init; } public bool? ConversionSupportGrantAmountChanged { get; init; } - public string? Region { get; init; } - [JsonIgnore] public string? SchoolPhase { get; init; } + public string? Region { get; init; } + public string? SchoolPhase { get; init; } [JsonIgnore] public string? AgeRange { get; init; } [JsonIgnore] public string? SchoolType { get; init; } [JsonIgnore] public int? ActualPupilNumbers { get; init; } diff --git a/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/EnrichProjectCommand.cs b/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/EnrichProjectCommand.cs index e49c0ddd..0f6482e4 100644 --- a/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/EnrichProjectCommand.cs +++ b/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/EnrichProjectCommand.cs @@ -48,7 +48,7 @@ public async Task Execute() var projectChanges = new LegacyProjectServiceModel(project.Id, project.Details.Urn) { - LocalAuthority = school.LocalAuthorityName, Region = school.Gor.Name + LocalAuthority = school.LocalAuthorityName, Region = school.Gor.Name, SchoolPhase = school.PhaseOfEducation.Name }; project.Update(LegacyProjectDetailsMapper.MapNonEmptyFields(projectChanges, project));