From f87805b931ad78ebd4a788e9422b6a5bba04606d Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 22 Jan 2026 07:12:22 -0500 Subject: [PATCH] feat(configmanager): add NonMatchBehavior enum and regex properties to TransformerModel Add configuration model support for the new Regex transformer including: - NonMatchBehavior enum with JSON string serialization - ColumnName, Pattern, Replacement, IgnoreCase, NonMatchBehavior properties --- .../Models/PipelineModel.cs | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Models/PipelineModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Models/PipelineModel.cs index 05eff08..d3abe74 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Models/PipelineModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Models/PipelineModel.cs @@ -1,3 +1,5 @@ +using System.Text.Json.Serialization; + namespace JdeScoping.ConfigManager.Models; /// @@ -212,4 +214,43 @@ public class TransformerModel /// Gets or sets the output column name for JdeDate transformer. /// public string? OutputColumn { get; set; } + + /// + /// Gets or sets the column name for Regex transformer. + /// + public string? ColumnName { get; set; } + + /// + /// Gets or sets the regex pattern for Regex transformer. + /// + public string? Pattern { get; set; } + + /// + /// Gets or sets the replacement string for Regex transformer (null = Match & Extract mode). + /// + public string? Replacement { get; set; } + + /// + /// Gets or sets whether regex matching is case-insensitive. + /// + public bool IgnoreCase { get; set; } + + /// + /// Gets or sets the behavior when regex pattern does not match. + /// + public NonMatchBehavior NonMatchBehavior { get; set; } = NonMatchBehavior.KeepOriginal; +} + +/// +/// Specifies behavior when a regex pattern does not match the input value. +/// +[JsonConverter(typeof(JsonStringEnumConverter))] +public enum NonMatchBehavior +{ + /// Keep the original value unchanged. + KeepOriginal, + /// Return null/DBNull. + ReturnNull, + /// Return an empty string. + ReturnEmpty }