feat: import leftover student fields into notes and show them on the roster

Store leftover CSV columns on hidden student notes, move catalog import to /events/import, and persist Students index columns from Chapter Settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-29 23:55:03 -04:00
co-authored by Cursor
parent 4c91db37c2
commit 4cfd85b902
39 changed files with 2437 additions and 166 deletions
+23
View File
@@ -0,0 +1,23 @@
# Import Event Catalog
**Created:** 2026-08-29
**Last updated:** 2026-08-29
**Description:** How `/events/import` adds event definitions from CSV.
## Where this is
This is the **event catalog** (names, team size, format). It is not student event rankings (`/students/event-ranking/import`) and not the calendar schedule (`/calendar/event-occurrences/import`).
## Steps
1. Sign in as an Administrator.
2. Open **Events** and click **Import**, or go to `/events/import`.
3. Upload a CSV, **Parse**, review new vs existing counts, then **Save to Database**.
Existing event names are skipped. Re-importing the same catalog is safe.
## Required columns
`Event`, `Team Size`, `State Count`
Optional columns the parser already reads include `Short Name`, `EventFormat`, `Level of Effort`, `Eligibility`, `Description`, `Theme`, `Documentation`, `State Presubmission`, `Semifinalist Activity`, and `Regional Notes`.
+50
View File
@@ -0,0 +1,50 @@
# Import Students and Note Fields
**Created:** 2026-08-29
**Last updated:** 2026-08-29
**Description:** How `/students/import` creates students and merges leftover CSV columns into each student's markdown notes.
## Where notes live
Each student has a system note titled `#Student:{id}`. It is edited on the student edit page and shown on student details. Those notes are hidden from the main Notes list.
Imported leftover values go in a table under `## Imported fields`. Other markdown above or below that heading is left alone.
## CSV format
```
Student Name,Grade,TSA year,State ID,Regional ID,National ID,Interview Time,Application,Club Permission Slip,Teacher Rec 1,Teacher Rec 2,Teacher Rec 3
"Last, First",6,1st,,,,3:20-3:35,x,x,Fuqua,Young,
```
- Roster (required): `Student Name` (`Last, First` or `First Last`), `Grade`, `TSA year`.
- Roster (optional): `State ID`, `Regional ID`, `National ID`.
- Every other column becomes a Field/Value row. Later files can add columns without a code change.
- A cell that is only `x` / `X` is stored as `Yes`. Blank stays blank.
- Rank columns `1`–`10`, `Officer`, and `TOTAL # OF EVENTS` are ignored (use `/students/event-ranking/import` for rankings).
A notes-only file without `Grade` will not import. Put roster and leftover columns in the same CSV.
## Merge rules
- New students are inserted. Existing first+last name matches are skipped for the roster (add-only).
- After students are saved, leftover columns are fuzzy-matched by name and merged into notes. Existing students still receive note updates.
- Incoming values win when a field already exists, including a blank cell that clears a previous value.
- New fields are appended. Fields not in this CSV stay. Blank cells are stored and re-imported as a no-op.
- Duplicate rows for the same student collapse into one note match; the last row wins for overlapping field names.
- Importing the same file twice adds no students and writes no note history.
## Steps
1. Sign in as an Administrator.
2. Open **Students** and click **Import**, or go to `/students/import`.
The arrow next to **Import** downloads a CSV template (roster columns, Students index columns, and any other imported fields already in notes).
`/import` still opens this same student page.
3. Upload the student CSV.
4. Review new vs existing counts and leftover field names.
5. **Save to Database**.
## Index columns
Chapter Settings → **Student Index Columns** lists which imported field names appear as extra columns on the Students index. The page also shows field names already present in student notes; click a chip to add or remove it from the list. Open Students again after saving; a restart is not required.
+7 -5
View File
@@ -1,7 +1,8 @@
# Year Rollover Runbook
**Created:** 2026-08-14
**Last updated:** 2026-08-28
**Last updated:** 2026-08-29
**Description:** How to roll the chapter into a new competition year using the locked New Year wizard.
## Prerequisites
@@ -36,9 +37,10 @@
- Type the target competition year exactly to enable **Apply rollover**.
- Confirm the destructive dialog. The wizard creates `Data/backups/pre-rollover-yyyyMMdd-HHmmss.db` first; that file is the only undo.
9. **Restart the application** so the home page and printouts show the new competition year.
10. **Add new students** via `/students/create` or `/import`.
- `/import` is add-only and skips existing first+last name matches, so re-importing a full roster is safe for returners.
11. **Import the new state schedule** from the calendar import page.
10. **Add new students** via `/students/create` or `/students/import`.
- Student import is add-only for roster rows and skips existing first+last name matches, so re-importing a full roster is safe for returners.
- Leftover CSV columns (interview time, application, and so on) are merged into each student's notes. Rank columns stay on `/students/event-ranking/import`. See `docs/instructions/student-notes-import.md`.
11. **Import the new state schedule** from the calendar import page. If the chapter event file changed, refresh the catalog at `/events/import` (add-only by event name).
12. On **Meeting Schedule**, click **Reset** once. That page keeps team/student ids in browser localStorage; after a rollover those ids are stale.
13. Collect new event rankings (CSV import at `/students/event-ranking/import`, or the ranking editor) and run team assignment as usual.
@@ -48,7 +50,7 @@
|---------|------|
| Non-returning students | Returning students (promoted) |
| All teams | Event definitions (national catalog) |
| All event rankings | Notes (including meeting notes by title) |
| All event rankings | Notes (including meeting notes by title; notes for removed students are soft-deleted) |
| All meeting history attendance snapshots | Database backup under `Data/backups/` |
| Event occurrences (when checked) | |