feat(Core): add SearchResults models as pure POCOs

This commit is contained in:
Joseph Doherty
2026-01-06 23:27:47 -05:00
parent 671f8ce357
commit 14fdba2784
4 changed files with 113 additions and 0 deletions
@@ -0,0 +1,20 @@
namespace JdeScoping.Core.Models.SearchResults;
/// <summary>
/// MIS non-match investigation result.
/// </summary>
public sealed class MisNonMatchSearchResult
{
public string WorkCenterCode { get; init; } = string.Empty;
public long WorkOrderNumber { get; init; }
public DateTime WorkOrderStartDate { get; init; }
public decimal JobStepNumber { get; init; }
public string JobStepDescription { get; init; } = string.Empty;
public DateTime? JobStepEndDate { get; init; }
public string FunctionCode { get; init; } = string.Empty;
public bool WasJobStepAdded { get; init; }
public decimal? MatchedJobStepNumber { get; init; }
public string ItemNumber { get; init; } = string.Empty;
public string ItemDescription { get; init; } = string.Empty;
public string RoutingType { get; init; } = string.Empty;
}
@@ -0,0 +1,27 @@
namespace JdeScoping.Core.Models.SearchResults;
/// <summary>
/// MIS (Manufacturing Instruction Sheet) data result.
/// </summary>
public sealed class MisSearchResult
{
public string ItemNumber { get; init; } = string.Empty;
public string ItemDescription { get; init; } = string.Empty;
public string SequenceNumber { get; init; } = string.Empty;
public string MisNumber { get; init; } = string.Empty;
public string RevId { get; init; } = string.Empty;
public string Status { get; init; } = string.Empty;
public DateTime? ReleaseDate { get; init; }
public string BranchCode { get; init; } = string.Empty;
public decimal JobStepSequenceNumber { get; init; }
public decimal? MatchedSequenceNumber { get; init; }
public bool RoutingMatch { get; init; }
public bool MasterMatch { get; init; }
public string FunctionOperationDescription { get; init; } = string.Empty;
public string CharNumber { get; init; } = string.Empty;
public string TestDescription { get; init; } = string.Empty;
public string SamplingType { get; init; } = string.Empty;
public string SamplingValue { get; init; } = string.Empty;
public string ToolsGauges { get; init; } = string.Empty;
public string WorkInstructions { get; init; } = string.Empty;
}
@@ -0,0 +1,19 @@
namespace JdeScoping.Core.Models.SearchResults;
/// <summary>
/// Aggregates search metadata and results for export.
/// </summary>
public class SearchModel
{
public int Id { get; set; }
public string UserName { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public DateTime? SubmitDt { get; set; }
public DateTime? StartDt { get; set; }
public DateTime? EndDt { get; set; }
public bool ExtractMisData { get; set; }
public List<SearchResult> Results { get; set; } = [];
public List<MisSearchResult> MisResults { get; set; } = [];
public List<MisNonMatchSearchResult> MisNonMatchResults { get; set; } = [];
}
@@ -0,0 +1,47 @@
namespace JdeScoping.Core.Models.SearchResults;
/// <summary>
/// JDE search result - work order with current status.
/// </summary>
public sealed class SearchResult
{
public long WorkOrderNumber { get; init; }
public string WorkOrderBranchCode { get; init; } = string.Empty;
public string LotNumber { get; init; } = string.Empty;
public string ItemNumber { get; init; } = string.Empty;
public string PlanningFamily { get; init; } = string.Empty;
public string StockingType { get; init; } = string.Empty;
public decimal OrderQuantity { get; init; }
public decimal HeldQuantity { get; init; }
public decimal ScrappedQuantity { get; init; }
public decimal ShippedQuantity { get; init; }
public string StepBranchCode { get; init; } = string.Empty;
public decimal StepNumber { get; init; }
public string StepDescription { get; init; } = string.Empty;
public string FunctionOperationDescription { get; init; } = string.Empty;
public DateTime StepUpdateDt { get; init; }
public string StatusCode { get; init; } = string.Empty;
public string StatusDescription { get; init; } = string.Empty;
public DateTime? StatusUpdateDt { get; init; }
// Inclusion flags
public bool ManuallySpecified { get; init; }
public bool SplitOrder { get; init; }
public bool Cardex { get; init; }
public bool PartsList { get; init; }
public bool Flagged { get; init; }
/// <summary>
/// Computed reason why this work order was included in results.
/// </summary>
public string InclusionReason => (ManuallySpecified, Flagged, Cardex, PartsList, SplitOrder) switch
{
(true, _, _, _, _) => "ManuallySpecified",
(_, true, _, _, _) => "Flagged",
(_, _, true, true, _) => "ComponentUsage (CARDEX + Parts List)",
(_, _, true, false, _) => "ComponentUsage (CARDEX)",
(_, _, false, true, _) => "ComponentUsage (Parts List)",
(_, _, _, _, true) => "Split order",
_ => "UNKNOWN"
};
}