Skip to content

Add lesson schedule Excel upload with Yemot auto-detect - #104

Merged
buzz-code merged 3 commits into
mainfrom
claude/excel-attendance-upload-s1x2ni
Jul 7, 2026
Merged

buzz-code merged 3 commits into
mainfrom
claude/excel-attendance-upload-s1x2ni

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

  • Add a new LessonSchedule entity for uploading a daily teacher lesson-schedule Excel file, with natural-key resolution against Klass/Lesson/Teacher (same pattern as Lesson/AttReport).
  • Add a client upload button (LessonScheduleImportButton) that splits the combined "lesson number + group" Excel column and replaces existing rows for any date being re-uploaded (only once the admin confirms the save). The lesson_schedule resource is gated behind a new lessonSchedule app permission.
  • Update the Yemot seminar attendance call flow (processSeminarAttendanceCall) to auto-detect the calling teacher's current lesson from the uploaded schedule (nearest start time to now), recording lessonReferenceId on the saved AttReport rows. Falls back to the existing manual klass-keypad entry when no schedule match is found.

Test plan

  • cd server && yarn test — 905 tests passing, including two new scenario tests (schedule match auto-detect, and fallback to manual entry when no schedule exists)
  • cd client && yarn test — 149 tests passing
  • cd server && yarn build and cd client && yarn build succeed
  • Manual smoke test (upload the sample Excel file, verify a real IVR call) — not done in this session, no Docker daemon available in this environment

🤖 Generated with Claude Code


Generated by Claude Code

claude added 2 commits July 7, 2026 07:27
Admins can upload a daily teacher lesson-schedule Excel file into a new
LessonSchedule entity (natural-key resolved against Klass/Lesson/Teacher,
same pattern as Lesson/AttReport). Re-uploading a date replaces its rows.

The seminar attendance Yemot call flow now looks up the calling teacher's
current lesson from that schedule (nearest start time to now) instead of
always asking for a klass number by keypad, and records the resolved
lesson on the saved AttReport rows. Falls back to the existing manual
klass-entry flow when no schedule match is found.

The new resource is gated behind a new lessonSchedule app permission.
Field/filter labels are already defined under the lesson_schedule resource
in domainTranslations.js, so explicit label props were redundant.
Copilot AI review requested due to automatic review settings July 7, 2026 07:55

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 lesson_schedule data model and UI workflow for importing daily lesson schedules from Excel, and uses that schedule to auto-detect the current lesson during Yemot seminar attendance calls (persisting lessonReferenceId on generated AttReport rows) with a fallback to the existing manual klass entry path.

Changes:

  • Introduce LessonSchedule entity + migration + entity-module registration for CRUD/export.
  • Add React-Admin resource + Excel import/preview flow for lesson_schedule, gated behind a new lessonSchedule permission.
  • Update Yemot seminar attendance flow to attempt schedule-based klass/lesson detection; add tests for both match and fallback.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/src/yemot-handler.service.ts Adds schedule lookup and lessonReferenceId propagation during seminar attendance calls.
server/src/yemot-handler.service.test.ts Adds scenario tests for schedule auto-detect and fallback behavior.
server/src/migrations/1783407769935-AddLessonSchedule.ts Creates lesson_schedules table and indexes.
server/src/entity-modules/lesson-schedule.config.ts Registers CRUD/export configuration for LessonSchedule.
server/src/entities.module.ts Registers lesson_schedule module + display name mapping.
server/src/db/entities/LessonSchedule.entity.ts Defines LessonSchedule entity + reference-id resolution hooks.
client/src/utils/appPermissions.js Adds lessonSchedule application permission helpers.
client/src/roadmapFeatures.js Marks the feature as completed in the roadmap list.
client/src/entities/lesson-schedule.jsx Adds React-Admin resource screens + list action for importing schedules.
client/src/domainTranslations.js Adds translations for the new lesson_schedule resource fields.
client/src/components/LessonScheduleImportButton.jsx Adds Excel import/preview/save flow with lesson+group split and date replacement.
client/src/App.jsx Registers the lesson_schedule resource in the UI behind permission gating.
Files not reviewed (1)
  • client/src/roadmapFeatures.js: Generated file

Comment on lines +62 to +71
const schedule = await this.getScheduleForTeacherNow(teacher);
let klass: Klass;
let lessonReferenceId: number | undefined;
if (schedule) {
klass = await this.dataSource.getRepository(Klass).findOneBy({ id: schedule.klassReferenceId });
lessonReferenceId = schedule.lessonReferenceId;
}
if (!klass) {
klass = await this.getKlassByInput();
}
Addresses review comment: relying on implicit undefined made the
fallback-to-manual-entry control flow less explicit.
@buzz-code
buzz-code merged commit 5e6b319 into main Jul 7, 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