Skip to content

Commit

Permalink
Merge branch 'main' into feature/147094
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-nimbleapproach committed Sep 27, 2024
2 parents 0b3504c + 6aa7f21 commit 5bfcae9
Show file tree
Hide file tree
Showing 23 changed files with 348 additions and 274 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
deploy-image:
name: Deploy '${{ needs.set-env.outputs.branch }}' to ${{ needs.set-env.outputs.environment }}
needs: [ set-env ]
uses: DFE-Digital/deploy-azure-container-apps-action/.github/workflows/build-push-deploy.yml@v2.4.0
uses: DFE-Digital/deploy-azure-container-apps-action/.github/workflows/build-push-deploy.yml@v2.5.0
strategy:
matrix:
image: [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fi
- name: Validate Terraform docs
uses: terraform-docs/gh-actions@v1.2.0
uses: terraform-docs/gh-actions@v1.3.0
with:
working-dir: terraform
config-file: .terraform-docs.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ namespace Dfe.ManageFreeSchoolProjects.API.Contracts.Project.Tasks;

public class PrincipalDesignateTask
{
public YesNoNotApplicable? CommissionedExternalExpertVisitToSchool { get; set; }

public DateTime? ExpectedDatePrincipalDesignateAppointed { get; set; }

public bool? TrustAppointedPrincipalDesignate { get; set; }

public bool? TrustAppointedPrincipleDesignate { get; set; }

public DateTime? TrustAppointedPrincipleDesignateDate { get; set; }
public DateTime? ActualDatePrincipalDesignateAppointed { get; set; }

public YesNoNotApplicable? CommissionedExternalExpertVisitToSchool { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,22 @@ public async Task Patch_NewPrincipalDesignate_Returns_201()
{
PrincipalDesignate = new PrincipalDesignateTask()
{
TrustAppointedPrincipleDesignateDate = new DateTime().AddDays(9),
CommissionedExternalExpertVisitToSchool = YesNoNotApplicable.Yes
ActualDatePrincipalDesignateAppointed = new DateTime().AddDays(9),
CommissionedExternalExpertVisitToSchool = YesNoNotApplicable.Yes,
ExpectedDatePrincipalDesignateAppointed = new DateTime().AddDays(8),
}
};

var projectResponse = await _client.UpdateProjectTask(projectId, request, TaskName.PrincipalDesignate.ToString());

projectResponse.PrincipalDesignate.TrustAppointedPrincipleDesignate.Should()
projectResponse.PrincipalDesignate.TrustAppointedPrincipalDesignate.Should()
.Be(true);
projectResponse.PrincipalDesignate.TrustAppointedPrincipleDesignateDate.Should()
.Be(request.PrincipalDesignate.TrustAppointedPrincipleDesignateDate);
projectResponse.PrincipalDesignate.ActualDatePrincipalDesignateAppointed.Should()
.Be(request.PrincipalDesignate.ActualDatePrincipalDesignateAppointed);
projectResponse.PrincipalDesignate.CommissionedExternalExpertVisitToSchool.Should()
.Be(request.PrincipalDesignate.CommissionedExternalExpertVisitToSchool);
projectResponse.PrincipalDesignate.ExpectedDatePrincipalDesignateAppointed.Should()
.Be(request.PrincipalDesignate.ExpectedDatePrincipalDesignateAppointed);
}

[Fact]
Expand All @@ -60,9 +63,10 @@ public async Task Patch_ExistingPrincipalDesignate_Returns_201()
{
PrincipalDesignate = new PrincipalDesignateTask()
{
TrustAppointedPrincipleDesignate = false,
TrustAppointedPrincipleDesignateDate = null,
CommissionedExternalExpertVisitToSchool = YesNoNotApplicable.No
TrustAppointedPrincipalDesignate = false,
ActualDatePrincipalDesignateAppointed = null,
CommissionedExternalExpertVisitToSchool = YesNoNotApplicable.No,
ExpectedDatePrincipalDesignateAppointed = new DateTime().AddDays(8),
}
};

Expand All @@ -71,12 +75,14 @@ public async Task Patch_ExistingPrincipalDesignate_Returns_201()

var projectResponse = await _client.UpdateProjectTask(projectId, request, TaskName.PrincipalDesignate.ToString());

projectResponse.PrincipalDesignate.TrustAppointedPrincipleDesignate.Should()
projectResponse.PrincipalDesignate.TrustAppointedPrincipalDesignate.Should()
.Be(false);
projectResponse.PrincipalDesignate.TrustAppointedPrincipleDesignateDate.Should()
projectResponse.PrincipalDesignate.ActualDatePrincipalDesignateAppointed.Should()
.Be(null);
projectResponse.PrincipalDesignate.CommissionedExternalExpertVisitToSchool.Should()
.Be(request.PrincipalDesignate.CommissionedExternalExpertVisitToSchool);
projectResponse.PrincipalDesignate.ExpectedDatePrincipalDesignateAppointed.Should()
.Be(request.PrincipalDesignate.ExpectedDatePrincipalDesignateAppointed);
}

}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ public static PrincipalDesignateTask Build(Milestones milestones)

