Skip to content

Seminar Yemot: ask caller for lesson number when no schedule matches - #200

Merged
buzz-code merged 2 commits into
mainfrom
claude/yemot-phone-lesson-4jb5c9
Oct 5, 2026
Merged

buzz-code merged 2 commits into
mainfrom
claude/yemot-phone-lesson-4jb5c9

Conversation

@buzz-code

@buzz-code buzz-code commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Requested by Wolf: the responsible girl types the lesson number on the phone.

  • In the seminar attendance flow, if today's LessonSchedule has no slot for teacher + klass, the caller is asked SEMINAR.LESSON_PROMPT ("הקישי מספר השיעור הנלמד") and types the lesson key. Invalid or non-numeric key → SEMINAR.INVALID_LESSON, retry.
  • Schedule match still wins (no prompt), keeping the Add lesson schedule Excel upload with Yemot auto-detect #104 auto-detect.
  • No lessons for the current year → prompt skipped, report saved without a lesson (previous behavior), so other seminar users aren't stuck.
  • The resolved lesson feeds the existing duplicate-lesson question (Seminar duplicate-lesson guard (from PR #191, real migration timestamp) #192), so repeat punches are caught even without schedules.
  • Lesson keys are shared across klasses (unique per user + year); klass still comes from the phone.
  • Migration adds the two new texts.

Notes

  • Test file seeds Lesson via raw insert: its MySQL-only generated column (klass_reference_ids_json) is rejected by sqlite on repository save.

Testing

  • cd server && yarn test: 119 suites, 1158 tests pass.
  • New tests: invalid / * lesson retry, no lessons configured, typed lesson → duplicate question; existing no-schedule tests now assert lessonReferenceId.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NkWmy3KJrSBJj1xuCduZmg

When today's LessonSchedule has no slot for the teacher+klass, the caller
now types the lesson key (SEMINAR.LESSON_PROMPT, retry on
SEMINAR.INVALID_LESSON). The resolved lesson feeds the existing
duplicate-lesson question, so repeat punches are caught without
schedules. Lesson keys are shared across klasses; klass still comes from
the phone.

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

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

🟡 Changes recommended

Star input causes lookup failure, while missing current-year lessons leave callers stuck retrying.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds manual lesson selection to seminar phone attendance when schedule lookup fails, extending existing duplicate-report checks.

Changes:

  • Prompts for lesson key while keeping schedule matches preferred.
  • Adds retry and duplicate-report scenarios.
  • Seeds Hebrew lesson prompt and invalid-input texts.
File Description
server/​src/​yemot-handler.service.ts Adds lesson-input fallback and duplicate checks.
server/​src/​yemot-handler.service.test.ts Covers manual selection, retries, and duplicates.
server/​src/​migrations/​1791148265311-AddYemotTextsSeminarLessonPrompt.ts Adds two phone-flow texts with rollback.

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

Comment thread server/src/yemot-handler.service.ts Resolved
Comment thread server/src/yemot-handler.service.ts Resolved
…nput

- No current-year lessons: skip the prompt and save without a lesson
  (previous behavior) instead of looping forever.
- Non-digit input (e.g. '*') plays SEMINAR.INVALID_LESSON and retries
  instead of querying with NaN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkWmy3KJrSBJj1xuCduZmg
@buzz-code
buzz-code merged commit 151a22e into main Oct 5, 2026
4 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