refactor(core): reorganize DTOs into Models and ViewModels folders
Move DTOs from ApiContracts to appropriate locations: - SignalR DTOs → ViewModels (renamed Dto→ViewModel suffix) - Pipeline DTOs → Models/Pipelines - UserInfoDto → Models/Auth - DataUpdateDto → Models/Infrastructure
This commit is contained in:
@@ -122,6 +122,19 @@ public static class ApiRoutes
|
||||
public const string UploadPartOperations = "api/fileio/partoperations/upload";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Routes for data refresh status API endpoints.
|
||||
/// </summary>
|
||||
public static class RefreshStatus
|
||||
{
|
||||
/// <summary>Base route for refresh status endpoints.</summary>
|
||||
public const string Base = "api/refresh-status";
|
||||
|
||||
/// <summary>Builds the route to get refresh status with date range.</summary>
|
||||
public static string Get(DateTime minDt, DateTime maxDt) =>
|
||||
$"api/refresh-status?minDT={minDt:yyyy-MM-dd}&maxDT={maxDt:yyyy-MM-dd}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Routes for pipeline configuration API endpoints.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using JdeScoping.Core.ApiContracts.Auth;
|
||||
using JdeScoping.Core.ApiContracts.Results;
|
||||
using JdeScoping.Core.Models.Auth;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using JdeScoping.Core.ApiContracts.Pipelines;
|
||||
using JdeScoping.Core.Models.Pipelines;
|
||||
using JdeScoping.Core.ApiContracts.Results;
|
||||
|
||||
namespace JdeScoping.Core.ApiContracts;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using JdeScoping.Core.ApiContracts.Auth;
|
||||
|
||||
namespace JdeScoping.Core.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
|
||||
+1
-3
@@ -1,6 +1,4 @@
|
||||
using JdeScoping.Core.Models;
|
||||
|
||||
namespace JdeScoping.Core.ApiContracts.Auth;
|
||||
namespace JdeScoping.Core.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// API response DTO for authenticated user information.
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace JdeScoping.Core.Models.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// DTO for data refresh/sync status display.
|
||||
/// Aggregates record counts from multiple table updates into a single row.
|
||||
/// </summary>
|
||||
public class DataUpdateDto
|
||||
{
|
||||
public DateTime StartDt { get; set; }
|
||||
public DateTime? EndDt { get; set; }
|
||||
|
||||
public int BranchRecords { get; set; }
|
||||
public int ProfitCenterRecords { get; set; }
|
||||
public int WorkCenterRecords { get; set; }
|
||||
public int OrgHierarchyRecords { get; set; }
|
||||
public int StatusCodeRecords { get; set; }
|
||||
public int UserRecords { get; set; }
|
||||
public int ItemRecords { get; set; }
|
||||
public int LotRecords { get; set; }
|
||||
public int WorkOrderRecords { get; set; }
|
||||
public int WorkOrderStepRecords { get; set; }
|
||||
public int WorkOrderComponentRecords { get; set; }
|
||||
|
||||
public bool WasSuccessful { get; set; }
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace JdeScoping.Core.ApiContracts.Pipelines;
|
||||
namespace JdeScoping.Core.Models.Pipelines;
|
||||
|
||||
/// <summary>
|
||||
/// Pipeline configuration DTO for display.
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
namespace JdeScoping.Core.ApiContracts.Pipelines;
|
||||
namespace JdeScoping.Core.Models.Pipelines;
|
||||
|
||||
using Models.Enums;
|
||||
using JdeScoping.Core.Models.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Pipeline execution history.
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace JdeScoping.Core.ApiContracts.Pipelines;
|
||||
namespace JdeScoping.Core.Models.Pipelines;
|
||||
|
||||
/// <summary>
|
||||
/// Response containing list of available pipeline names.
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
namespace JdeScoping.Core.ApiContracts.Pipelines;
|
||||
namespace JdeScoping.Core.Models.Pipelines;
|
||||
|
||||
using Models.Enums;
|
||||
using JdeScoping.Core.Models.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Pipeline schedule status for each update type.
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
using JdeScoping.Core.Models.Search;
|
||||
|
||||
namespace JdeScoping.Core.ApiContracts.SignalR;
|
||||
namespace JdeScoping.Core.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// SignalR message DTO for search status updates.
|
||||
/// SignalR message view model for search status updates.
|
||||
/// </summary>
|
||||
public record SearchUpdateDto
|
||||
public record SearchUpdateViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Search PK ID.
|
||||
@@ -43,11 +43,11 @@ public record SearchUpdateDto
|
||||
public DateTime? EndDt { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a SearchUpdateDto from a Search entity.
|
||||
/// Creates a SearchUpdateViewModel from a Search entity.
|
||||
/// </summary>
|
||||
/// <param name="search">The Search entity to convert.</param>
|
||||
/// <returns>A new SearchUpdateDto instance.</returns>
|
||||
public static SearchUpdateDto FromSearch(Search search) => new()
|
||||
/// <returns>A new SearchUpdateViewModel instance.</returns>
|
||||
public static SearchUpdateViewModel FromSearch(Search search) => new()
|
||||
{
|
||||
Id = search.Id,
|
||||
Name = search.Name,
|
||||
+6
-6
@@ -1,9 +1,9 @@
|
||||
namespace JdeScoping.Core.ApiContracts.SignalR;
|
||||
namespace JdeScoping.Core.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// SignalR message DTO for processor status updates.
|
||||
/// SignalR message view model for processor status updates.
|
||||
/// </summary>
|
||||
public record StatusUpdateDto
|
||||
public record StatusUpdateViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Status message to display.
|
||||
@@ -16,11 +16,11 @@ public record StatusUpdateDto
|
||||
public DateTime? Timestamp { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a StatusUpdateDto with the current timestamp.
|
||||
/// Creates a StatusUpdateViewModel with the current timestamp.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A new StatusUpdateDto instance.</returns>
|
||||
public static StatusUpdateDto Create(string message) => new()
|
||||
/// <returns>A new StatusUpdateViewModel instance.</returns>
|
||||
public static StatusUpdateViewModel Create(string message) => new()
|
||||
{
|
||||
Message = message,
|
||||
Timestamp = DateTime.UtcNow
|
||||
Reference in New Issue
Block a user