From 14fdba2784cdf841d498b0e6d3a7f6917ea211f4 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 6 Jan 2026 23:27:47 -0500 Subject: [PATCH] feat(Core): add SearchResults models as pure POCOs --- .../SearchResults/MisNonMatchSearchResult.cs | 20 ++++++++ .../Models/SearchResults/MisSearchResult.cs | 27 +++++++++++ .../Models/SearchResults/SearchModel.cs | 19 ++++++++ .../Models/SearchResults/SearchResult.cs | 47 +++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 NEW/src/JdeScoping.Core/Models/SearchResults/MisNonMatchSearchResult.cs create mode 100644 NEW/src/JdeScoping.Core/Models/SearchResults/MisSearchResult.cs create mode 100644 NEW/src/JdeScoping.Core/Models/SearchResults/SearchModel.cs create mode 100644 NEW/src/JdeScoping.Core/Models/SearchResults/SearchResult.cs diff --git a/NEW/src/JdeScoping.Core/Models/SearchResults/MisNonMatchSearchResult.cs b/NEW/src/JdeScoping.Core/Models/SearchResults/MisNonMatchSearchResult.cs new file mode 100644 index 0000000..4c98756 --- /dev/null +++ b/NEW/src/JdeScoping.Core/Models/SearchResults/MisNonMatchSearchResult.cs @@ -0,0 +1,20 @@ +namespace JdeScoping.Core.Models.SearchResults; + +/// +/// MIS non-match investigation result. +/// +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; +} diff --git a/NEW/src/JdeScoping.Core/Models/SearchResults/MisSearchResult.cs b/NEW/src/JdeScoping.Core/Models/SearchResults/MisSearchResult.cs new file mode 100644 index 0000000..37f1194 --- /dev/null +++ b/NEW/src/JdeScoping.Core/Models/SearchResults/MisSearchResult.cs @@ -0,0 +1,27 @@ +namespace JdeScoping.Core.Models.SearchResults; + +/// +/// MIS (Manufacturing Instruction Sheet) data result. +/// +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; +} diff --git a/NEW/src/JdeScoping.Core/Models/SearchResults/SearchModel.cs b/NEW/src/JdeScoping.Core/Models/SearchResults/SearchModel.cs new file mode 100644 index 0000000..35e5897 --- /dev/null +++ b/NEW/src/JdeScoping.Core/Models/SearchResults/SearchModel.cs @@ -0,0 +1,19 @@ +namespace JdeScoping.Core.Models.SearchResults; + +/// +/// Aggregates search metadata and results for export. +/// +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 Results { get; set; } = []; + public List MisResults { get; set; } = []; + public List MisNonMatchResults { get; set; } = []; +} diff --git a/NEW/src/JdeScoping.Core/Models/SearchResults/SearchResult.cs b/NEW/src/JdeScoping.Core/Models/SearchResults/SearchResult.cs new file mode 100644 index 0000000..49754aa --- /dev/null +++ b/NEW/src/JdeScoping.Core/Models/SearchResults/SearchResult.cs @@ -0,0 +1,47 @@ +namespace JdeScoping.Core.Models.SearchResults; + +/// +/// JDE search result - work order with current status. +/// +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; } + + /// + /// Computed reason why this work order was included in results. + /// + 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" + }; +}