48 lines
2.0 KiB
C#
48 lines
2.0 KiB
C#
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"
|
|
};
|
|
}
|