From bfbec425f4ce6f8839b98ba626df499883b02fbd Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 6 Jan 2026 23:21:28 -0500 Subject: [PATCH] feat(ExcelIO): add ColumnDefinition for fluent mapping --- ...{FileController.cs => FileIOController.cs} | 0 .../Mapping/ColumnDefinition.cs | 34 +++++++++++++++++++ 2 files changed, 34 insertions(+) rename NEW/src/JdeScoping.Api/Controllers/{FileController.cs => FileIOController.cs} (100%) create mode 100644 NEW/src/JdeScoping.ExcelIO/Mapping/ColumnDefinition.cs diff --git a/NEW/src/JdeScoping.Api/Controllers/FileController.cs b/NEW/src/JdeScoping.Api/Controllers/FileIOController.cs similarity index 100% rename from NEW/src/JdeScoping.Api/Controllers/FileController.cs rename to NEW/src/JdeScoping.Api/Controllers/FileIOController.cs diff --git a/NEW/src/JdeScoping.ExcelIO/Mapping/ColumnDefinition.cs b/NEW/src/JdeScoping.ExcelIO/Mapping/ColumnDefinition.cs new file mode 100644 index 0000000..fade702 --- /dev/null +++ b/NEW/src/JdeScoping.ExcelIO/Mapping/ColumnDefinition.cs @@ -0,0 +1,34 @@ +namespace JdeScoping.ExcelIO.Mapping; + +/// +/// Defines how a property maps to an Excel column. +/// +public sealed class ColumnDefinition +{ + /// Property name for debugging/error messages. + public required string PropertyName { get; init; } + + /// Compiled delegate to get property value from object. + public required Func ValueGetter { get; init; } + + /// Property type for formatting decisions. + public required Type PropertyType { get; init; } + + /// Column display order (lower = leftmost). + public int Order { get; set; } + + /// Column header text. + public string HeaderText { get; set; } = string.Empty; + + /// Excel number format string. + public string Format { get; set; } = "@"; + + /// Auto-size column width. + public bool AutoWidth { get; set; } = true; + + /// Manual column width (when AutoWidth = false). + public double Width { get; set; } + + /// Enable text wrapping. + public bool WrapText { get; set; } +}