From ab20913e21c2d26520bb99527a3b8d7fb715b268 Mon Sep 17 00:00:00 2001 From: plockwood Date: Tue, 29 Oct 2024 12:42:11 +0000 Subject: [PATCH] fix to only bring back projects to enrich which have a trust reference number --- .../Repositories/ConversionProjectRepository.cs | 8 +++++++- .../Commands/Legacy/Project/EnrichProjectCommand.cs | 6 +----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Dfe.Academies.Academisation.Data/Repositories/ConversionProjectRepository.cs b/Dfe.Academies.Academisation.Data/Repositories/ConversionProjectRepository.cs index e6ff4594c..0b4b764cc 100644 --- a/Dfe.Academies.Academisation.Data/Repositories/ConversionProjectRepository.cs +++ b/Dfe.Academies.Academisation.Data/Repositories/ConversionProjectRepository.cs @@ -92,7 +92,13 @@ private static IQueryable FilterGroupedProjects(IQueryable que public async Task?> GetIncompleteProjects() { var createdProjectState = await _context.Projects - .Where(p => string.IsNullOrEmpty(p.Details.LocalAuthority) || string.IsNullOrEmpty(p.Details.Region) || string.IsNullOrEmpty(p.Details.SchoolPhase) || string.IsNullOrEmpty(p.Details.SchoolType) || (p.Details.TrustUkprn == null && p.Details.IsFormAMat == false)) + .Where(p => + string.IsNullOrEmpty(p.Details.LocalAuthority) || + string.IsNullOrEmpty(p.Details.Region) || + string.IsNullOrEmpty(p.Details.SchoolPhase) || + string.IsNullOrEmpty(p.Details.SchoolType) || + // we need projects that have a trust associated that aren't form a mat that require a trust ukprn + (p.Details.TrustUkprn == null && p.Details.IsFormAMat == false && p.Details.TrustReferenceNumber != null)) .ToListAsync(); return createdProjectState; diff --git a/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/EnrichProjectCommand.cs b/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/EnrichProjectCommand.cs index 008b13e6d..d4c1d87a9 100644 --- a/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/EnrichProjectCommand.cs +++ b/Dfe.Academies.Academisation.Service/Commands/Legacy/Project/EnrichProjectCommand.cs @@ -1,15 +1,11 @@ -using System.Net.Http.Json; -using Dfe.Academies.Academisation.Data.Http; -using Dfe.Academies.Academisation.Data.ProjectAggregate; +using Dfe.Academies.Academisation.Data.ProjectAggregate; using Dfe.Academies.Academisation.Domain.ApplicationAggregate; using Dfe.Academies.Academisation.IService.Commands.Legacy.Project; using Dfe.Academies.Academisation.IService.Query; -using Dfe.Academies.Academisation.IService.ServiceModels.Academies; using Dfe.Academies.Academisation.IService.ServiceModels.Legacy.ProjectAggregate; using Dfe.Academies.Academisation.Service.Mappers.Legacy.ProjectAggregate; using Dfe.Academies.Contracts.V4.Establishments; using Dfe.Academies.Contracts.V4.Trusts; -using Dfe.Academisation.CorrelationIdMiddleware; using Microsoft.Extensions.Logging; namespace Dfe.Academies.Academisation.Service.Commands.Legacy.Project