Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enriching School phase name #338

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public EstablishmentGetDataQuery(ILogger<EstablishmentGetDataQuery> logger, IAca
public async Task<IData.Establishment.Establishment?> 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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public IncompleteProjectsGetDataQuery(AcademisationContext context)
public async Task<IEnumerable<IProject>?> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Loading