if (milestones.FsgPreOpeningMilestonesAppointedPrincipalDesignate == null && milestones.FsgPreOpeningMilestonesPdappActualDateOfCompletion.HasValue)
{
principleDesignateTask.TrustAppointedPrincipleDesignate =
principleDesignateTask.TrustAppointedPrincipalDesignate =
true;
}

else
{
principleDesignateTask.TrustAppointedPrincipleDesignate =
principleDesignateTask.TrustAppointedPrincipalDesignate =
milestones.FsgPreOpeningMilestonesAppointedPrincipalDesignate;
}

principleDesignateTask.TrustAppointedPrincipleDesignateDate =
principleDesignateTask.ActualDatePrincipalDesignateAppointed =
milestones.FsgPreOpeningMilestonesPdappActualDateOfCompletion;
principleDesignateTask.CommissionedExternalExpertVisitToSchool =
milestones.FsgPreOpeningMilestonesCommissionedExternalExpertVisitToSchool;
principleDesignateTask.ExpectedDatePrincipalDesignateAppointed = milestones.FsgPreOpeningMilestonesPdappForecastDate;

return principleDesignateTask;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ public async Task Update(UpdateTaskServiceParameters parameters)
_context.Add(db);
}

db.FsgPreOpeningMilestonesAppointedPrincipalDesignate = task.TrustAppointedPrincipleDesignate;
db.FsgPreOpeningMilestonesPdappActualDateOfCompletion = task.TrustAppointedPrincipleDesignateDate;
db.FsgPreOpeningMilestonesAppointedPrincipalDesignate = task.TrustAppointedPrincipalDesignate;
db.FsgPreOpeningMilestonesPdappActualDateOfCompletion = task.ActualDatePrincipalDesignateAppointed;
db.FsgPreOpeningMilestonesCommissionedExternalExpertVisitToSchool = task.CommissionedExternalExpertVisitToSchool;
db.FsgPreOpeningMilestonesPdappForecastDate = task.ExpectedDatePrincipalDesignateAppointed;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ private static ProjectByTaskSummaryResponse BuildProjectByTaskSummaryResponse(Kp
MovingToOpen = SafeRetrieveTaskSummary(projectTasks, TaskName.MovingToOpen.ToString()),
DueDiligenceChecks = SafeRetrieveTaskSummary(projectTasks, TaskName.DueDiligenceChecks.ToString()),
PreFundingAgreementCheckpointMeeting = SafeRetrieveTaskSummary(projectTasks, TaskName.PreFundingAgreementCheckpointMeeting.ToString()),
ReadinessToOpenMeeting = SafeRetrieveTaskSummary(projectTasks, TaskName.ReadinessToOpenMeeting.ToString())
ReadinessToOpenMeeting = SafeRetrieveTaskSummary(projectTasks, TaskName.ReadinessToOpenMeeting.ToString()),
PrincipalDesignate = SafeRetrieveTaskSummary(projectTasks, TaskName.PrincipalDesignate.ToString())
};

