Repository navigation
feat: attendance sheet import screen with prefilled template - #234
Merged
Merged
Conversation
Add a permission-gated screen (attendanceSheetImport) to download a prefilled per-class attendance workbook and upload it back as att reports. - Parser reads one class per sheet, teacher blocks of any width (block starts at teacher name/tz/lesson key, merged cells ignored), dates as Excel dates or dd/mm/yy(yy) text, blank cell = present. - Import is all-or-nothing: every error is listed with sheet + cell; re-upload updates existing reports by student+teacher+lesson+date. - Template: class code, class students, teacher and lesson per block, 10 date columns per teacher, RTL, required cells highlighted, data validation and an instructions sheet. Fixes buzz-code/ops#8 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UUoaKDcFVwbF3KPZg1Kmm3
Upload now runs a dry run first: the server parses and validates the file without saving and returns the reports it would create or update. A preview dialog shows the summary, warnings and reports (or the error list), and only "import" re-sends the file to save it in one transaction. Fixes buzz-code/ops#8 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UUoaKDcFVwbF3KPZg1Kmm3
Owner
Author
|
Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UUoaKDcFVwbF3KPZg1Kmm3
buzz-code
marked this pull request as ready for review
October 25, 2026 15:52
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.
Requested by הדסה · project thread
Fixes buzz-code/ops#8
Before: attendance kept in a shared per-class Excel workbook, with one column block per teacher, had no way into the system. The mail import only accepts the per-teacher file format.
After: users with the
attendanceSheetImportpermission get a new menu item, "קליטת קובץ נוכחות מגמה", under Data. On this screen they can download a prefilled workbook for a class and the lessons they pick. Uploading the filled workbook opens a preview dialog, like other Excel imports. The dialog shows the reports that would be created or updated plus any warnings, or lists every error by sheet and cell. Nothing is saved until the user clicks "ייבא", and then everything is saved in one transaction.How
Server (
att_reportactions, gated byattendanceSheetImportor admin, scoped to the logged-in user'suserId; an admin who is not impersonating a user is rejected)src/utils/attendanceSheet.util.tsparseAttendanceWorkbook: each sheet with the class-code label in E2 (or a value in F2) is one class; other sheets, such as instructions, are skipped.dd/mm/yy(yy)text. A column with no date is skipped, a blank count means 1 lesson, and a blank student cell meansabsCount = 0.importAttendanceWorkbookresolves klass and lesson for the current year, plus teacher and student, with one query per entity. It collects every error, warns (without blocking) when a student is not in the sheet's klass inStudentKlass, and saves all reports in one transaction.extra.dryRun=trueruns the same validation and returns the preview rows without saving.src/reports/attendanceSheetTemplate.ts: builds the template with ExcelJS: the class's students, then for each selected lesson a block with the teacher name/tz and lesson key, and 10 date columns. Lessons with no teacher keep those cells empty and yellow. The sheet is RTL, has date and whole-number validation, and includes an instructions sheet.Client
src/components/AttendanceSheetImport.jsx(route inApp.jsx, menu item inGeneralLayout.jsx, translations indomainTranslations.js,isAttendanceSheetImportinappPermissions.js, roadmap entry).Student.nameis a single field.Tests
attendanceSheet.util.spec.ts(parser): several teachers, one teacher, a column added at the end of a merged block, a column with no date, several sheets plus an instructions sheet, each error type with sheet + cell, re-upload updating instead of duplicating, dry run returning rows without saving, the not-in-klass warning, and theuserIdfilter.attendanceSheetTemplate.spec.ts(template): layout, empty yellow teacher cells when a lesson has no teacher, and a round trip in which a downloaded file filled with no other changes imports with no errors.att-report.service.spec.ts(endpoint): permission gate, admin-without-impersonation guard, action wiring, the dry-run flag, and rejection of a file that is not xlsx.AttendanceSheetImport.test.jsx(screen): preview then confirmed import, and the error list with no import button.vite buildpasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01UUoaKDcFVwbF3KPZg1Kmm3