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

form a mat editable and grouping of form a mat project #991

Merged
merged 22 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d09d2d6
Form a mat changes for showing schools in mat
paullocknimble Jan 31, 2024
1912214
Merge branch 'main' into feature/form-a-mat-editable
paullocknimble Jan 31, 2024
3a3c95a
Landing page for form a mat
paullocknimble Jan 31, 2024
a663ed5
project list in form a mat changed to standard project list row item
paullocknimble Jan 31, 2024
2b8425e
tab rename
paullocknimble Jan 31, 2024
5eda36c
Merge branch 'main' into feature/form-a-mat-editable
paullocknimble Jan 31, 2024
340a535
Form a mat grouping changes
paullocknimble Feb 1, 2024
cadd2fc
Remove spreadsheet logic from form a mat page
Feb 7, 2024
5be6203
Back button on FAM parent object now goes to FAM list
Feb 7, 2024
8e17923
Return to FAM or Conversions based on referrer
Feb 8, 2024
ce2316f
Assigned user is now using a new endpoint
Feb 9, 2024
f1d1b3e
Assigning a user to parent FAM sets to empty children
Feb 9, 2024
f2a5987
Sepearting out SetProject to SetFAM for specific Famm case
Feb 12, 2024
4cc2a35
Form a mat parent index page now has it's own logic rather than pulli…
Feb 12, 2024
b9eb60a
Split out project assignment for parent
Feb 13, 2024
ae8059c
Statuses are aggregate and displayed on list
Feb 13, 2024
36343ea
Reintroduced Application form to child FAM projects
Feb 13, 2024
2ae337c
Pagination for FAM fixed
Feb 14, 2024
682d931
Back link fixes
paullocknimble Feb 15, 2024
5898740
Merge branch 'main' into feature/form-a-mat-editable
paullocknimble Feb 16, 2024
460111e
test fixes and navigation back link tweak
paullocknimble Feb 16, 2024
7a20611
path change
paullocknimble Feb 16, 2024
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 @@ -38,7 +38,11 @@ public async Task<HttpResponseMessage> GetProjectByIdAsync(int id)
HttpResponseMessage getProjectResponse = await AcademisationClient.GetAsync(string.Format(PathFor.GetProjectById, id));
return getProjectResponse;
}

