From 4058153208fa886966585ad06deab42dac5b72a3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 06:51:27 +0000 Subject: [PATCH 1/3] refactor(server): remove dead imports/vars and commented-out code, tighten extra types Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01KwMPwZjUotwT9JTa5g3XgV --- server/src/db/entities/User.entity.ts | 5 ----- .../att-report-with-report-month.config.ts | 10 +++++----- server/src/reports/lessonSignaturePdfReport.tsx | 3 +-- server/src/reports/studentReportCardReact.tsx | 2 +- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/server/src/db/entities/User.entity.ts b/server/src/db/entities/User.entity.ts index c373d394..e2e6c81d 100644 --- a/server/src/db/entities/User.entity.ts +++ b/server/src/db/entities/User.entity.ts @@ -8,18 +8,13 @@ import { Teacher } from 'src/db/entities/Teacher.entity'; @Entity('users') export class User extends BaseUser { - // @OneToMany(() => Grade, (grades) => grades.user) grades: Grade[]; - // @OneToMany(() => KlassType, (klassTypes) => klassTypes.user) klassTypes: KlassType[]; - // @OneToMany(() => KnownAbsence, (knownAbsences) => knownAbsences.user) knownAbsences: KnownAbsence[]; - // @OneToMany(() => Student, (students) => students.user) students: Student[]; - // @OneToMany(() => Teacher, (teachers) => teachers.user) teachers: Teacher[]; } diff --git a/server/src/entity-modules/att-report-with-report-month.config.ts b/server/src/entity-modules/att-report-with-report-month.config.ts index 40307e42..ebff4d6f 100644 --- a/server/src/entity-modules/att-report-with-report-month.config.ts +++ b/server/src/entity-modules/att-report-with-report-month.config.ts @@ -126,7 +126,7 @@ class AttReportWithReportMonthService { + private async bulkChangeKlass(extra: Record): Promise { const ids = getAsNumberArray(extra.ids); if (!ids || ids.length === 0) return 'לא נבחרו רשומות'; const klassReferenceId = getAsNumber(extra.klassReferenceId); @@ -135,7 +135,7 @@ class AttReportWithReportMonthService { + private async bulkChangeTeacher(extra: Record): Promise { const ids = getAsNumberArray(extra.ids); if (!ids || ids.length === 0) return 'לא נבחרו רשומות'; const teacherReferenceId = getAsNumber(extra.teacherReferenceId); @@ -144,7 +144,7 @@ class AttReportWithReportMonthService { + private async bulkKnownAbsences(extra: Record): Promise { const ids = getAsArray(extra.ids); if (!ids) return 'לא נבחרו רשומות'; const reports = await this.dataSource.getRepository(AttReport).findBy({ id: In(ids) }); @@ -169,7 +169,7 @@ class AttReportWithReportMonthService { + private async fixStudentReferenceV2(extra: Record): Promise { const ids = getAsArray(extra.ids); if (!ids) return 'לא נבחרו רשומות'; const reports = await this.dataSource.getRepository(AttReport).findBy({ id: In(ids) }); @@ -189,7 +189,7 @@ class AttReportWithReportMonthService { + private async fixReferences(extra: Record): Promise { const ids = getAsNumberArray(extra.ids); if (!ids) return 'לא נבחרו רשומות'; const referenceFields = { diff --git a/server/src/reports/lessonSignaturePdfReport.tsx b/server/src/reports/lessonSignaturePdfReport.tsx index b20ae5cb..1f32c59c 100644 --- a/server/src/reports/lessonSignaturePdfReport.tsx +++ b/server/src/reports/lessonSignaturePdfReport.tsx @@ -2,7 +2,6 @@ import * as React from 'react'; import { DataSource, In } from 'typeorm'; import { ImportFile } from '@shared/entities/ImportFile.entity'; import { ReportGroup } from 'src/db/entities/ReportGroup.entity'; -import { ReportGroupSession } from 'src/db/entities/ReportGroupSession.entity'; import { AttReport } from 'src/db/entities/AttReport.entity'; import { Grade } from 'src/db/entities/Grade.entity'; import { Student } from 'src/db/entities/Student.entity'; @@ -452,7 +451,7 @@ const LessonSignatureReport: React.FunctionComponent = ({ reportParams, re ציון: ${report.gradeAvg ? report.gradeAvg * 100 : '-'}, השפעה: ${gradeEffect.effectPercent ? gradeEffect.effectPercent + '%' : gradeEffect.effect}, ציון סופי: ${displayGrade} `; - const { fullCellStyle, rightAlignFullCellStyle, emptyCellStyle } = useCellStyles(); + const { fullCellStyle, rightAlignFullCellStyle } = useCellStyles(); return {formatDisplayName(report.lesson)} From c77f9c89d0f626beb4a0da636edef2843dd313b8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 20:31:30 +0000 Subject: [PATCH 2/3] docs: explain why User entity relations are typed without @OneToMany Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01KwMPwZjUotwT9JTa5g3XgV --- server/src/db/entities/User.entity.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/db/entities/User.entity.ts b/server/src/db/entities/User.entity.ts index e2e6c81d..5517589d 100644 --- a/server/src/db/entities/User.entity.ts +++ b/server/src/db/entities/User.entity.ts @@ -8,6 +8,9 @@ import { Teacher } from 'src/db/entities/Teacher.entity'; @Entity('users') export class User extends BaseUser { + // Inverse sides of the user relations, typed only (no @OneToMany): the owning + // side (the `user` field on each entity) defines the relation, and mapping + // the inverse here is not needed. Add the decorator if a query must join from user. grades: Grade[]; klassTypes: KlassType[]; From 515f42b429303d655688fd62258363be99643d1f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 20:31:44 +0000 Subject: [PATCH 3/3] docs: correct User entity relations comment Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01KwMPwZjUotwT9JTa5g3XgV --- server/src/db/entities/User.entity.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/db/entities/User.entity.ts b/server/src/db/entities/User.entity.ts index 5517589d..b875ef32 100644 --- a/server/src/db/entities/User.entity.ts +++ b/server/src/db/entities/User.entity.ts @@ -8,9 +8,9 @@ import { Teacher } from 'src/db/entities/Teacher.entity'; @Entity('users') export class User extends BaseUser { - // Inverse sides of the user relations, typed only (no @OneToMany): the owning - // side (the `user` field on each entity) defines the relation, and mapping - // the inverse here is not needed. Add the decorator if a query must join from user. + // Typed only, not mapped: these entities reference the user through a plain + // `userId` column, with no TypeORM relation. Adding @OneToMany here would + // also require a matching @ManyToOne on each entity. grades: Grade[]; klassTypes: KlassType[];