Repository navigation
feat(yemot): add phone-based seminar attendance flow - #102
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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
AttReportrows and (optionally)ReportGroup/ReportGroupSession. - Add
studentNumbertoStudent(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 on lines
+159
to
+161
| const reportDate = new Date(); | ||
| let reportGroupSessionId: number | undefined; | ||
|
|
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`); | ||
|
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.