public async Task<HttpResponseMessage> GetFormAMatProjectById(int id)
{
HttpResponseMessage getProjectResponse = await AcademisationClient.GetAsync(string.Format(PathFor.GetFormAMatProjectById, id));
return getProjectResponse;
}
public async Task<HttpResponseMessage> UpdateProjectAsync(int id, UpdateAcademyConversionProject updateProject)
{
return await AcademisationClient.PatchAsync(string.Format(PathFor.UpdateProject, id), JsonContent.Create(updateProject));
Expand Down Expand Up @@ -93,8 +97,32 @@ public async Task<HttpResponseMessage> SetSchoolOverview(int id, SetSchoolOvervi
var formattedString = string.Format(PathFor.SetSchoolOverview, id);
return await AcademisationClient.PutAsync(formattedString, JsonContent.Create(payload));
}
public async Task<HttpResponseMessage> SetAssignedUser(int id, SetAssignedUserModel updatedAssignedUser)
{
var payload = new
{
id = updatedAssignedUser.Id,
userId = updatedAssignedUser.UserId,
fullName = updatedAssignedUser.FullName,
emailAddress = updatedAssignedUser.EmailAddress
};

var formattedString = string.Format(PathFor.SetAssignedUser, id);
return await AcademisationClient.PutAsync(formattedString, JsonContent.Create(payload));
}
public async Task<HttpResponseMessage> SetFormAMatAssignedUser(int id, SetAssignedUserModel updatedAssignedUser)
{
var payload = new
{
id = updatedAssignedUser.Id,
userId = updatedAssignedUser.UserId,
fullName = updatedAssignedUser.FullName,
emailAddress = updatedAssignedUser.EmailAddress
};

var formattedString = string.Format(PathFor.SetFormAMatAssignedUser, id);
return await AcademisationClient.PutAsync(formattedString, JsonContent.Create(payload));
}
public async Task<HttpResponseMessage> GetAllProjectsV2Async(AcademyConversionSearchModelV2 searchModel)
{
return await AcademisationClient.PostAsync(PathFor.GetAllProjectsV2, JsonContent.Create(searchModel));
Expand All @@ -105,9 +133,9 @@ public async Task<HttpResponseMessage> SetPerformanceData(int id, SetPerformance
return await AcademisationClient.PutAsync(string.Format(PathFor.SetPerformanceData, id), JsonContent.Create(setPerformanceDataModel));
}

public async Task<HttpResponseMessage> GetMATProjectsAsync(AcademyConversionSearchModelV2 searchModel)
public async Task<HttpResponseMessage> GetFormAMatProjectsAsync(AcademyConversionSearchModelV2 searchModel)
{
return await AcademisationClient.PostAsync(PathFor.GetMATProjects, JsonContent.Create(searchModel));
return await AcademisationClient.PostAsync(PathFor.GetFormAMatProjects, JsonContent.Create(searchModel));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ public interface IApiClient
Task<HttpResponseMessage> DownloadProjectExport(AcademyConversionSearchModelV2 searchModel);
Task<HttpResponseMessage> GetAllProjectsV2Async(AcademyConversionSearchModelV2 searchModel);
Task<HttpResponseMessage> GetProjectByIdAsync(int id);
Task<HttpResponseMessage> GetFormAMatProjectById(int id);
Task<HttpResponseMessage> UpdateProjectAsync(int id, UpdateAcademyConversionProject updateProject);
Task<HttpResponseMessage> GetFilterParametersAsync();
Task<HttpResponseMessage> GetApplicationByReferenceAsync(string id);
Task<HttpResponseMessage> AddProjectNote(int id, AddProjectNote projectNote);

Task<HttpResponseMessage> SetProjectExternalApplicationForm(int id, bool externalApplicationFormSaved, string externalApplicationFormUrl);
Task<HttpResponseMessage> SetSchoolOverview(int id, SetSchoolOverviewModel updatedSchoolOverview);
Task<HttpResponseMessage> SetAssignedUser(int id, SetAssignedUserModel updatedAssignedUser);
Task<HttpResponseMessage> SetFormAMatAssignedUser(int id, SetAssignedUserModel updatedAssignedUser);
Task<HttpResponseMessage> SetPerformanceData(int id, SetPerformanceDataModel setPerformanceDataModel);
Task<HttpResponseMessage> GetMATProjectsAsync(AcademyConversionSearchModelV2 searchModel);
Task<HttpResponseMessage> GetFormAMatProjectsAsync(AcademyConversionSearchModelV2 searchModel);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ public PathFor(IFeatureManager features)
public static string GetAllProjects => "/legacy/projects";
public static string DownloadProjectExport => "/export/export-projects";
public static string GetProjectById => "/legacy/project/{0}";
public static string GetFormAMatProjectById => "/conversion-project/formamatproject/{0}";
public static string UpdateProject => "/legacy/project/{0}";
public static string GetFilterParameters => "/legacy/projects/status";
public static string AddProjectNote => "/legacy/project/{0}/notes";
public static string SetExternalApplicationForm => "/conversion-project/{0}/setExternalApplicationForm";
public static string SetPerformanceData => "/conversion-project/{0}/SetPerformanceData";
public static string SetSchoolOverview => "/conversion-project/{0}/SetSchoolOverview";
public static string SetAssignedUser => "/conversion-project/{0}/SetAssignedUser";
public static string SetFormAMatAssignedUser => "/conversion-project/{0}/SetFormAMatAssignedUser";

public static string GetAllProjectsV2 => "/conversion-project/projects";
public static string GetMATProjects => "/conversion-project/MATprojects";
public static string GetFormAMatProjects => "/conversion-project/FormAMatProjects";
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{
public int Id { get; set; }
public int? Urn { get; set; }
public int? FormAMatProjectId { get; set; }
public DateTime CreatedOn { get; set; }
public string SchoolName { get; set; }
public string SchoolPhase { get; set; }
Expand Down Expand Up @@ -59,7 +60,7 @@

// External Application Form
public bool? ExternalApplicationFormSaved { get; set; }
public string? ExternalApplicationFormUrl { get; set; }

Check warning on line 63 in Dfe.PrepareConversions/Dfe.PrepareConversions.Data/Models/AcademyConversionProject.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

// School Overview
public string PublishedAdmissionNumber { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,137 +1,14 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;

namespace Dfe.PrepareConversions.Data.Models;

public class FormAMATProject
public class FormAMatProject
{
public int Id { get; set; }
public int? Urn { get; set; }
public DateTime CreatedOn { get; set; }
public string SchoolName { get; set; }
public string SchoolPhase { get; set; }
public string SchoolType { get; set; }
public string LocalAuthority { get; set; }
public string ApplicationReferenceNumber { get; set; }
public string ProjectStatus { get; set; }
public DateTime? ApplicationReceivedDate { get; set; }
public DateTime? AssignedDate { get; set; }
public DateTime? HeadTeacherBoardDate { get; set; }
public DateTime? BaselineDate { get; set; }

//la summary page
public DateTime? LocalAuthorityInformationTemplateSentDate { get; set; }
public DateTime? LocalAuthorityInformationTemplateReturnedDate { get; set; }
public string LocalAuthorityInformationTemplateComments { get; set; }
public string LocalAuthorityInformationTemplateLink { get; set; }
public bool? LocalAuthorityInformationTemplateSectionComplete { get; set; }

//school/trust info
public string RecommendationForProject { get; set; }
public string Author { get; set; }
public string Version { get; set; }
public string ClearedBy { get; set; }
public string AcademyOrderRequired { get; set; }
public string PreviousHeadTeacherBoardDateQuestion { get; set; }
public DateTime? PreviousHeadTeacherBoardDate { get; set; }
public string PreviousHeadTeacherBoardLink { get; set; }
public string TrustReferenceNumber { get; set; }
public string NameOfTrust { get; set; }
public string SponsorReferenceNumber { get; set; }
public string SponsorName { get; set; }
public string AcademyTypeAndRoute { get; set; }
public string Form7Received { get; set; }
public DateTime? Form7ReceivedDate { get; set; }
public DateTime? ProposedAcademyOpeningDate { get; set; }
public bool? SchoolAndTrustInformationSectionComplete { get; set; }
public decimal? ConversionSupportGrantAmount { get; set; }
public string ConversionSupportGrantChangeReason { get; set; }
public string ConversionSupportGrantType { get; set; }
public string ConversionSupportGrantEnvironmentalImprovementGrant { get; set; }
public bool? ConversionSupportGrantAmountChanged { get; set; }
public string ConversionSupportGrantNumberOfSites { get; set; }
public DateTime? DaoPackSentDate { get; set; }
public string Region { get; set; }

// Annex B
public bool? AnnexBFormReceived { get; set; }
public string AnnexBFormUrl { get; set; }

// External Application Form
public bool? ExternalApplicationFormSaved { get; set; }
public string? ExternalApplicationFormUrl { get; set; }

// School Overview
public string PublishedAdmissionNumber { get; set; }
public string PartOfPfiScheme { get; set; }
public string PfiSchemeDetails { get; set; }
public string ViabilityIssues { get; set; }
public decimal? NumberOfPlacesFundedFor { get; set; }
public decimal? NumberOfResidentialPlaces { get; set; }
public decimal? NumberOfFundedResidentialPlaces { get; set; }
public string FinancialDeficit { get; set; }
public decimal? DistanceFromSchoolToTrustHeadquarters { get; set; }
public string DistanceFromSchoolToTrustHeadquartersAdditionalInformation { get; set; }
public string MemberOfParliamentNameAndParty { get; set; }
public bool? SchoolOverviewSectionComplete { get; set; }
public bool? PupilsAttendingGroupPermanentlyExcluded { get; set; }
public bool? PupilsAttendingGroupMedicalAndHealthNeeds { get; set; }
public bool? PupilsAttendingGroupTeenageMums { get; set; }
public int? NumberOfAlternativeProvisionPlaces { get; set; }
public int? NumberOfMedicalPlaces { get; set; }
public int? NumberOfPost16Places { get; set; }
public int? NumberOfSENUnitPlaces { get; set; }

//school performance ofsted information
public string SchoolPerformanceAdditionalInformation { get; set; }

// rationale
public string RationaleForProject { get; set; }
public string RationaleForTrust { get; set; }
public bool? RationaleSectionComplete { get; set; }

// risk and issues
public string RisksAndIssues { get; set; }
public bool? RisksAndIssuesSectionComplete { get; set; }

// legal requirements
public string GoverningBodyResolution { get; set; }
public string Consultation { get; set; }
public string DiocesanConsent { get; set; }
public string FoundationConsent { get; set; }
public bool? LegalRequirementsSectionComplete { get; set; }

// school budget info
public DateTime? EndOfCurrentFinancialYear { get; set; }
public decimal? RevenueCarryForwardAtEndMarchCurrentYear { get; set; }
public decimal? CapitalCarryForwardAtEndMarchCurrentYear { get; set; }
public DateTime? EndOfNextFinancialYear { get; set; }
public decimal? ProjectedRevenueBalanceAtEndMarchNextYear { get; set; }
public decimal? CapitalCarryForwardAtEndMarchNextYear { get; set; }
public string SchoolBudgetInformationAdditionalInformation { get; set; }
public bool? SchoolBudgetInformationSectionComplete { get; set; }

// pupil schools forecast
public int? YearOneProjectedCapacity { get; set; }
public int? YearOneProjectedPupilNumbers { get; set; }
public int? YearTwoProjectedCapacity { get; set; }
public int? YearTwoProjectedPupilNumbers { get; set; }
public int? YearThreeProjectedCapacity { get; set; }
public int? YearThreeProjectedPupilNumbers { get; set; }
public int? YearFourProjectedCapacity { get; set; }
public int? YearFourProjectedPupilNumbers { get; set; }
public string SchoolPupilForecastsAdditionalInformation { get; set; }

// key stage performance tables
public string KeyStage2PerformanceAdditionalInformation { get; set; }
public string KeyStage4PerformanceAdditionalInformation { get; set; }
public string KeyStage5PerformanceAdditionalInformation { get; set; }
public string EducationalAttendanceAdditionalInformation { get; set; }

// assigned user
public string ProposedTrustName { get; set; }
public string ApplicationReference { get; set; }
public User AssignedUser { get; set; }

// notes
public ICollection<ProjectNote> Notes { get; set; } = new List<ProjectNote>();
public ICollection<AcademyConversionProject> Projects { get; set; } = new List<AcademyConversionProject>();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;

namespace Dfe.PrepareConversions.Data.Models
{
public class SetAssignedUserModel
{
public SetAssignedUserModel() { }
public SetAssignedUserModel(
int id,
Guid userId,
string fullName,
string emailAddress)
{
Id = id;
UserId = userId;
FullName = fullName;
EmailAddress = emailAddress;
}

public int Id { get; set; }
public Guid UserId { get; set; }
public string FullName { get; set; }

public string EmailAddress { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ public async Task<ApiResponse<AcademyConversionProject>> GetProjectById(int id)
AcademyConversionProject project = await ReadFromJsonAndThrowIfNull<AcademyConversionProject>(response.Content);
return new ApiResponse<AcademyConversionProject>(response.StatusCode, project);
}
public async Task<ApiResponse<FormAMatProject>> GetFormAMatProjectById(int id)
{
HttpResponseMessage response = await _apiClient.GetFormAMatProjectById(id);
if (!response.IsSuccessStatusCode)
{
return new ApiResponse<FormAMatProject>(response.StatusCode, null);
}

FormAMatProject project = await ReadFromJsonAndThrowIfNull<FormAMatProject>(response.Content);
return new ApiResponse<FormAMatProject>(response.StatusCode, project);
}
public async Task<ApiResponse<AcademyConversionProject>> UpdateProject(int id, UpdateAcademyConversionProject updateProject)
{
ApiResponse<AcademyConversionProject> projectResponse = await GetProjectById(id);
Expand Down Expand Up @@ -250,6 +260,16 @@ public async Task SetSchoolOverview(int id, SetSchoolOverviewModel updatedSchool
HttpResponseMessage result = await _apiClient.SetSchoolOverview(id, updatedSchoolOverview);
if (result.IsSuccessStatusCode is false) throw new ApiResponseException($"Request to Api failed | StatusCode - {result.StatusCode}");
}
public async Task SetAssignedUser(int id, SetAssignedUserModel updatedAssignedUser)
{
HttpResponseMessage result = await _apiClient.SetAssignedUser(id, updatedAssignedUser);
if (result.IsSuccessStatusCode is false) throw new ApiResponseException($"Request to Api failed | StatusCode - {result.StatusCode}");
}
public async Task SetFormAMatAssignedUser(int id, SetAssignedUserModel updatedAssignedUser)
{
HttpResponseMessage result = await _apiClient.SetFormAMatAssignedUser(id, updatedAssignedUser);
if (result.IsSuccessStatusCode is false) throw new ApiResponseException($"Request to Api failed | StatusCode - {result.StatusCode}");
}

public async Task<ApiResponse<ApiV2Wrapper<IEnumerable<AcademyConversionProject>>>> GetAllProjectsV2(int page, int count, string titleFilter = "", IEnumerable<string> statusFilters = null, IEnumerable<string> deliveryOfficerFilter = null, IEnumerable<string> regionsFilter = null, IEnumerable<string> localAuthoritiesFilter = null, IEnumerable<string> advisoryBoardDatesFilter = null)
{
Expand All @@ -269,22 +289,22 @@ public async Task<ApiResponse<ApiV2Wrapper<IEnumerable<AcademyConversionProject>
return new ApiResponse<ApiV2Wrapper<IEnumerable<AcademyConversionProject>>>(response.StatusCode, outerResponse);
}

public async Task<ApiResponse<ApiV2Wrapper<IEnumerable<FormAMATProject>>>> GetMATProjects(int page, int count, string titleFilter = "", IEnumerable<string> statusFilters = null, IEnumerable<string> deliveryOfficerFilter = null, IEnumerable<string> regionsFilter = null, IEnumerable<string> localAuthoritiesFilter = null, IEnumerable<string> advisoryBoardDatesFilter = null)
public async Task<ApiResponse<ApiV2Wrapper<IEnumerable<FormAMatProject>>>> GetFormAMatProjects(int page, int count, string titleFilter = "", IEnumerable<string> statusFilters = null, IEnumerable<string> deliveryOfficerFilter = null, IEnumerable<string> regionsFilter = null, IEnumerable<string> localAuthoritiesFilter = null, IEnumerable<string> advisoryBoardDatesFilter = null)
{
AcademyConversionSearchModelV2 searchModel = new() { TitleFilter = titleFilter, Page = page, Count = count };

ProcessFiltersV2(statusFilters, deliveryOfficerFilter, searchModel, regionsFilter, localAuthoritiesFilter, advisoryBoardDatesFilter);

HttpResponseMessage response = await _apiClient.GetMATProjectsAsync(searchModel);
HttpResponseMessage response = await _apiClient.GetFormAMatProjectsAsync(searchModel);
if (!response.IsSuccessStatusCode)
{
return new ApiResponse<ApiV2Wrapper<IEnumerable<FormAMATProject>>>(response.StatusCode,
new ApiV2Wrapper<IEnumerable<FormAMATProject>> { Data = Enumerable.Empty<FormAMATProject>() });
return new ApiResponse<ApiV2Wrapper<IEnumerable<FormAMatProject>>>(response.StatusCode,
new ApiV2Wrapper<IEnumerable<FormAMatProject>> { Data = Enumerable.Empty<FormAMatProject>() });
}

ApiV2Wrapper<IEnumerable<FormAMATProject>> outerResponse = await response.Content.ReadFromJsonAsync<ApiV2Wrapper<IEnumerable<FormAMATProject>>>();
ApiV2Wrapper<IEnumerable<FormAMatProject>> outerResponse = await response.Content.ReadFromJsonAsync<ApiV2Wrapper<IEnumerable<FormAMatProject>>>();

return new ApiResponse<ApiV2Wrapper<IEnumerable<FormAMATProject>>>(response.StatusCode, outerResponse);
return new ApiResponse<ApiV2Wrapper<IEnumerable<FormAMatProject>>>(response.StatusCode, outerResponse);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
{
public int Page { get; set; }
public int RecordCount { get; set; }
public string NextPageUrl { get; set; }
public string? NextPageUrl { get; set; }

Check warning on line 7 in Dfe.PrepareConversions/Dfe.PrepareConversions.Data/Services/ApiV2PagingInfo.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Task<ApiResponse<ApiV2Wrapper<IEnumerable<AcademyConversionProject>>>> GetAllPro
IEnumerable<string> advisoryBoardDatesFilter = default
);

Task<ApiResponse<ApiV2Wrapper<IEnumerable<FormAMATProject>>>> GetMATProjects(
Task<ApiResponse<ApiV2Wrapper<IEnumerable<FormAMatProject>>>> GetFormAMatProjects(
int page,
int count,
string titleFilter = "",
Expand All @@ -51,9 +51,12 @@ Task<ApiResponse<ApiV2Wrapper<IEnumerable<FormAMATProject>>>> GetMATProjects(
);

Task<ApiResponse<AcademyConversionProject>> GetProjectById(int id);
Task<ApiResponse<FormAMatProject>> GetFormAMatProjectById(int id);
Task<ApiResponse<AcademyConversionProject>> UpdateProject(int id, UpdateAcademyConversionProject updateProject);
Task CreateProject(CreateNewProject newProject);
Task SetProjectExternalApplicationForm(int id, bool externalApplicationFormSaved, string externalApplicationFormUrl);
Task SetAssignedUser(int id, SetAssignedUserModel updatedAssignedUser);
Task SetFormAMatAssignedUser(int id, SetAssignedUserModel updatedAssignedUser);
Task SetSchoolOverview(int id, SetSchoolOverviewModel updatedSchoolOverview);
Task SetPerformanceData(int id, SetPerformanceDataModel setPerformanceDataModel);
Task<ApiResponse<ProjectFilterParameters>> GetFilterParameters();
Expand Down
Loading
Loading