using System; using System.Collections.Generic; using System.Linq; namespace WorkerService.Models.Reporting { /// /// Reporting search data model /// public class SearchModel { /// /// PK ID of search /// public int ID { get; set; } /// /// User name of user that created search /// public string UserName { get; set; } /// /// User-friendly name for search /// public string Name { get; set; } /// /// Timestamp search was submitted /// public DateTime? SubmitDT { get; set; } /// /// Timestamp search was started /// public DateTime? StartDT { get; set; } /// /// Timestamp search was completed /// public DateTime? EndDT { get; set; } /// /// Minimum timestamp to include /// public DateTime? MinimumDT { get; set; } /// /// Maxmimum timestamp to include /// public DateTime? MaximumDT { get; set; } /// /// Whether or not timespan filter is enabled /// public bool TimespanFilterEnabled => (MinimumDT.HasValue || MaximumDT.HasValue); /// /// Collection of workorder numbers to include /// public List WorkOrderFilter { get; set; } = new List(); /// /// Whether or not work order filter is enabled /// public bool WorkOrderFilterEnabled => WorkOrderFilter != null && WorkOrderFilter.Any(); /// /// Collection of item numbers to include /// public List ItemNumberFilter { get; set; } = new List(); /// /// Whether or not item number filter is enabled /// public bool ItemNumberFilterEnabled => ItemNumberFilter != null && ItemNumberFilter.Any(); /// /// Collection of included profit centers /// public List ProfitCenterFilter { get; set; } = new List(); /// /// Whether or not profit center filter is enabled /// public bool ProfitCenterFilterEnabled => ProfitCenterFilter != null && ProfitCenterFilter.Any(); /// /// Collection of included work centers /// public List WorkCenterFilter { get; set; } = new List(); /// /// Whether or not work center filter is enabled /// public bool WorkCenterFilterEnabled => WorkCenterFilter != null && WorkCenterFilter.Any(); /// /// Collection of included operator IDs /// public List OperatorFilter { get; set; } = new List(); /// /// Whether or not operator filter is enabled /// public bool OperatorFilterEnabled => OperatorFilter != null && OperatorFilter.Any(); /// /// Collection of included upper level lot numbers /// public List ComponentLotFilter { get; set; } = new List(); /// /// Whether or not component lot filter is enabled /// public bool ComponentLotFilterEnabled => ComponentLotFilter != null && ComponentLotFilter.Any(); /// /// List of part/operation combinations for MIS filtering /// public List ItemOperationMisFilter { get; set; } = new List(); /// /// Whether or not item/operation/mis filter is enabled /// public bool ItemOperationMisFilterEnabled => ItemOperationMisFilter != null && ItemOperationMisFilter.Any(); /// /// Whether or not to extract MIS data /// public bool ExtractMisData { get; set; } /// /// Work order search results /// public List Results { get; set; } = new List(); /// /// MIS results /// public List MisResults { get; set; } = new List(); /// /// MIS no match found results /// public List MisNonMatchResults { get; set; } = new List(); } }