Skip to content

feat(yemot): add phone-based seminar attendance flow - #102

Merged
buzz-code merged 4 commits into
mainfrom
claude/seminar-attendance-yemot
Jul 6, 2026
Merged

buzz-code merged 4 commits into
mainfrom
claude/seminar-attendance-yemot

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Schools with permissions.seminarAttendanceYemot route to a new flow where a teacher (matched by caller ID) keys a class number then the numbers of absent students; everyone else in the class is recorded present. Adds Student.studentNumber as a keypad-friendly student identifier, and links AttReport rows to a ReportGroup/ReportGroupSession (same mechanism as the web in-lesson-report form) when the school has lessonSignature permission, storing the call's time there.

HadasaSchechterV and others added 2 commits July 6, 2026 00:56
Schools with permissions.seminarAttendanceYemot route to a new flow
where a teacher (matched by caller ID) keys a class number then the
numbers of absent students; everyone else in the class is recorded
present. Adds Student.studentNumber as a keypad-friendly student
identifier, and links AttReport rows to a ReportGroup/ReportGroupSession
(same mechanism as the web in-lesson-report form) when the school has
lessonSignature permission, storing the call's time there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…mot permission

Adds the Hebrew label for the new Student.studentNumber field and
registers seminarAttendanceYemot as a first-class client permission key
(with is*/useIs* helpers), matching the existing transportation flag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 6, 2026 08:33

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

Adds a new Yemot (phone) “seminar attendance” call flow for schools with seminarAttendanceYemot permission, letting a teacher (matched by caller ID) enter a class number and absent student numbers; the system records the rest as present. It also introduces Student.studentNumber as a keypad-friendly identifier and (when lessonSignature is enabled) links created AttReport rows to a ReportGroup + ReportGroupSession to align with the existing web reporting mechanism.

Changes:

  • Route Yemot calls to a new seminar attendance flow based on permissions, creating AttReport rows and (optionally) ReportGroup/ReportGroupSession.
  • Add studentNumber to Student (DB + entity) and expose it in the React-Admin student UI + translations.
  • Add a migration to seed/update Yemot IVR texts for the new prompts and messages, plus unit tests for the new call flow.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/src/yemot-handler.service.ts Adds permission-gated seminar attendance phone flow and persistence to AttReport (+ optional report grouping).
server/src/yemot-handler.service.test.ts Adds end-to-end Yemot scenario tests covering seminar flow success and key error cases.
server/src/migrations/1783286613243-UpdateYemotTextsSeminarAttendance.ts Seeds Yemot text keys for the seminar flow prompts/messages.
server/src/migrations/1783286226248-AddStudentNumberToStudents.ts Adds student_number column + unique index to support keypad-friendly student IDs.
server/src/db/entities/Student.entity.ts Adds studentNumber field and unique index on (userId, studentNumber, year).
client/src/utils/appPermissions.js Adds seminarAttendanceYemot permission and helper/hook.
client/src/roadmapFeatures.js Marks the seminar attendance via phone feature as completed in the roadmap list.
client/src/entities/student.jsx Displays and edits studentNumber in React-Admin student list/form.
client/src/domainTranslations.js Adds Hebrew label for studentNumber.
Files not reviewed (1)
  • client/src/roadmapFeatures.js: Generated file

Comment thread server/src/yemot-handler.service.ts Outdated
Comment on lines +159 to +161
const reportDate = new Date();
let reportGroupSessionId: number | undefined;

Comment thread server/src/yemot-handler.service.ts Outdated
Comment on lines +162 to +170
if (hasPermission(this.user, 'lessonSignature')) {
const reportGroup = await this.dataSource.getRepository(ReportGroup).save({
userId: this.user.id,
name: `נוכחות סמינר - ${klass.name}`,
topic: 'נוכחות סמינר',
teacherReferenceId: teacher.id,
klassReferenceId: klass.id,
year: getCurrentHebrewYear(),
});
Comment on lines +4 to +6
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DELETE FROM \`texts\` WHERE 1 = 1`);

HadasaSchechterV and others added 2 commits July 6, 2026 11:45
Between(startOfDay, endOfDay) binds full ISO datetime parameters, but
TypeORM's sqlite driver stores 'date'-typed columns as bare 'YYYY-MM-DD'
strings without applying that conversion to Between() bounds. The
lexicographic string comparison happened to work under Israel's UTC+3
offset but silently failed under UTC (e.g. CI), so hasReportedTodayForKlass
never found the existing report. Comparing against a plain date string
works correctly in both sqlite and MySQL.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Migration only inserts the new text keys instead of deleting and
  re-seeding the entire texts table, which risked wiping per-school
  text overrides for no reason (only 7 rows are actually new).
- Derive reportDate/sessionDate from Israel local time (not server
  local/UTC time) so records don't land on the wrong calendar day for
  calls near midnight; startTime already used Israel time.
- Wrap ReportGroup/ReportGroupSession/AttReport creation in a single
  transaction so a failure partway through can't leave orphaned rows.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@buzz-code
buzz-code merged commit 2ab4315 into main Jul 6, 2026
3 checks passed
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