Enhance staffing management with uncovered teacher tracking
- Updated `protocol.md` to clarify the concept of uncovered subjects and the number of additional teachers required. - Introduced `teachersShort` property in the `StaffingSubject` interface to indicate how many more teachers are needed for a subject. - Enhanced localization strings to reflect the new uncovered teacher information in both English and Russian. - Updated the management panel UI to display the number of teachers short for each uncovered subject. - Revised the `Uncovered` method in the staffing logic to return detailed information about uncovered subjects, including the shortfall of teachers. - Added tests to validate the new uncovered teacher tracking functionality and ensure accurate reporting in the staffing API. - Marked related tasks as complete in the documentation for the golden fixtures phase.
This commit is contained in:
@@ -196,7 +196,8 @@ internal sealed record UncoveredSubjectResponse(
|
||||
string Label,
|
||||
int GradeMin,
|
||||
int GradeMax,
|
||||
int HoursPerWeek);
|
||||
int HoursPerWeek,
|
||||
int TeachersShort);
|
||||
|
||||
internal sealed record ApplicantResponse(
|
||||
string Id,
|
||||
@@ -241,12 +242,13 @@ internal static class StaffingMapper
|
||||
var uncovered = catalog is null
|
||||
? Array.Empty<UncoveredSubjectResponse>()
|
||||
: Staffing.Uncovered(catalog, roster)
|
||||
.Select(subject => new UncoveredSubjectResponse(
|
||||
subject.DefName,
|
||||
catalog.Label(locale, subject),
|
||||
subject.Grades.Min,
|
||||
subject.Grades.Max,
|
||||
subject.HoursPerWeek))
|
||||
.Select(row => new UncoveredSubjectResponse(
|
||||
row.Subject.DefName,
|
||||
catalog.Label(locale, row.Subject),
|
||||
row.Subject.Grades.Min,
|
||||
row.Subject.Grades.Max,
|
||||
row.Subject.HoursPerWeek,
|
||||
row.TeachersShort))
|
||||
.ToArray();
|
||||
|
||||
var applicants = pool.Applicants
|
||||
@@ -286,7 +288,8 @@ internal static class StaffingMapper
|
||||
catalog.Label(locale, def),
|
||||
def.Grades.Min,
|
||||
def.Grades.Max,
|
||||
def.HoursPerWeek))
|
||||
def.HoursPerWeek,
|
||||
0))
|
||||
.ToArray();
|
||||
|
||||
return new StaffingResponse(allocated, payroll, remaining, uncovered, applicants, staff, positions, subjects);
|
||||
|
||||
Reference in New Issue
Block a user