Enhance school simulation management by introducing a new SchoolWeekDays option, allowing configuration of the number of working days in a week. Update the API to include school week days in responses and enhance documentation to reflect these changes. Revise UI components to support the new management features, ensuring a seamless user experience when hiring and assigning staff. Update localization strings for improved clarity and consistency across the application.
This commit is contained in:
@@ -33,6 +33,46 @@ public class StaffingApiTests(AppHostFixture fixture)
|
||||
Assert.Empty(staffing.Staff);
|
||||
Assert.Contains(staffing.Uncovered, subject => subject.DefName == "Mathematics");
|
||||
Assert.Contains(staffing.Uncovered, subject => subject.DefName == "PrimarySchool");
|
||||
Assert.NotEmpty(staffing.Positions);
|
||||
Assert.Contains(staffing.Positions, position => position.DefName == "Teacher");
|
||||
Assert.Contains(staffing.Subjects, subject => subject.DefName == "Mathematics");
|
||||
Assert.All(staffing.Applicants, applicant => Assert.NotEmpty(applicant.Skills));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Card_OpensAGeneratedApplicant()
|
||||
{
|
||||
using var client = fixture.App.CreateHttpClient("server");
|
||||
await SchoolApiTests.ResetAsync(client);
|
||||
var school = await SchoolApiTests.CreateAsync(client, "Штат карточка пула", Start);
|
||||
var staffing = await GetStaffingAsync(client, school.Id);
|
||||
var generated = staffing.Applicants.First(applicant => !applicant.IsParent);
|
||||
|
||||
var card = await client.GetFromJsonAsync<PersonCardResponse>(
|
||||
$"/api/schools/{school.Id}/people/{Uri.EscapeDataString(generated.Id)}?lang=ru",
|
||||
TestContext.Current.CancellationToken);
|
||||
Assert.NotNull(card);
|
||||
Assert.Equal(generated.Id, card.Id);
|
||||
Assert.NotEmpty(card.Skills);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Hire_ParentKeepsBothRolesOnTheCard()
|
||||
{
|
||||
using var client = fixture.App.CreateHttpClient("server");
|
||||
await SchoolApiTests.ResetAsync(client);
|
||||
var school = await SchoolApiTests.CreateAsync(client, "Штат родитель", Start);
|
||||
var before = await GetStaffingAsync(client, school.Id);
|
||||
var parent = before.Applicants.First(applicant => applicant.IsParent);
|
||||
|
||||
await HireAsync(client, school.Id, parent.Id, "Teacher");
|
||||
|
||||
var card = await client.GetFromJsonAsync<PersonCardResponse>(
|
||||
$"/api/schools/{school.Id}/people/{Uri.EscapeDataString(parent.Id)}?lang=ru",
|
||||
TestContext.Current.CancellationToken);
|
||||
Assert.NotNull(card);
|
||||
Assert.Contains("parent", card.Roles);
|
||||
Assert.Contains("staff", card.Roles);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -217,11 +257,23 @@ public class StaffingApiTests(AppHostFixture fixture)
|
||||
float Remaining,
|
||||
IReadOnlyList<UncoveredSubjectResponse> Uncovered,
|
||||
IReadOnlyList<ApplicantResponse> Applicants,
|
||||
IReadOnlyList<StaffMemberResponse> Staff);
|
||||
IReadOnlyList<StaffMemberResponse> Staff,
|
||||
IReadOnlyList<DefLabelResponse> Positions,
|
||||
IReadOnlyList<UncoveredSubjectResponse> Subjects);
|
||||
|
||||
private sealed record UncoveredSubjectResponse(string DefName, string Label, int GradeMin, int GradeMax, int HoursPerWeek);
|
||||
|
||||
private sealed record ApplicantResponse(string Id, string FullName, bool Female, int Age, bool IsParent, float HourlyWageAsk, float MonthlyBase);
|
||||
private sealed record ApplicantResponse(
|
||||
string Id,
|
||||
string FullName,
|
||||
bool Female,
|
||||
int Age,
|
||||
bool IsParent,
|
||||
float HourlyWageAsk,
|
||||
float MonthlyBase,
|
||||
IReadOnlyList<LabeledStatResponse> Skills);
|
||||
|
||||
private sealed record LabeledStatResponse(string Id, string Label, string Value);
|
||||
|
||||
private sealed record StaffMemberResponse(
|
||||
string Id,
|
||||
@@ -237,6 +289,8 @@ public class StaffingApiTests(AppHostFixture fixture)
|
||||
|
||||
private sealed record DefLabelResponse(string DefName, string Label);
|
||||
|
||||
private sealed record PersonCardResponse(string Id, IReadOnlyList<string> Roles, IReadOnlyList<LabeledStatResponse> Skills);
|
||||
|
||||
private sealed record PeopleListResponse(
|
||||
int Total,
|
||||
int Page,
|
||||
|
||||
Reference in New Issue
Block a user