Skip to content

Commit

Permalink
Merge pull request #905 from DFE-Digital/feature/137597-word-doc-spon…
Browse files Browse the repository at this point in the history
…sored

Feature/137597 word doc sponsored
  • Loading branch information
dneed-nimble authored Sep 8, 2023
2 parents 408a506 + d1649f7 commit eeb58da
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 12 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public HtbTemplate GenerateDocument(ApiResponse<AcademyConversionProject> respon
MemoryStream ms = CreateMemoryStream("htb-template");

DocumentBuilder documentBuilder = DocumentBuilder.CreateFromTemplate(ms, document);
AddSchoolAndTrustInfoAndProjectDates(documentBuilder, project);
AddSchoolOverview(documentBuilder, document);
AddSchoolAndTrustInfoAndProjectDates(documentBuilder, project);
AddOfstedInformation(documentBuilder, document, project);
AddRationale(documentBuilder, document, project);
AddRisksAndIssues(documentBuilder, document);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public static void AddLegalRequirements(IDocumentBuilder builder, HtbTemplate do
build.AddParagraph("");
});
}
else
{
builder.ReplacePlaceholderWithContent("LegalRequirements", build =>
{
});
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,18 @@ private static void AddLocalAuthorityAndSponsorDetails(IDocumentBuilder builder,
}
};

builder.ReplacePlaceholderWithContent("LocalAuthorityAndSponsorDetails", body => body.AddTable(localAuthorityAndSponsorDetails));
builder.ReplacePlaceholderWithContent("LocalAuthorityAndSponsorDetails", body =>
{
body.AddTable(localAuthorityAndSponsorDetails);
});
}
private static void AddAdvisoryBoardDetails(IDocumentBuilder builder, AcademyConversionProject project)
{
List<TextElement[]> advisoryBoardDetails = new()
{
new[]
{
new TextElement { Value = "Date of Advisory Board", Bold = true },
new TextElement { Value = "Date of advisory board", Bold = true },
new TextElement { Value = project.HeadTeacherBoardDate.ToDateString()}
},
new[]
Expand All @@ -56,7 +59,7 @@ private static void AddAdvisoryBoardDetails(IDocumentBuilder builder, AcademyCon
},
new[]
{
new TextElement { Value = "Previous Advisory Board", Bold = true },
new TextElement { Value = "Previous advisory board", Bold = true },
new TextElement { Value = project.PreviousHeadTeacherBoardDate.ToDateString() }
}
};
Expand All @@ -77,7 +80,11 @@ private static void AddAcademyRouteInfo(IDocumentBuilder builder, AcademyConvers
break;
}

builder.ReplacePlaceholderWithContent("AcademyRouteInfo", body => body.AddTable(academyRouteInfo));
builder.ReplacePlaceholderWithContent("AcademyRouteInfo", body =>
{
body.AddHeading("Conversion details", HeadingLevel.One);
body.AddTable(academyRouteInfo);
});

}

Expand All @@ -88,7 +95,17 @@ private static List<TextElement[]> VoluntaryRouteInfo(AcademyConversionProject p
new[]
{
new TextElement { Value = "Academy type and route", Bold = true },
new TextElement { Value = $"{project.AcademyTypeAndRoute} {project.ConversionSupportGrantChangeReason} {project.ConversionSupportGrantAmount.ToMoneyString(true)}" }
new TextElement { Value = project.AcademyTypeAndRoute }
},
new[]
{
new TextElement { Value = "Grant funding amount", Bold = true },
new TextElement { Value = project.ConversionSupportGrantAmount.ToMoneyString(true) }
},
new[]
{
new TextElement { Value = "Grant funding reason", Bold = true },
new TextElement { Value = project.ConversionSupportGrantChangeReason }
},
new[]
{
Expand All @@ -111,7 +128,27 @@ private static List<TextElement[]> SponsoredRouteInfo(AcademyConversionProject p
new[]
{
new TextElement { Value = "Academy type and route", Bold = true },
new TextElement { Value = $"{project.AcademyTypeAndRoute} {project.ConversionSupportGrantChangeReason} {project.ConversionSupportGrantAmount.ToMoneyString(true)}" }
new TextElement { Value = project.AcademyTypeAndRoute}
},
new[]
{
new TextElement { Value = "Grant funding type", Bold = true },
new TextElement { Value = project.ConversionSupportGrantType }
},
new[]
{
new TextElement { Value = "Grant funding amount", Bold = true },
new TextElement { Value = project.ConversionSupportGrantAmount.ToMoneyString(true) }
},
new[]
{
new TextElement { Value = "Grant funding reason", Bold = true },
new TextElement { Value = project.ConversionSupportGrantChangeReason }
},
new[]
{
new TextElement { Value = "Is the school applying for an EIG (Environmental Improvement Grant)?", Bold = true },
new TextElement { Value = project.ConversionSupportGrantEnvironmentalImprovementGrant }
},
new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static void AddSchoolBudgetInformation(IDocumentBuilder builder, HtbTempl
{
builder.ReplacePlaceholderWithContent("SchoolBudgetInformation", build =>
{
build.AddHeading("School budget information", HeadingLevel.One);
build.AddHeading("Budget information", HeadingLevel.One);
build.AddTable(new List<TextElement[]>
{
// Current financial year
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static void AddSchoolPupilForecast(IDocumentBuilder builder, HtbTemplate
{
builder.ReplacePlaceholderWithContent("SchoolPupilForecast", build =>
{
build.AddHeading("School pupil forecasts", HeadingLevel.One);
build.AddHeading("Pupil forecasts", HeadingLevel.One);
build.AddTable(new List<TextElement[]>
{
new[]
Expand All @@ -30,21 +30,21 @@ public static void AddSchoolPupilForecast(IDocumentBuilder builder, HtbTemplate
},
new []
{
new TextElement{ Value = "Projected pupil numbers on roll in the year the academy opens (year 1)", Bold = true},
new TextElement{ Value = "Projected pupil numbers on roll (year 1)", Bold = true},
new TextElement{ Value = document.YearOneProjectedCapacity},
new TextElement{ Value = document.YearOneProjectedPupilNumbers},
new TextElement{ Value = document.YearOnePercentageSchoolFull},
},
new []
{
new TextElement{ Value = "Projected pupil numbers on roll in the year the academy opens (year 2)", Bold = true},
new TextElement{ Value = "Projected pupil numbers on roll (year 2)", Bold = true},
new TextElement{ Value = document.YearTwoProjectedCapacity},
new TextElement{ Value = document.YearTwoProjectedPupilNumbers},
new TextElement{ Value = document.YearTwoPercentageSchoolFull},
},
new []
{
new TextElement{ Value = "Projected pupil numbers on roll in the year the academy opens (year 3)", Bold = true},
new TextElement{ Value = "Projected pupil numbers on roll (year 3)", Bold = true},
new TextElement{ Value = document.YearThreeProjectedCapacity},
new TextElement{ Value = document.YearThreeProjectedPupilNumbers},
new TextElement{ Value = document.YearThreePercentageSchoolFull},
Expand Down

0 comments on commit eeb58da

Please sign in to comment.