refactor: remove unused CMS/JDE repositories and data sources
Remove legacy JDE and CMS direct-access code that is no longer used: - Delete ICmsDataSource, IJdeDataSource interfaces - Delete ISearchProcessor, IUpdateProcessor interfaces - Delete IJdeRepository and ICmsRepository (all partials) - Delete JdeRepository and CmsRepository implementations - Delete JdeQueries and CmsQueries - Delete JdeFileDataSource, JdeOracleDataSource - Delete CmsFileDataSource, CmsOracleDataSource - Remove unused methods from LotFinderRepository interfaces - Delete associated unit tests (CmsRepositoryTests, JdeRepositoryTests) All data sync now uses ETL pipelines via DataSync project.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
using JdeScoping.Core.Models;
|
||||
using JdeScoping.Core.Models.Quality;
|
||||
|
||||
namespace JdeScoping.Core.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for fetching data from CMS source system.
|
||||
/// </summary>
|
||||
public interface ICmsDataSource
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets MIS data from CMS as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<MisData> GetMisDataAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
using JdeScoping.Core.Models;
|
||||
using JdeScoping.Core.Models.Inventory;
|
||||
using JdeScoping.Core.Models.Organization;
|
||||
using JdeScoping.Core.Models.WorkOrders;
|
||||
|
||||
namespace JdeScoping.Core.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for fetching data from JDE (JD Edwards) source system.
|
||||
/// </summary>
|
||||
public interface IJdeDataSource
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets work orders from JDE as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<WorkOrder> GetWorkOrdersAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets lot usage records from JDE as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<LotUsage> GetLotUsagesAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets lots from JDE as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<Lot> GetLotsAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets items from JDE as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<Item> GetItemsAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets work centers from JDE as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<WorkCenter> GetWorkCentersAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets profit centers from JDE as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<ProfitCenter> GetProfitCentersAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets JDE users as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<JdeUser> GetUsersAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets branches from JDE as an async stream.
|
||||
/// </summary>
|
||||
/// <param name="minimumDt">Minimum update timestamp for incremental fetch. Null for full fetch.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
IAsyncEnumerable<Branch> GetBranchesAsync(DateTime? minimumDt = null, CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -13,44 +13,4 @@ public partial interface ILotFinderRepository
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>Latest data updates.</returns>
|
||||
Task<List<DataUpdate>> GetLastDataUpdatesAsync(CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets table schema specification for dynamic SQL generation.
|
||||
/// </summary>
|
||||
/// <param name="tableName">Table name.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>Table specification with columns and primary key.</returns>
|
||||
Task<TableSpec> GetTableSpecAsync(string tableName, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Rebuilds all indices on a table with fillfactor of 95.
|
||||
/// Table name is validated against whitelist for SQL injection prevention.
|
||||
/// </summary>
|
||||
/// <param name="tableName">Table name (must be in whitelist).</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <exception cref="ArgumentException">Thrown if table name is not in whitelist.</exception>
|
||||
Task RebuildIndicesAsync(string tableName, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Post-processes imported MIS data to set obsolete dates.
|
||||
/// </summary>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
Task PostProcessMisDataAsync(CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Performs bulk insert of records into a table.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Record type.</typeparam>
|
||||
/// <param name="tableName">Target table name.</param>
|
||||
/// <param name="records">Records to insert.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>Number of records inserted.</returns>
|
||||
Task<int> BulkInsertAsync<T>(string tableName, IEnumerable<T> records, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a table, removing all records.
|
||||
/// </summary>
|
||||
/// <param name="tableName">Table name.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
Task TruncateTableAsync(string tableName, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
@@ -43,14 +43,6 @@ public partial interface ILotFinderRepository
|
||||
/// <returns>Top 25 matching work centers.</returns>
|
||||
Task<List<WorkCenter>> SearchWorkCentersAsync(string filter, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Looks up work centers by codes.
|
||||
/// </summary>
|
||||
/// <param name="codes">Work center codes to match.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>Matching work centers.</returns>
|
||||
Task<List<WorkCenter>> LookupWorkCentersAsync(List<string> codes, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Searches profit centers by code or description.
|
||||
/// </summary>
|
||||
@@ -59,14 +51,6 @@ public partial interface ILotFinderRepository
|
||||
/// <returns>Top 25 matching profit centers.</returns>
|
||||
Task<List<ProfitCenter>> SearchProfitCentersAsync(string filter, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Looks up profit centers by codes.
|
||||
/// </summary>
|
||||
/// <param name="codes">Profit center codes to match.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>Matching profit centers.</returns>
|
||||
Task<List<ProfitCenter>> LookupProfitCentersAsync(List<string> codes, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Searches users by user ID, full name, or address number.
|
||||
/// </summary>
|
||||
@@ -75,14 +59,6 @@ public partial interface ILotFinderRepository
|
||||
/// <returns>Top 25 matching users.</returns>
|
||||
Task<List<JdeUser>> SearchUsersAsync(string filter, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Looks up users by user IDs or address numbers.
|
||||
/// </summary>
|
||||
/// <param name="userIds">User IDs or address numbers to match.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>Matching users.</returns>
|
||||
Task<List<JdeUser>> LookupUsersAsync(List<string> userIds, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Looks up lots by lot number and item number.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using JdeScoping.Core.Models.Enums;
|
||||
using JdeScoping.Core.Models.Search;
|
||||
|
||||
namespace JdeScoping.Core.Interfaces;
|
||||
@@ -46,20 +45,4 @@ public partial interface ILotFinderRepository
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
/// <returns>Generated search ID.</returns>
|
||||
Task<int> SubmitSearchAsync(Search search, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the status of a search.
|
||||
/// </summary>
|
||||
/// <param name="id">Search ID.</param>
|
||||
/// <param name="status">New status.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
Task UpdateSearchStatusAsync(int id, SearchStatus status, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Stores the Excel results for a completed search.
|
||||
/// </summary>
|
||||
/// <param name="id">Search ID.</param>
|
||||
/// <param name="results">Excel file bytes.</param>
|
||||
/// <param name="ct">Cancellation token.</param>
|
||||
Task UpdateSearchResultsAsync(int id, byte[] results, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace JdeScoping.Core.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Processor for executing user search requests.
|
||||
/// </summary>
|
||||
public interface ISearchProcessor
|
||||
{
|
||||
/// <summary>
|
||||
/// Processes a queued search request.
|
||||
/// </summary>
|
||||
Task ProcessSearchAsync(int searchId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the next pending search to process.
|
||||
/// </summary>
|
||||
Task<int?> GetNextPendingSearchAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace JdeScoping.Core.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Processor for data synchronization from JDE/CMS to local cache.
|
||||
/// </summary>
|
||||
public interface IUpdateProcessor
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs a mass (full) data refresh.
|
||||
/// </summary>
|
||||
Task RunMassRefreshAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Runs a daily incremental data refresh.
|
||||
/// </summary>
|
||||
Task RunDailyRefreshAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Runs an hourly data refresh.
|
||||
/// </summary>
|
||||
Task RunHourlyRefreshAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user