From 4b3c900d52c5827306fe5d21d3088f44c98d2a88 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Wed, 7 Jan 2026 00:58:56 -0500 Subject: [PATCH] feat(datasync): add GIW connection type to DbQuerySource Add support for "giw" connection type in DbQuerySource to enable the StatusCode pipeline to query from the GIW Oracle database. --- .../JdeScoping.DataSync/Etl/Sources/DbQuerySource.cs | 5 +++-- .../Etl/Sources/DbQuerySourceTests.cs | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/NEW/src/JdeScoping.DataSync/Etl/Sources/DbQuerySource.cs b/NEW/src/JdeScoping.DataSync/Etl/Sources/DbQuerySource.cs index eca0ea5..d5b3b94 100644 --- a/NEW/src/JdeScoping.DataSync/Etl/Sources/DbQuerySource.cs +++ b/NEW/src/JdeScoping.DataSync/Etl/Sources/DbQuerySource.cs @@ -12,7 +12,7 @@ public class DbQuerySource : IImportSource { private static readonly HashSet ValidConnectionTypes = new(StringComparer.OrdinalIgnoreCase) { - "jde", "cms", "lotfinder" + "jde", "cms", "lotfinder", "giw" }; private readonly IDbConnectionFactory _connectionFactory; @@ -48,7 +48,7 @@ public class DbQuerySource : IImportSource if (!ValidConnectionTypes.Contains(connectionType)) { - throw new ArgumentException($"Unknown connection type: {connectionType}. Valid types are: jde, cms, lotfinder.", nameof(connectionType)); + throw new ArgumentException($"Unknown connection type: {connectionType}. Valid types are: jde, cms, lotfinder, giw.", nameof(connectionType)); } _connectionFactory = connectionFactory; @@ -77,6 +77,7 @@ public class DbQuerySource : IImportSource { "jde" => await _connectionFactory.CreateJdeConnectionAsync(cancellationToken), "cms" => await _connectionFactory.CreateCmsConnectionAsync(cancellationToken), + "giw" => await _connectionFactory.CreateGiwConnectionAsync(cancellationToken), "lotfinder" => await _connectionFactory.CreateLotFinderConnectionAsync(cancellationToken), _ => throw new InvalidOperationException($"Unknown connection type: {_connectionType}") }; diff --git a/NEW/tests/JdeScoping.DataSync.Tests/Etl/Sources/DbQuerySourceTests.cs b/NEW/tests/JdeScoping.DataSync.Tests/Etl/Sources/DbQuerySourceTests.cs index 5c07403..8eff4a9 100644 --- a/NEW/tests/JdeScoping.DataSync.Tests/Etl/Sources/DbQuerySourceTests.cs +++ b/NEW/tests/JdeScoping.DataSync.Tests/Etl/Sources/DbQuerySourceTests.cs @@ -81,4 +81,15 @@ public class DbQuerySourceTests var source = new DbQuerySource(factory, "jde", "SELECT 1", commandTimeout: 7200); source.SourceName.ShouldBe("DbQuery:jde"); } + + [Fact] + public void Constructor_WithGiwConnectionType_DoesNotThrow() + { + // Arrange + var connectionFactory = Substitute.For(); + + // Act & Assert - should not throw + var source = new DbQuerySource(connectionFactory, "giw", "SELECT 1", null); + source.SourceName.ShouldBe("DbQuery:giw"); + } }