Skip to content

Commit

Permalink
Merge pull request #910 from DFE-Digital/release/0-14-1
Browse files Browse the repository at this point in the history
Release/0 14 1
  • Loading branch information
sukhybhullar-nimble authored Oct 15, 2024
2 parents 60530e5 + 79dc091 commit 0adce45
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Dfe.ManageFreeSchoolProjects.API.Contracts.Project;
using Dfe.ManageFreeSchoolProjects.API.UseCases.Project.Tasks.School;

namespace Dfe.ManageFreeSchoolProjects.API.Tests.UseCases.Project.Tasks.School
{
public class BuildSpecialistResourceProvisionTest
{
[Theory]
[InlineData(ClassType.SpecialEducationNeeds.NotSet, ClassType.AlternativeProvision.NotSet, null)]
[InlineData(ClassType.SpecialEducationNeeds.NotSet, ClassType.AlternativeProvision.No, "No")]
[InlineData(ClassType.SpecialEducationNeeds.NotSet, ClassType.AlternativeProvision.Yes, "Yes")]
[InlineData(ClassType.SpecialEducationNeeds.Yes, ClassType.AlternativeProvision.NotSet, "Yes")]
[InlineData(ClassType.SpecialEducationNeeds.Yes, ClassType.AlternativeProvision.No, "Yes")]
[InlineData(ClassType.SpecialEducationNeeds.Yes, ClassType.AlternativeProvision.Yes, "Yes")]
[InlineData(ClassType.SpecialEducationNeeds.No, ClassType.AlternativeProvision.NotSet, "No")]
[InlineData(ClassType.SpecialEducationNeeds.No, ClassType.AlternativeProvision.No, "No")]
[InlineData(ClassType.SpecialEducationNeeds.No, ClassType.AlternativeProvision.Yes, "Yes")]
public void TestBasedOnState(ClassType.SpecialEducationNeeds specialEducationNeeds,
ClassType.AlternativeProvision alternativeProvision,
string expected)
{
var result = BuildSpecialistResourceProvision
.GetLegacySpecialistResourceProvision(specialEducationNeeds, alternativeProvision);

result.Should().Be(expected);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Dfe.ManageFreeSchoolProjects.Data.Entities.Existing;
using Dfe.ManageFreeSchoolProjects.API.Constants;
using Microsoft.EntityFrameworkCore;
using Dfe.ManageFreeSchoolProjects.API.UseCases.Project.Tasks.School;

namespace Dfe.ManageFreeSchoolProjects.API.UseCases.Project
{
Expand Down Expand Up @@ -115,6 +116,9 @@ private static Kpi MapToKpi(ProjectDetails proj, string rid, Trust trust)
SchoolDetailsNursery = proj.Nursery.ToString(),
SchoolDetailsAlternativeProvision = proj.AlternativeProvision.ToString(),
SchoolDetailsSpecialEducationNeeds = proj.SpecialEducationNeeds.ToString(),
SchoolDetailsSpecialistResourceProvision = BuildSpecialistResourceProvision
.GetLegacySpecialistResourceProvision(proj.SpecialEducationNeeds,
proj.AlternativeProvision),
SchoolDetailsResidentialOrBoardingProvision = proj.ResidentialOrBoarding.ToString(),
SchoolDetailsAgeRange = proj.AgeRange,
SchoolDetailsNumberOfFormsOfEntry = proj.FormsOfEntry,
Expand Down Expand Up @@ -156,5 +160,7 @@ private async Task<Trust> GetTrust(string trustRef)

return result;
}


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Dfe.ManageFreeSchoolProjects.API.Contracts.Project;

namespace Dfe.ManageFreeSchoolProjects.API.UseCases.Project.Tasks.School
{
public class BuildSpecialistResourceProvision
{
public static string GetLegacySpecialistResourceProvision(ClassType.SpecialEducationNeeds specialEducationNeeds,
ClassType.AlternativeProvision alternativeProvision)
{
if (specialEducationNeeds == ClassType.SpecialEducationNeeds.Yes ||
alternativeProvision == ClassType.AlternativeProvision.Yes)
{
return "Yes";
}

if (specialEducationNeeds == ClassType.SpecialEducationNeeds.NotSet &&
alternativeProvision == ClassType.AlternativeProvision.NotSet)
{
return null;
}

return "No";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public async Task Update(UpdateTaskServiceParameters parameters)
dbKpi.SchoolDetailsSixthForm = task.SixthForm.ToString();
dbKpi.SchoolDetailsAlternativeProvision = task.AlternativeProvision.ToString();
dbKpi.SchoolDetailsSpecialEducationNeeds = task.SpecialEducationNeeds.ToString();
dbKpi.SchoolDetailsSpecialistResourceProvision = BuildSpecialistResourceProvision
.GetLegacySpecialistResourceProvision(task.SpecialEducationNeeds,
task.AlternativeProvision);
dbKpi.SchoolDetailsResidentialOrBoardingProvision = task.ResidentialOrBoarding.ToString();

dbKpi.SchoolDetailsFaithStatus = faithStatus;
Expand Down
4 changes: 3 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.14.1
* 175058 - Fixed legacy SRP field not being set in the database

## 0.14.0
* 177717 - Build: Create central route projects
* 178172 - Build: Iterate funding agreement health check and submission
Expand All @@ -8,7 +11,6 @@
* 181757 - Build: finance plan agreed forecast date
* 181754 - Build: readiness to open meeting (ROM) forecast date
* 183590 - BUG: Start End Year component still refers to "start date" in error message
* 180341 - Build: MFSP team to amend the footer
* 182832 - Build: Remove ‘section 9 letter’ from Workplaces checkbox
* 183515 - Build: read-only site information

Expand Down

0 comments on commit 0adce45

Please sign in to comment.