feat(dataaccess): add GIW connection factory method
Add CreateGiwConnectionAsync to IDbConnectionFactory and DbConnectionFactory for connecting to the GIW Oracle database. This connection is needed for the StatusCode data sync pipeline. - Reuses existing CreateOracleConnectionAsync helper with "GIW" data source - Follows same pattern as JDE, JDEStage, and CMS connections - Includes 4 unit tests covering missing/empty/invalid connection strings
This commit is contained in:
@@ -87,6 +87,12 @@ public class DbConnectionFactory : IDbConnectionFactory
|
||||
return await CreateOracleConnectionAsync("CMS", ct).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<OracleConnection> CreateGiwConnectionAsync(CancellationToken ct = default)
|
||||
{
|
||||
return await CreateOracleConnectionAsync("GIW", ct).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<OracleConnection> CreateOracleConnectionAsync(string dataSource, CancellationToken ct)
|
||||
{
|
||||
var connectionString = _configuration.GetConnectionString(dataSource);
|
||||
|
||||
@@ -35,4 +35,11 @@ public interface IDbConnectionFactory
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>An open Oracle connection. Caller is responsible for disposal.</returns>
|
||||
Task<OracleConnection> CreateCmsConnectionAsync(CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Creates and opens a connection to the GIW Oracle database (for StatusCode sync).
|
||||
/// </summary>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>An open Oracle connection. Caller is responsible for disposal.</returns>
|
||||
Task<OracleConnection> CreateGiwConnectionAsync(CancellationToken ct = default);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user