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
+24
View File
@@ -1,4 +1,6 @@
using Core.Models;
using Core.Notes;
using Microsoft.Extensions.Configuration;
namespace WebApp.Models;
@@ -51,4 +53,26 @@ public class ChapterSettings
/// School level for the chapter (null = import both MS and HS events)
/// </summary>
public SchoolLevel? SchoolLevel { get; set; }
/// <summary>
/// Field names from student note <c>## Imported fields</c> tables to show as Students index columns.
/// </summary>
public List<string> StudentIndexNoteFields { get; set; } = [.. StudentNoteFieldDefaults.IndexColumns];
public static ChapterSettings FromConfiguration(IConfiguration configuration)
{
var settings = configuration.GetSection("ChapterSettings").Get<ChapterSettings>()
?? new ChapterSettings();
settings.StudentIndexNoteFields = ReadIndexNoteFields(configuration);
return settings;
}
public static List<string> ReadIndexNoteFields(IConfiguration configuration)
{
var fields = configuration.GetSection("ChapterSettings:StudentIndexNoteFields").Get<List<string>>();
if (fields is null)
return [.. StudentNoteFieldDefaults.IndexColumns];
return [.. fields.Where(f => !string.IsNullOrWhiteSpace(f)).Select(f => f.Trim())];
}
}