var applicationsEvidenceTask = SafeRetrieveTaskSummary(projectTasks, TaskName.ApplicationsEvidence.ToString());
Expand All @@ -97,7 +98,6 @@ private static ProjectByTaskSummaryResponse BuildProjectByTaskSummaryResponse(Kp
var fundingAgreementSubmissionTask = SafeRetrieveTaskSummary(projectTasks, "FundingAgreementSubmission");

result.ApplicationsEvidence = BuildApplicationsEvidenceTask(applicationsEvidenceTask, dbKpi);
result.PrincipalDesignate = BuildPrincipleDesignateTask(principalDesignateTask, dbKpi);
result.FundingAgreementHealthCheck =
BuildFundingAgreementHealthCheckTask(fundingAgreementHealthCheckTask, dbKpi);
result.FundingAgreementSubmission = BuildFundingAgreementSubmissionTask(fundingAgreementSubmissionTask, dbKpi);
Expand Down Expand Up @@ -137,21 +137,6 @@ private static TaskSummaryResponse BuildApplicationsEvidenceTask(TaskSummaryResp
return result;
}

private static TaskSummaryResponse BuildPrincipleDesignateTask(TaskSummaryResponse taskSummaryResponse, Kpi kpi)
{
var parameters = new PrincipalDesignateTaskSummaryBuilderParameters()
{
ApplicationWave = kpi.ProjectStatusFreeSchoolApplicationWave,
TaskSummary = taskSummaryResponse
};

var result = new PrincipalDesignateTaskSummaryBuilder().Build(parameters);

_tasksCount -= taskSummaryResponse.IsHidden ? 1 : 0;

return result;
}

private static TaskSummaryResponse BuildFundingAgreementHealthCheckTask(TaskSummaryResponse taskSummaryResponse,
Kpi kpi)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,115 @@ describe("Testing that we can change the project status", () => {
Logger.log("user is sent back to projects overview page");

projectOverviewPage
.hasWithdrawnDate("1 January 2045");
.hasWithdrawnDate("1 January 2045")
.clickChangeProjectStatus();

projectStatusPage
.selectOpen()
.clickSaveAndContine()

projectOverviewPage
.hasProjectStatus("Open")
.selectTaskListTab()
.clickChangeProjectStatus();

projectStatusPage
.openIsChecked()
.selectCancelled()
.clickSaveAndContine()
.errorForCancelledDate("Enter a date in the correct format")
.addCancelledYear("1", "1", "error")
.clickSaveAndContine()
.errorForCancelledDate("Enter a date in the correct format")
.addCancelledYear("1", "1", "1999")
.clickSaveAndContine()
.errorForCancelledDate("Year must be between 2000 and 2050")
.clickSaveAndContine()
.addCancelledYear("1", "1", "2051")
.errorForCancelledDate("Year must be between 2000 and 2050")
.addCancelledYear("1", "1", "2050")
.clickSaveAndContine()


Logger.log("user is sent back to tasklist");

taskListPage
.onTasklistTab()
.hasProjectStatus("Cancelled")
.selectAboutTheProjectTab()


Logger.log("cancelled date is shown on project overview");

projectOverviewPage
.hasCancelledDate("1 January 2050")
.selectContactsTab();


Logger.log("change status to closed");

contactsPage
.hasProjectStatus("Cancelled")
.clickChangeProjectStatus();

projectStatusPage
.cancelledIsChecked()
.cancelledYearHasValue("1", "1", "2050")
.selectClosed()
.clickSaveAndContine()
.errorForClosedDate("Enter a date in the correct format")
.addClosedYear("1", "1", "error")
.clickSaveAndContine()
.errorForClosedDate("Enter a date in the correct format")
.addClosedYear("1", "1", "1999")
.clickSaveAndContine()
.errorForClosedDate("Year must be between 2000 and 2050")
.clickSaveAndContine()
.addClosedYear("1", "1", "2051")
.errorForClosedDate("Year must be between 2000 and 2050")
.addClosedYear("1", "1", "2048")
.clickSaveAndContine()

Logger.log("user is sent back to contacts page");

contactsPage
.onContactsTab()
.hasProjectStatus("Closed")
.selectAboutTheProjectTab();

Logger.log("closed date is shown on project overview");

projectOverviewPage
.hasClosedDate("1 January 2048")

Logger.log("change status to withdrawn");

projectOverviewPage
.clickChangeProjectStatus()

projectStatusPage
.closedIsChecked()
.closedYearHasValue("1", "1", "2048")
.selectWithdrawn()
.clickSaveAndContine()
.errorForWithdrawnDate("Enter a date in the correct format")
.addWithdrawnYear("1", "1", "error")
.clickSaveAndContine()
.errorForWithdrawnDate("Enter a date in the correct format")
.addWithdrawnYear("1", "1", "1999")
.clickSaveAndContine()
.errorForWithdrawnDate("Year must be between 2000 and 2050")
.clickSaveAndContine()
.addWithdrawnYear("1", "1", "2051")
.errorForWithdrawnDate("Year must be between 2000 and 2050")
.addWithdrawnYear("1", "1", "2047")
.clickSaveAndContine()

Logger.log("user is sent back to projects overview page");

projectOverviewPage
.hasWithdrawnDate("1 January 2047")

});

it("Change status for Presumption project", () => {
Expand Down
Loading

0 comments on commit 5bfcae9

Please sign in to comment.