Skip to content

feat(timetable-import): split multi-teacher lessons into one lesson per teacher - #397

Merged
Dasa122 merged 1 commit into
mainfrom
feat/split-multi-teacher-lessons
Sep 24, 2026
Merged

Dasa122 merged 1 commit into
mainfrom
feat/split-multi-teacher-lessons

Conversation

@Dasa122

@Dasa122 Dasa122 commented Sep 24, 2026

Copy link
Copy Markdown
Member

Summary

A source lesson that carries multiple teachers was imported as one row with a teacherIds array, so a substitution or a moved lesson could not target a single one of those teachers. processLesson now emits one lesson draft per teacher.

Changes

  • processLesson returns LessonDraft[]: a lesson resolving to more than one teacher becomes one draft per teacher, keeping the same cohorts, groups, classrooms, subject, day, period, term, week and periodsPerWeek; 0/1-teacher lessons stay a single draft.
  • scheduleKey is now <lessonIndex>:<draftIndex>.
  • Importer only — no migration, adapters or frontend changes. Each import creates a new timetable, so existing merged rows are superseded on the next import.

Verification

  • bun run lint
  • bun run typecheck
  • bun run build — if bundler config, routers, or server entrypoints changed
  • Translations added to both apps/iris/public/locales/en/translation.json and apps/iris/public/locales/hu/translation.json — if user-facing text changed
  • Migration generated with bun run db:generate and committed — if the schema changed

@filc-preview-vm

filc-preview-vm Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🗑️ Preview removed

Environment pr-397.preview.filc.petrik.hu
Commit 398c5a6
URL https://pr-397.preview.filc.petrik.hu
Edge check —

Posted by filc-deployer. The preview database is its own container and is
destroyed when this pull request closes.

@filc-preview-vm
filc-preview-vm Bot temporarily deployed to preview-pr-397 September 24, 2026 20:33 Destroyed
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 3b01d81c-8ce3-4cea-86eb-7ef949b7310d

📥 Commits

Reviewing files that changed from the base of the PR and between 59e644b and 398c5a6.

📒 Files selected for processing (1)
  • packages/timetable-import/src/import.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: quality
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
packages/timetable-import/src/import.ts (1)

1114-1114: LGTM!

Also applies to: 1118-1118, 1129-1129, 1158-1158, 1259-1259


📝 Walkthrough

Walkthrough

processLesson now returns an array of lesson drafts. It returns no drafts when required mappings are unresolved and creates one draft per distinct mapped teacher when a lesson has multiple teachers. loadLessons appends every returned draft.

Changes

Lesson draft processing

Layer / File(s) Summary
Process and load lesson drafts
packages/timetable-import/src/import.ts
processLesson returns an array, skips unresolved lessons with an empty array, and creates separate drafts for multiple distinct mapped teachers. Each draft receives its own row, key, and schedule key. loadLessons appends all returned drafts.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 398c5

The teacher-specific lesson rows appear mergeable after normal checks; no concrete blocking issue was established.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: splitting multi-teacher timetable lessons into one lesson per teacher.
Description check ✅ Passed The description follows the required Summary, Changes, and Verification sections. It explains the behavior change, scope, and verification results. The issue reference after "Closes #" is blank, but t…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Dasa122
Dasa122 merged commit 4719b2a into main Sep 24, 2026
6 checks passed
@Dasa122
Dasa122 deleted the feat/split-multi-teacher-lessons branch September 24, 2026 20:46

This branch was successfully deployed

No deployments
preview-pr-397 — 398c5a6f Deployed Sep 24, 2026 by filc-preview-vm[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant