Files
chapter-organizer/Core/Models/StudentNotesImportResult.cs
poprhythmandCursor 4cfd85b902 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>
2026-08-29 23:55:03 -04:00

49 lines
1.2 KiB
C#

using Core.Entities;
using Core.Notes;
namespace Core.Models;
/// <summary>
/// Result of parsing a student notes field CSV.
/// </summary>
public class StudentNotesImportResult
{
public List<StudentNotesImportMatch> Matches { get; set; } = [];
public List<StudentNotesImportIssue> Issues { get; set; } = [];
public List<string> Errors { get; set; } = [];
public List<string> Warnings { get; set; } = [];
public IReadOnlyList<string> FieldNames { get; set; } = [];
public bool IsSuccess => Errors.Count == 0;
public int StudentsWithChanges => Matches.Count(m => m.Merge.Changed);
}
public class StudentNotesImportMatch
{
public required Student Student { get; set; }
public string RawStudentName { get; set; } = string.Empty;
public int RowNumber { get; set; }
public int StudentScore { get; set; }
public List<ImportedField> IncomingFields { get; set; } = [];
public required ImportedFieldsMergeResult Merge { get; set; }
}
public class StudentNotesImportIssue
{
public int RowNumber { get; set; }
public string RawStudentName { get; set; } = string.Empty;
public string Message { get; set; } = string.Empty;
}