Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion client/src/reports/in-lesson-report/LessonSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const LessonSelector = ({ onLessonFound, selectedTeacher }) => {
id: klassId,
pagination: { page: 1, perPage: 1000 },
sort: { field: 'student.name', order: 'ASC' },
filter: { year: defaultYearFilter.year },
filter: { year: defaultYearFilter.year, 'student.isActive': true },
});
return students;
}),
Expand Down
1 change: 1 addition & 0 deletions client/src/roadmapFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default [
{ html: 'דוחות "מורות שדיווחו נוכחות" ו"מעקב חיסורים": הצגת שם לתצוגה של כיתה, שיעור ומורה כשהוגדר', status: 'בוצע', statusColor: 'success' },
{ html: 'הגדרת זמני שיעורים לכל יום במסך ההגדרות, ובדוח המורות שדיווחו: ריבוע ריק לשיעור שלא דווח באמצע היום', status: 'בוצע', statusColor: 'success' },
{ html: 'רשימות: שורת הסינון והייצוא וכותרת הטבלה נשארות קבועות בראש המסך בזמן גלילה (במחשב), ובייצוא לאקסל שורת הכותרת קפואה', status: 'בוצע', statusColor: 'success' },
{ html: 'תלמידה שסומנה "לא פעילה" לא מופיעה יותר בדיווח שיעור חדש, בדיווח טלפוני ובקובץ הדיווח למורה (הנתונים הקודמים שלה נשמרים)', status: 'בוצע', statusColor: 'success' },

// { html: 'הגדרת תקופת זמן לפי תאריכים', status: 'בקרוב', statusColor: 'warning' },
// { html: 'הגדרת תקופת זמן לפי יום בשבוע', status: 'בוצע', statusColor: 'success' },
Expand Down
5 changes: 5 additions & 0 deletions server/src/reports/__tests__/teacherReportFile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ describe('teacherReportFile', () => {

expect(result).toHaveLength(1);
expect(mockLessonRepo.findBy).toHaveBeenCalledWith({ id: 1, userId: 1 });
expect(mockStudentKlassRepo.find).toHaveBeenCalledWith(
expect.objectContaining({
where: expect.objectContaining({ student: expect.objectContaining({ isActive: true }) }),
}),
);
});

it('should handle lessons without klassReferenceIds', async () => {
Expand Down
1 change: 1 addition & 0 deletions server/src/reports/teacherReportFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const getReportData: IGetReportDataFunction = async (
studentReferenceId: Not(IsNull()),
student: {
id: Not(IsNull()),
isActive: true,
},
},
relations: {
Expand Down
23 changes: 23 additions & 0 deletions server/src/yemot-handler.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,29 @@ describe('YemotHandlerService — react-admin-nestjs', () => {
expect(result.saved['AttReport']).toHaveLength(3);
});

it('inactive student — excluded from the roster, gets no AttReport row', async () => {
jest.setSystemTime(israelTimeAt(7, 0));
const year = getCurrentHebrewYear();
const klass = { id: 284, userId: 1, key: 20, name: 'Klass Twenty', year };

const builder = teacherSetup('Seminar skips inactive student', {
extraSeeds: {
Klass: [klass],
Student: roster().map((s) => (s.id === 103 ? { ...s, isActive: false } : s)),
StudentKlass: studentKlasses(klass.id, year),
Lesson: [{ id: 800, userId: 1, key: 5, name: 'Lesson Five', year }],
},
}).seed('AttReport', []);
startsSeminarCall(builder, '20', '1');
entersLesson(builder, '5');
finishAbsentStudentEntry(builder);
const scenario = builder.systemHangsUp(/success/i).build();

const result = await runner.run(scenario);
expect(result.passed).toBe(true);
expect(result.saved['AttReport'].map((r: any) => r.studentReferenceId).sort()).toEqual([101, 102]);
});

it('invalid teacher code — error message then retry with valid code', async () => {
jest.setSystemTime(israelTimeAt(7, 0));
const year = getCurrentHebrewYear();
Expand Down
1 change: 1 addition & 0 deletions server/src/yemot-handler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export class YemotHandlerService extends BaseYemotHandlerService {
userId: this.user.id,
klassReferenceId,
year: getCurrentHebrewYear(),
student: { isActive: true },
},
});
}
Expand Down
Loading