From 48180259d2631f583170aa1ac05af8629a687451 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 6 Jan 2026 23:22:56 -0500 Subject: [PATCH] feat(ExcelIO): add ColumnBuilder fluent API --- .../Mapping/ColumnBuilder.cs | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 NEW/src/JdeScoping.ExcelIO/Mapping/ColumnBuilder.cs diff --git a/NEW/src/JdeScoping.ExcelIO/Mapping/ColumnBuilder.cs b/NEW/src/JdeScoping.ExcelIO/Mapping/ColumnBuilder.cs new file mode 100644 index 0000000..d82fded --- /dev/null +++ b/NEW/src/JdeScoping.ExcelIO/Mapping/ColumnBuilder.cs @@ -0,0 +1,52 @@ +namespace JdeScoping.ExcelIO.Mapping; + +/// +/// Fluent builder for configuring Excel column properties. +/// +/// The model type being mapped. +/// The property type. +public sealed class ColumnBuilder +{ + private readonly ColumnDefinition _definition; + + internal ColumnBuilder(ColumnDefinition definition) + { + _definition = definition; + } + + /// Sets the column display order. + public ColumnBuilder Order(int order) + { + _definition.Order = order; + return this; + } + + /// Sets the column header text. + public ColumnBuilder Header(string text) + { + _definition.HeaderText = text; + return this; + } + + /// Sets the Excel number format. + public ColumnBuilder Format(string format) + { + _definition.Format = format; + return this; + } + + /// Sets a fixed column width (disables auto-width). + public ColumnBuilder Width(double width) + { + _definition.AutoWidth = false; + _definition.Width = width; + return this; + } + + /// Enables text wrapping for the column. + public ColumnBuilder WrapText(bool wrap = true) + { + _definition.WrapText = wrap; + return this; + } +}