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:
@@ -24,6 +24,8 @@ describe('t', () => {
|
||||
expect(t('peoplePager', { page: 2, pages: 10, total: 512 })).toBe('Page 2 of 10 · 512');
|
||||
expect(t('staffErrorPayroll', { allocated: '10 000', payroll: '8 000', remaining: '2 000', attempted: '12 000' }))
|
||||
.toBe('Not enough money: 8 000 of 10 000 is committed, 2 000 free, 12 000 needed.');
|
||||
expect(t('staffUncoveredShort', { label: 'Начальные классы', min: 1, max: 4, n: 3 }))
|
||||
.toBe('Начальные классы (1–4) — 3 short');
|
||||
expect(t('mapOccupancy', { name: 'Кабинет 204', activity: 'Математика · 5Б' }))
|
||||
.toBe('Кабинет 204 (Математика · 5Б)');
|
||||
expect(t('mapHeadcount', { name: 'Коридор', count: 12 })).toBe('Коридор (12)');
|
||||
|
||||
@@ -159,6 +159,7 @@ const ru = {
|
||||
staffColPay: 'В месяц',
|
||||
staffAsk: '{hourly}/ч · {monthly}/мес',
|
||||
staffSubjectRange: '{label} ({min}–{max})',
|
||||
staffUncoveredShort: '{label} ({min}–{max}) — не хватает {n}',
|
||||
staffParent: 'родитель',
|
||||
staffPickHint: 'Выберите сотрудника в списке или откройте соискателей.',
|
||||
staffHireTitle: 'Наём',
|
||||
@@ -369,6 +370,7 @@ const en: Messages = {
|
||||
staffColPay: 'Monthly',
|
||||
staffAsk: '{hourly}/h · {monthly}/mo',
|
||||
staffSubjectRange: '{label} ({min}–{max})',
|
||||
staffUncoveredShort: '{label} ({min}–{max}) — {n} short',
|
||||
staffParent: 'parent',
|
||||
staffPickHint: 'Select a staff member in the list, or open the applicants.',
|
||||
staffHireTitle: 'Hire',
|
||||
|
||||
@@ -321,6 +321,7 @@ export interface StaffingSubject {
|
||||
readonly gradeMin: number;
|
||||
readonly gradeMax: number;
|
||||
readonly hoursPerWeek: number;
|
||||
readonly teachersShort: number;
|
||||
}
|
||||
|
||||
export interface StaffingApplicant {
|
||||
|
||||
@@ -257,10 +257,11 @@ export class ManagementPanel {
|
||||
this.uncovered.append(
|
||||
el('span', {
|
||||
class: 'people__tag',
|
||||
text: t('staffSubjectRange', {
|
||||
text: t('staffUncoveredShort', {
|
||||
label: subject.label,
|
||||
min: subject.gradeMin,
|
||||
max: subject.gradeMax,
|
||||
n: subject.teachersShort,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user