From 4318b143ac60cef798975dc8432c7f1dfc4c6b22 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 19 Sep 2026 06:30:03 +0000 Subject: [PATCH] chore: remove stale dead code in reports and student-by-year config - klassAttendanceReport.ts: drop unused hoursRow/topicRow/lessonCountRow/ teacherRow/separatorRow, commented out with no explanation, plus the now-unused formatTime import they were the only caller of - student-by-year.config.ts: drop a stale commented-out early return with no explanation - studentReportData.util.ts: drop a dead commented-out line already superseded by the following if statement No behavior change; all three are inert comments/imports. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01VwgtFx4bsoC4bS1Mw2jBms --- .../entity-modules/student-by-year.config.ts | 3 --- server/src/reports/klassAttendanceReport.ts | 18 ++---------------- server/src/utils/studentReportData.util.ts | 1 - 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/server/src/entity-modules/student-by-year.config.ts b/server/src/entity-modules/student-by-year.config.ts index 22b3d505..d48ab7f6 100644 --- a/server/src/entity-modules/student-by-year.config.ts +++ b/server/src/entity-modules/student-by-year.config.ts @@ -97,9 +97,6 @@ class StudentByYearService extends BaseEntityS }); pivotData.forEach((item) => { - // if (item.absCount === 0) { - // return; - // } const key = `${item.lessonReferenceId}`; headers[key] ??= { value: key, label: `${item.lesson?.name}` }; studentMap[item.studentReferenceId][key] ??= 0; diff --git a/server/src/reports/klassAttendanceReport.ts b/server/src/reports/klassAttendanceReport.ts index 56978c73..ba6e6cf8 100644 --- a/server/src/reports/klassAttendanceReport.ts +++ b/server/src/reports/klassAttendanceReport.ts @@ -14,7 +14,7 @@ import { IImageField, ISpecialField } from '@shared/utils/importer/types'; import * as ExcelJS from 'exceljs'; import { getUniqueValues, groupDataByKeysAndCalc, groupDataByKeyFn } from '@shared/utils/reportData.util'; import { ReportGroup } from 'src/db/entities/ReportGroup.entity'; -import { formatTime, formatDate, formatDisplayName } from '@shared/utils/formatting/formatter.util'; +import { formatDate, formatDisplayName } from '@shared/utils/formatting/formatter.util'; export interface KlassAttendanceReportParams { userId: number; @@ -310,21 +310,7 @@ const BUILDING = { (s) => `${s.date.getDate().toString().padStart(2, '0')}/${(s.date.getMonth() + 1).toString().padStart(2, '0')}`, ), ]; - // const hoursRow = ['שעות לימוד', ...sessions.map(s => `${formatTime(s.startTime)}-${formatTime(s.endTime)}`)]; - // const topicRow = ['שיעור', ...sessions.map(s => s.topic)]; - // const lessonCountRow = ['מס\' שעות לימוד', ...sessions.map(s => s.lessonCount.toString())]; - // const teacherRow = ['שם המורה', ...sessions.map(s => s.teacherName)]; - // const separatorRow = ['', ...sessions.map(() => '--')]; - - const rows = [ - dayRow, - dateRow, - // hoursRow, - // topicRow, - // lessonCountRow, - // teacherRow, - // separatorRow - ]; + const rows = [dayRow, dateRow]; // Convert header rows to special fields with styling const specialFields: ISpecialField[] = []; diff --git a/server/src/utils/studentReportData.util.ts b/server/src/utils/studentReportData.util.ts index fcd6013a..653fb739 100644 --- a/server/src/utils/studentReportData.util.ts +++ b/server/src/utils/studentReportData.util.ts @@ -221,7 +221,6 @@ export function getDisplayGrade( gradeNames: GradeName[] = [], klassTypeReferenceId?: number, ) { - // if (grade === 0) return '0%'; if (!grade) return ''; // ========== investigation ==========