feat(api): add PipelineController and factory methods for pipeline viewer

- Add GetAvailableTables, GetPipelineConfig, GetScheduleDefaults to IEtlPipelineFactory
- Implement new methods in EtlPipelineFactory
- Create PipelineController with endpoints:
  - GET /api/pipelines - list all pipeline names
  - GET /api/pipelines/{name} - get pipeline configuration
  - GET /api/pipelines/{name}/status - get schedule status
  - GET /api/pipelines/{name}/executions - get execution history
- Add JdeScoping.DataSync reference to JdeScoping.Api
This commit is contained in:
Joseph Doherty
2026-01-07 08:06:45 -05:00
parent 33a04f4022
commit 676f090fc8
4 changed files with 256 additions and 0 deletions
@@ -1,11 +1,36 @@
using JdeScoping.Core.Models.Enums;
using JdeScoping.DataSync.Configuration;
using JdeScoping.DataSync.Etl.Pipeline;
namespace JdeScoping.DataSync.Contracts;
public interface IEtlPipelineFactory
{
/// <summary>
/// Creates a pipeline builder for the specified table.
/// </summary>
/// <param name="tableName">The table name (pipeline key).</param>
/// <returns>A builder for configuring the pipeline.</returns>
IEtlPipelineBuilder ForTable(string tableName);
/// <summary>
/// Gets the list of available table names (pipeline keys).
/// </summary>
/// <returns>List of table names with configured pipelines.</returns>
IReadOnlyList<string> GetAvailableTables();
/// <summary>
/// Gets the configuration for a specific pipeline.
/// </summary>
/// <param name="tableName">The table name (pipeline key).</param>
/// <returns>The pipeline configuration, or null if not found.</returns>
PipelineConfig? GetPipelineConfig(string tableName);
/// <summary>
/// Gets the schedule defaults from the configuration.
/// </summary>
/// <returns>The schedule defaults.</returns>
ScheduleDefaults GetScheduleDefaults();
}
public interface IEtlPipelineBuilder
@@ -90,6 +90,24 @@ public class EtlPipelineFactory : IEtlPipelineFactory
_logger);
}
/// <inheritdoc />
public IReadOnlyList<string> GetAvailableTables()
{
return _config.Pipelines.Keys.ToList().AsReadOnly();
}
/// <inheritdoc />
public PipelineConfig? GetPipelineConfig(string tableName)
{
return _config.Pipelines.TryGetValue(tableName, out var config) ? config : null;
}
/// <inheritdoc />
public ScheduleDefaults GetScheduleDefaults()
{
return _config.EffectiveScheduleDefaults;
}
private PipelinesRoot LoadPipelineConfigs(string configPath)
{
// Resolve path relative to assembly location (handles both debug and publish)