Skip to content

Commit

Permalink
Added new field for not applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
zhodges-nimble committed Oct 7, 2024
1 parent 95a4cc0 commit 2ab1cdd
Show file tree
Hide file tree
Showing 11 changed files with 12,975 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public class OfstedInspectionTask

public bool? SharedOutcomeWithTrust { get; set; }

public YesNoNotApplicable? InspectionConditionsMet { get; set; }
public string InspectionConditionsMet { get; set; }

public string InspectionConditionsMetNotApplicable { get; set; }

public bool? ProposedToOpenOnGias { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public async Task Patch_NewOfstedInspection_Returns_201()
OfstedAndTrustLiaisonDetailsConfirmed = true,
BlockAndContentDetailsToOpenersSpreadSheet = true,
SharedOutcomeWithTrust = true,
InspectionConditionsMet = YesNoNotApplicable.Yes,
InspectionConditionsMetNotApplicable = "Not applicable",
InspectionConditionsMet = null,
ProposedToOpenOnGias = true,
SavedToWorkplaces = true,
DateInspectionsAndAnyActionsCompleted = new DateTime().Date.AddDays(10)
Expand All @@ -48,8 +49,8 @@ public async Task Patch_NewOfstedInspection_Returns_201()
.Be(request.OfstedInspection.BlockAndContentDetailsToOpenersSpreadSheet);
projectResponse.OfstedInspection.SharedOutcomeWithTrust.Should()
.Be(request.OfstedInspection.SharedOutcomeWithTrust);
projectResponse.OfstedInspection.InspectionConditionsMet.Should()
.Be(request.OfstedInspection.InspectionConditionsMet);
projectResponse.OfstedInspection.InspectionConditionsMetNotApplicable.Should()
.Be(request.OfstedInspection.InspectionConditionsMetNotApplicable);
projectResponse.OfstedInspection.ProposedToOpenOnGias.Should()
.Be(request.OfstedInspection.ProposedToOpenOnGias);
projectResponse.OfstedInspection.SavedToWorkplaces.Should()
Expand Down Expand Up @@ -80,7 +81,8 @@ public async Task Patch_ExistingOfstedInspection_Returns_201()
OfstedAndTrustLiaisonDetailsConfirmed = false,
BlockAndContentDetailsToOpenersSpreadSheet = false,
SharedOutcomeWithTrust = false,
InspectionConditionsMet = YesNoNotApplicable.NotApplicable,
InspectionConditionsMetNotApplicable = null,
InspectionConditionsMet = "No",
ProposedToOpenOnGias = false,
SavedToWorkplaces = false,
DateInspectionsAndAnyActionsCompleted = null
Expand All @@ -101,8 +103,8 @@ public async Task Patch_ExistingOfstedInspection_Returns_201()
.Be(request.OfstedInspection.BlockAndContentDetailsToOpenersSpreadSheet);
projectResponse.OfstedInspection.SharedOutcomeWithTrust.Should()
.Be(request.OfstedInspection.SharedOutcomeWithTrust);
projectResponse.OfstedInspection.InspectionConditionsMet.Should()
.Be(request.OfstedInspection.InspectionConditionsMet);
projectResponse.OfstedInspection.InspectionConditionsMetNotApplicable.Should()
.Be(request.OfstedInspection.InspectionConditionsMetNotApplicable);
projectResponse.OfstedInspection.ProposedToOpenOnGias.Should()
.Be(request.OfstedInspection.ProposedToOpenOnGias);
projectResponse.OfstedInspection.SavedToWorkplaces.Should()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,23 @@ public static class OfstedInspectionTaskBuilder
public static OfstedInspectionTask Build(Milestones milestones)
{
if (milestones == null)
{
return new OfstedInspectionTask();
}

return new OfstedInspectionTask
{
ProcessDetailsProvided = milestones.FsgPreOpeningMilestonesProcessDetailsProvided,
InspectionBlockDecided = milestones.FsgPreOpeningMilestonesInspectionBlockDecided,
OfstedAndTrustLiaisonDetailsConfirmed = milestones.FsgPreOpeningMilestonesOfstedAndTrustLiaisonDetailsConfirmed,
BlockAndContentDetailsToOpenersSpreadSheet = milestones.FsgPreOpeningMilestonesBlockAndContentDetailsToOpenersSpreadSheet,
OfstedAndTrustLiaisonDetailsConfirmed =
milestones.FsgPreOpeningMilestonesOfstedAndTrustLiaisonDetailsConfirmed,
BlockAndContentDetailsToOpenersSpreadSheet =
milestones.FsgPreOpeningMilestonesBlockAndContentDetailsToOpenersSpreadSheet,
SharedOutcomeWithTrust = milestones.FsgPreOpeningMilestonesSharedOutcomeWithTrust,
ProposedToOpenOnGias = milestones.FsgPreOpeningMilestonesProposedToOpenOnGias,
SavedToWorkplaces = milestones.FsgPreOpeningMilestonesDocumentsAndG6SavedToWorkplaces,
InspectionConditionsMet = InspectionConditionsMet(milestones.FsgPreOpeningMilestonesInspectionConditionsMet),
InspectionConditionsMetNotApplicable = milestones.FsgPreOpeningInspectionConditionsMetNotApplicable,
InspectionConditionsMet = milestones.FsgPreOpeningMilestonesInspectionConditionsMet,
DateInspectionsAndAnyActionsCompleted = milestones.FsgPreOpeningMilestonesOprActualDateOfCompletion
};

}

private static YesNoNotApplicable? InspectionConditionsMet(string condition)
{
return condition switch
{
"Yes" => YesNoNotApplicable.Yes,
"No" => YesNoNotApplicable.No,
"Not applicable" => YesNoNotApplicable.NotApplicable,
_ => null
};
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ public async Task Update(UpdateTaskServiceParameters parameters)
db.FsgPreOpeningMilestonesOfstedAndTrustLiaisonDetailsConfirmed = task.OfstedAndTrustLiaisonDetailsConfirmed;
db.FsgPreOpeningMilestonesBlockAndContentDetailsToOpenersSpreadSheet = task.BlockAndContentDetailsToOpenersSpreadSheet;
db.FsgPreOpeningMilestonesSharedOutcomeWithTrust = task.SharedOutcomeWithTrust;
db.FsgPreOpeningMilestonesInspectionConditionsMet = task.InspectionConditionsMet.ToDescription();
db.FsgPreOpeningMilestonesProposedToOpenOnGias = task.ProposedToOpenOnGias;
db.FsgPreOpeningMilestonesDocumentsAndG6SavedToWorkplaces = task.SavedToWorkplaces;
db.FsgPreOpeningMilestonesOprActualDateOfCompletion = task.DateInspectionsAndAnyActionsCompleted;
db.FsgPreOpeningInspectionConditionsMetNotApplicable = task.InspectionConditionsMetNotApplicable;
db.FsgPreOpeningMilestonesInspectionConditionsMet = task.InspectionConditionsMet;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,7 @@ public partial class Milestones
public bool? PFACMSentAnEmailToTheTrust { get; set; }

public string PFACMWhyAMeetingWasNotHeld { get; set; }

public string FsgPreOpeningInspectionConditionsMetNotApplicable { get; set; }
}
}
Loading

0 comments on commit 2ab1cdd

Please sign in to comment.