diff --git a/NEW/src/JdeScoping.DataSync/Etl/Contracts/IDataTransformer.cs b/NEW/src/JdeScoping.DataSync/Etl/Contracts/IDataTransformer.cs new file mode 100644 index 0000000..f3ac31c --- /dev/null +++ b/NEW/src/JdeScoping.DataSync/Etl/Contracts/IDataTransformer.cs @@ -0,0 +1,21 @@ +using System.Data; + +namespace JdeScoping.DataSync.Etl.Contracts; + +/// +/// Defines a transformer that can modify or enhance data during the ETL process. +/// +public interface IDataTransformer +{ + /// + /// Transforms the source data reader into a new data reader with modifications applied. + /// + /// The source data reader to transform. + /// A new IDataReader with transformations applied. + IDataReader Transform(IDataReader source); + + /// + /// Gets the name of this transformer for logging and identification. + /// + string TransformerName { get; } +} diff --git a/NEW/src/JdeScoping.DataSync/Etl/Contracts/IImportDestination.cs b/NEW/src/JdeScoping.DataSync/Etl/Contracts/IImportDestination.cs new file mode 100644 index 0000000..cfa3348 --- /dev/null +++ b/NEW/src/JdeScoping.DataSync/Etl/Contracts/IImportDestination.cs @@ -0,0 +1,25 @@ +using System.Data; +using JdeScoping.DataSync.Etl.Results; + +namespace JdeScoping.DataSync.Etl.Contracts; + +/// +/// Defines a destination to which data can be written during import operations. +/// +public interface IImportDestination +{ + /// + /// Writes data from the source reader to the destination asynchronously. + /// + /// The data reader containing the data to write. + /// Token to cancel the operation. + /// A result containing statistics about the write operation. + Task WriteAsync( + IDataReader source, + CancellationToken cancellationToken = default); + + /// + /// Gets the name of this destination for logging and identification. + /// + string DestinationName { get; } +} diff --git a/NEW/src/JdeScoping.DataSync/Etl/Contracts/IImportSource.cs b/NEW/src/JdeScoping.DataSync/Etl/Contracts/IImportSource.cs new file mode 100644 index 0000000..81ff7f7 --- /dev/null +++ b/NEW/src/JdeScoping.DataSync/Etl/Contracts/IImportSource.cs @@ -0,0 +1,21 @@ +using System.Data; + +namespace JdeScoping.DataSync.Etl.Contracts; + +/// +/// Defines a source from which data can be read for import operations. +/// +public interface IImportSource : IAsyncDisposable +{ + /// + /// Reads data from the source asynchronously. + /// + /// Token to cancel the operation. + /// An IDataReader providing access to the source data. + Task ReadDataAsync(CancellationToken cancellationToken = default); + + /// + /// Gets the name of this data source for logging and identification. + /// + string SourceName { get; } +} diff --git a/NEW/src/JdeScoping.DataSync/Etl/Contracts/IScriptRunner.cs b/NEW/src/JdeScoping.DataSync/Etl/Contracts/IScriptRunner.cs new file mode 100644 index 0000000..0f4d73d --- /dev/null +++ b/NEW/src/JdeScoping.DataSync/Etl/Contracts/IScriptRunner.cs @@ -0,0 +1,18 @@ +namespace JdeScoping.DataSync.Etl.Contracts; + +/// +/// Defines a runner that can execute scripts as part of the ETL process. +/// +public interface IScriptRunner +{ + /// + /// Executes the script asynchronously. + /// + /// Token to cancel the operation. + Task ExecuteAsync(CancellationToken cancellationToken = default); + + /// + /// Gets the name of this script for logging and identification. + /// + string ScriptName { get; } +}