Repository navigation
Group teacher-attendance-reported cards by class, fix reported-hour timezone - #164
Conversation
…imezone - teacher_reported_today view now also exposes klassReferenceId - Client groups report cards into one column per class - Report date/hour now always render in Israel time (Asia/Jerusalem) instead of the viewer's browser timezone
There was a problem hiding this comment.
🟡 Changes recommended
Current server view + client grouping can collapse multi-class data into single row/card and mis-assign cards to wrong class column due to klassReferenceId not being part of view id/grouping and card grouping key.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fix teacher-reported-today screen: add klassReferenceId to backend view, group cards by class columns, render date/hour in Asia/Jerusalem to avoid browser timezone drift.
Changes:
- Recreate
teacher_reported_todaySQL view + view-entity to exposeklassReferenceId. - Update client screen layout to columns per class.
- Pin
formatDate/formatHourformatting toAsia/Jerusalem.
File summaries
| File | Description |
|---|---|
| server/src/migrations/1787600000000-AddKlassToTeacherReportedTodayView.ts | Updates SQL view to include class reference id |
| server/src/db/view-entities/TeacherReportedToday.entity.ts | Adds klassReferenceId to TypeORM view entity expression + columns |
| client/src/entities/teacher-reported-today.jsx | Groups cards into class columns + pins date/time formatting timezone |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… filter - teacher_reported_today view groups by klassReferenceId (not MIN()) and includes it in the row id, so rows for different classes on the same teacher/lesson/date no longer collapse or collide on id - Client card grouping key includes klassReferenceId so cards from different classes never merge into one card / wrong column - Default "today" date filter now uses Asia/Jerusalem instead of UTC, matching the display formatting
There was a problem hiding this comment.
🟡 Changes recommended
reportHour computed per teacher+date (ignores class) while UI now groups per class, so displayed hour can be wrong for given class column.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
server/src/db/view-entities/TeacherReportedToday.entity.ts:21
- reportHour window partition ignores klassReferenceId, but client now groups cards by klassReferenceId; card hour can reflect earliest report for different class. Partition by klassReferenceId so reportHour matches same grouping dimension.
.addSelect(
'MIN(MIN(att_report.createdAt)) OVER (PARTITION BY att_report.userId, att_report.teacherReferenceId, att_report.reportDate)',
'reportHour',
)
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
- reportHour window now partitions by klassReferenceId too, so a class's card shows that class's own earliest report time instead of possibly the earliest across all of the teacher's classes that day - Updated groupByTeacherAndDate comment to reflect klass is now part of the grouping key
Summary
Client reported two issues on the "teachers who reported attendance" screen:
Changes
teacher_reported_todayview now also exposesklassReferenceId(view entity + migration).teacher-reported-today.jsx), sorted by class.formatDate/formatHournow explicitly render inAsia/Jerusaleminstead of relying on the viewer's browser/OS timezone (root cause of the wrong hour), matching the pattern already used server-side inyemot-handler.service.ts.Testing
cd server && yarn build— cleancd client && yarn build— cleancd server && yarn test --testPathPattern=teacher-report— passing🤖 Generated with Claude Code
Generated by Claude Code