Skip to content

Teacher reported today: fix missing-girls total, card per lesson, per-lesson hour - #202

Closed
buzz-code wants to merge 7 commits into
mainfrom
claude/vibrant-hypatia-7ap4jm
Closed

buzz-code wants to merge 7 commits into
mainfrom
claude/vibrant-hypatia-7ap4jm

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

Fixes in the "מורות שדיווחו" (teacher_reported_today) card view:

  • Missing-girls total bug — missingGirlsCount comes from MySQL COUNT (BIGINT) as a string, so the card total concatenated (0 + "1" + "2" → חסרו 012). Cast to Number. The same string caused a 0 badge to show on lessons with no absences; it's hidden now.
  • One card per lesson — a teacher who taught two different subjects in the same class/day now gets two cards instead of one combined card.
  • Per-lesson report hour — reportHour was MIN(...) OVER (PARTITION BY teacher, date, klass), so all of a teacher's lessons showed the same hour. Now MIN(createdAt) per lesson row. New migration 1791305020926-ReportHourPerLessonInTeacherReportedTodayView; its SQL matches the TypeORM generated view exactly (no drift on migration:generate).

Not in this PR: same subject taught twice in one day still shows as one card (follow-up).

Testing

  • Ran locally (MySQL 8 + NestJS + Vite) with seeded reports. Before: one card חסרו 012, shared hour. After: separate cards, own hours (08:52 / 10:30), correct totals, no 0 badge.
  • Migration run → revert → run OK; migration:generate --dryrun shows no teacher_reported_today drift.
  • yemot-handler.service.test.ts: 30/30 pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Po2GocBhFneXD2k9z1f6Ld


Generated by Claude Code

claude added 7 commits October 6, 2026 16:38
…ed today summary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Po2GocBhFneXD2k9z1f6Ld
Keep session creation gated by lessonSignature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Po2GocBhFneXD2k9z1f6Ld
Copilot AI balanced review requested due to automatic review settings October 6, 2026 17:09

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.

Copilot review overview

🟢 Approval recommended

Card logic, view aggregation, and migration align with intended behavior; no blocking issues remain.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes teacher report cards in attendance dashboard, with correct absence counts and lesson-specific times.

Changes:

  • Converts absence counts to numbers, fixing totals and hiding zero badges.
  • Splits cards by lesson.
  • Uses per-lesson report times, with matching migration and rollback.
File Description
server/​src/​migrations/​1791305020926-ReportHourPerLessonInTeacherReportedTodayView.ts Updates view SQL and metadata; restores prior behavior on rollback.
server/​src/​db/​view-entities/​TeacherReportedToday.entity.ts Computes earliest report time per lesson row.
client/​src/​entities/​teacher-reported-today.jsx Splits lesson cards and fixes numeric counts.

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

Copy link
Copy Markdown
Owner Author

Superseded by #203 (DB ↔ TypeORM alignment only) and #204 (report changes, stacked on #203, now also splitting the same lesson taught twice in a day).


Generated by Claude Code

@buzz-code buzz-code closed this Oct 6, 2026
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