Import: CSV mapping wizard with revertible batches

New /import/wizard: upload an arbitrary CSV, preview the column grid, map each column to a role + target meter/category + unit, dry-run, then commit as a revertible import_batch. The /import page now lists recent imports with one-click revert. Adds CsvImporter.ReadRawRows (raw preview) and Confirm.ConfirmAsync (generic confirm). Verified end-to-end in a real browser + direct DB checks.

Claude-Session: https://claude.ai/code/session_01Kib2MniVFbD95fkgLgBBnB
This commit is contained in:
2026-07-17 11:05:01 +02:00
parent b3b8b92520
commit 14930bc3d8
4 changed files with 507 additions and 6 deletions
+6
View File
@@ -222,6 +222,12 @@ public sealed class CsvImporter
return true;
}
/// <summary>
/// Reads the raw CSV grid (no profile applied) so the import wizard can show a column preview
/// and let the user map columns before staging. Rows are ragged (their own field counts).
/// </summary>
public static IReadOnlyList<string[]> ReadRawRows(TextReader reader) => ReadRows(reader);
internal static List<string[]> ReadRows(TextReader reader)
{
var config = new CsvConfiguration(CultureInfo.InvariantCulture)