Skip to content

Add klass exclusion filter to student report card; remove old non-react report card - #130

Merged
buzz-code merged 2 commits into
mainfrom
claude/student-report-card-exclusions-rah6oo
Aug 9, 2026
Merged

buzz-code merged 2 commits into
mainfrom
claude/student-report-card-exclusions-rah6oo

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

  • add "כיתות שלא ייכללו בתעודה" (klasses to exclude) input to the student report card react bulk button, mirroring the existing lesson-exclusion input
  • server: new denyKlassReferenceIds param threaded through reportGenerator.ts → studentReportCardReact.tsx → getReportsFilterForReportCard, which now excludes denied klasses (works standalone, or intersected with the existing klass-type inclusion filter when both are set)
  • extracted the shared deny-ids filter logic (lesson + klass) into a single getDenyIdsFilter helper
  • deleted the old non-react student report card (server/src/reports/studentReportCard.ts, ejs-based) and its registrations in student.config.ts, student-klass.config.ts, student-klass-report.config.ts

Testing

  • yarn test in server: 97 suites / 913 tests passing

Generated by Claude Code

claude added 2 commits August 9, 2026 20:24
…ct report card

- add denyKlassReferenceIds param to studentReportCardReact (server + client)
- exclude denied klasses from getReportsFilterForReportCard, combined with klassType inclusion filter when both present
- delete server/src/reports/studentReportCard.ts (old ejs-based report) and its registrations
- update tests accordingly

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012dgrqbwpeXRKvrQZER1QDo
Copilot AI lite review requested due to automatic review settings August 9, 2026 20:43
@buzz-code
buzz-code merged commit 0773438 into main Aug 9, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Add klass-exclusion filter to student report card pipeline (client bulk button → report generator → TypeORM query filter). Remove legacy EJS report card wiring.

Changes:

  • Client: add denyKlassReferenceIds input to React report card bulk button
  • Server: thread denyKlassReferenceIds into getReportsFilterForReportCard, add shared deny-ids filter helper
  • Cleanup: delete old studentReportCard.ts (EJS) and remove registrations + update tests/docs

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/src/utils/studentReportData.util.ts Add deny-ids helper; apply deny klass + deny lesson filters in report query
server/src/utils/tests/studentReportData.util.spec.ts Add coverage for deny klass behavior
server/src/reports/studentReportCardReact.tsx Add denyKlassReferenceIds param, pass into report filter builder
server/src/reports/studentReportCard.ts Remove legacy EJS report generator
server/src/reports/reportGenerator.ts Thread denyKlassReferenceIds from request into report params
server/src/entity-modules/student.config.ts Remove legacy report from reportsDict
server/src/entity-modules/student-klass.config.ts Remove legacy report from reportsDict
server/src/entity-modules/student-klass-report.config.ts Remove legacy report from reportsDict
server/src/entity-modules/tests/student.config.spec.ts Update expectations to only React report type
server/src/entity-modules/tests/student-klass.config.spec.ts Remove legacy report-type test path
project-index.md Remove legacy report file from docs index
client/src/reports/studentReportCardReactButton.jsx Add klass deny input to report button form
client/src/entities/student.jsx Remove old commented-out bulk button entry
Suppressed comments (1)

server/src/utils/studentReportData.util.ts:114

  • getReportsFilterForReportCard params typed as required (reportDateFilter/globalLessonIdsStr/denyLessonIdStr), but call sites/tests pass null/undefined. Align types to avoid unsafe calls and TS errors.
export function getReportsFilterForReportCard(
  studentId: number,
  year: number,
  reportDateFilter: FindOperator<any>,
  globalLessonIdsStr: string,
  denyLessonIdStr: string,
  klassIds?: number[],
  denyKlassIdStr?: string,
): FindOptionsWhere<AttReportAndGrade>[] {

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +95 to +104
// builds an inclusion/exclusion filter for a reference id column: excludes denyIdsStr,
// intersected with includeIds when given (used for klass ids, which also have a klassType inclusion list)
function getDenyIdsFilter(denyIdsStr: string, includeIds?: number[]): FindOperator<number> {
const denyIds = getAsArray(denyIdsStr);
if (includeIds?.length) {
const filteredIds = denyIds?.length ? includeIds.filter((id) => !denyIds.includes(String(id))) : includeIds;
return In(filteredIds);
}
return denyIds?.length ? Not(In(denyIds)) : undefined;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants