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
8 changes: 3 additions & 5 deletions server/src/db/entities/User.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ import { Teacher } from 'src/db/entities/Teacher.entity';

@Entity('users')
export class User extends BaseUser {
// @OneToMany(() => Grade, (grades) => grades.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[];

// @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[];
}
10 changes: 5 additions & 5 deletions server/src/entity-modules/att-report-with-report-month.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class AttReportWithReportMonthService<T extends Entity | AttReportWithReportMont
return super.doAction(req, body);
}

private async bulkChangeKlass(extra: any): Promise<string> {
private async bulkChangeKlass(extra: Record<string, string>): Promise<string> {
const ids = getAsNumberArray(extra.ids);
if (!ids || ids.length === 0) return 'לא נבחרו רשומות';
const klassReferenceId = getAsNumber(extra.klassReferenceId);
Expand All @@ -135,7 +135,7 @@ class AttReportWithReportMonthService<T extends Entity | AttReportWithReportMont
return `עודכנו ${result.affected} רשומות`;
}

private async bulkChangeTeacher(extra: any): Promise<string> {
private async bulkChangeTeacher(extra: Record<string, string>): Promise<string> {
const ids = getAsNumberArray(extra.ids);
if (!ids || ids.length === 0) return 'לא נבחרו רשומות';
const teacherReferenceId = getAsNumber(extra.teacherReferenceId);
Expand All @@ -144,7 +144,7 @@ class AttReportWithReportMonthService<T extends Entity | AttReportWithReportMont
return `עודכנו ${result.affected} רשומות`;
}

private async bulkKnownAbsences(extra: any): Promise<string> {
private async bulkKnownAbsences(extra: Record<string, string>): Promise<string> {
const ids = getAsArray(extra.ids);
if (!ids) return 'לא נבחרו רשומות';
const reports = await this.dataSource.getRepository(AttReport).findBy({ id: In(ids) });
Expand All @@ -169,7 +169,7 @@ class AttReportWithReportMonthService<T extends Entity | AttReportWithReportMont
return `נוצרו ${reports.length} חיסורים מאושרים`;
}

private async fixStudentReferenceV2(extra: any): Promise<string> {
private async fixStudentReferenceV2(extra: Record<string, string>): Promise<string> {
const ids = getAsArray(extra.ids);
if (!ids) return 'לא נבחרו רשומות';
const reports = await this.dataSource.getRepository(AttReport).findBy({ id: In(ids) });
Expand All @@ -189,7 +189,7 @@ class AttReportWithReportMonthService<T extends Entity | AttReportWithReportMont
return `עודכנו ${reportsToSave.length} רשומות`;
}

private async fixReferences(extra: any): Promise<string> {
private async fixReferences(extra: Record<string, string>): Promise<string> {
const ids = getAsNumberArray(extra.ids);
if (!ids) return 'לא נבחרו רשומות';
const referenceFields = {
Expand Down
3 changes: 1 addition & 2 deletions server/src/reports/lessonSignaturePdfReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -452,7 +451,7 @@ const LessonSignatureReport: React.FunctionComponent<LessonSignaturePdfData | Er

// Handle success case - cast to correct type after error check
const data = props as LessonSignaturePdfData;
const { id, teacher, lesson, klass, studentRecords, entityName, sessions, signatureData, createdAt } = data;
const { teacher, lesson, klass, studentRecords, entityName, sessions, signatureData, createdAt } = data;
const entityConfig = getEntityConfig(entityName);

// Group records by sessionId (if available) or date
Expand Down
2 changes: 1 addition & 1 deletion server/src/reports/studentReportCardReact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ const ReportItem: React.FunctionComponent<ReportItemProps> = ({ reportParams, re
ציון: ${report.gradeAvg ? report.gradeAvg * 100 : '-'}, השפעה: ${gradeEffect.effectPercent ? gradeEffect.effectPercent + '%' : gradeEffect.effect}, ציון סופי: ${displayGrade}
`;

const { fullCellStyle, rightAlignFullCellStyle, emptyCellStyle } = useCellStyles();
const { fullCellStyle, rightAlignFullCellStyle } = useCellStyles();

return <tr>
<td style={rightAlignFullCellStyle}>{formatDisplayName(report.lesson)}</td>
Expand Down
Loading