Skip to content

Add manager report call and student name confirmation - #117

Merged
buzz-code merged 7 commits into
mainfrom
claude/teacher-phone-call-flow-oan736
Jul 18, 2026
Merged

buzz-code merged 7 commits into
mainfrom
claude/teacher-phone-call-flow-oan736

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

Extends the Yemot phone integration to support manager report calls and adds student name confirmation during seminar attendance reporting.

Key Changes

Manager Report Call Feature:

  • Added processManagerReportCall() to handle calls from a designated manager phone number
  • Manager calls receive a summary of which teachers reported attendance today and which did not
  • Detects manager calls via isManagerCall() which checks if the incoming phone matches user.additionalData.managerPhone
  • Added TeacherReportedToday view entity to query reported teachers efficiently
  • Added manager-specific text keys: MANAGER.NO_SCHEDULE_TODAY and MANAGER.REPORT_STATUS_TODAY

Student Name Confirmation:

  • Added confirmation step after student number entry during seminar attendance reporting
  • System asks user to confirm the student name before recording absence
  • If user rejects the name, system prompts to re-enter the student number
  • Added text keys: SEMINAR.CONFIRM_STUDENT_NAME and SEMINAR.STUDENT_NAME_REJECTED

UI & Settings:

  • Added ManagerPhoneSettingsInput component for users to configure their manager phone number
  • Added teacher-reported-today entity with card-based view showing reported teachers grouped by date
  • Updated translations and roadmap features

Test Improvements:

  • Extracted reusable scenario-step helpers (respondToTz, rejectTz, respondToTransport, etc.) to reduce test boilerplate
  • Added comprehensive test for name confirmation rejection flow
  • Added tests for manager report call scenarios (with/without schedules)

Database:

  • Added migration for new text entries
  • Added migration to create teacher_reported_today view

https://claude.ai/code/session_01JWhMYTU8nWdtFgRpCWmWJe

claude added 7 commits July 15, 2026 19:08
…endance IVR

- Teacher attendance phone flow now reads back the student's name and asks
  for confirmation (1 = correct, 2 = wrong) before recording an absence.
- Add a manager phone number setting (gated by seminarAttendanceYemot) so a
  manager can call in and hear which teachers reported attendance today and
  which did not.
- Add a "today's teacher phone calls" report page for a live, readable view
  of phone-in attendance activity throughout the day.
…l migrations

- Manager report call now selects DISTINCT teacherReferenceId instead of
  fetching every AttReport row (one per student) just to check who reported.
- Generated the TeacherPhoneCallToday view migration from a real MySQL diff
  (typeorm:generate) instead of hand-writing it, and re-created the text-seed
  migration with typeorm:create so both carry accurate timestamps. Verified
  apply -> generate (no diff) -> revert -> re-apply against a live database.
- Drop the CURDATE() restriction baked into the view so it can serve any
  date range; regenerated the migration against a real MySQL diff.
- Add From/To date filters (callTime:$gte/$lte) to the client list,
  defaulting to today so the default view is unchanged, but any other
  date or range can now be selected.
- Base the view on att_reports instead of yemot_call: it now shows which
  teachers reported attendance on a given date, regardless of channel
  (phone or otherwise), grouped by teacher + report date.
- Add an admin-only user column and admin user filter, matching the
  convention used elsewhere (adminUserFilter + isAdmin-gated ReferenceField).
- Rename resource/view/files from teacher_phone_call_today to
  teacher_reported_today to match the new scope; regenerated the migration
  against a real MySQL diff and verified apply/generate/revert/re-apply.
- View now has one row per teacher+lesson+date (left join to lessons),
  plus each teacher's earliest report time that day via a window function,
  instead of one pre-aggregated row per teacher+date.
- Replace the Datagrid with a custom card list: one card per teacher,
  grouping its lesson rows client-side into chips, with the admin-only
  user reference, date, and hour shown in the card header.
- Regenerated the migration against a real MySQL diff and verified the
  apply/generate/revert/re-apply loop, including a multi-lesson-per-teacher
  case against real att_reports data.
- Teacher-reported-today cards now lay out in a responsive CSS grid
  (auto-fill, 320px min) instead of a single column, so multiple cards
  share a row on wider screens.
- Extract repeated systemAsks/userResponds sequences in
  yemot-handler.service.test.ts (TZ prompt, transport prompt, departure
  confirmation, klass prompt, absent-student add/reject/finish) into small
  named helper functions, reused across the transport and seminar test
  groups instead of repeating the same steps in every test.
- View now selects grouped att_reports columns directly (teacherReferenceId,
  lessonReferenceId) with no joins to teachers/lessons at all, matching how
  every other entity in this app resolves those references on the client.
- Card header resolves the teacher name via ReferenceField+TextField;
  lesson chips resolve via ReferenceField+ChipField per lesson row.
  React-admin batches these into one getMany per reference type, so this
  isn't N+1 despite the extra requests.
- Regenerated the migration against a real MySQL diff and verified the
  apply/generate/revert/re-apply loop plus real query output.
@buzz-code
buzz-code merged commit 6b3063e into main Jul 18, 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.

2 participants