namespace MMDAL.DTO.Scheduling { public record EUDecisionLogDTO { public int SchedulingRunId { get; set; } public int TenantId { get; set; } public int SeqNo { get; set; } // Demand identity public byte DemandType { get; set; } public int SourceDocumentId { get; set; } public int SourceDetailId { get; set; } public int WorkCenterId { get; set; } public int ProcessId { get; set; } public int ItemId { get; set; } public int SkuId { get; set; } // Duration origin — 0=RoutingLeadTime 1=ManualOverride 2=SubcontractLeadTime public int DurationMinutes { get; set; } public byte DurationSource { get; set; } public decimal OriginalQuantity { get; set; } public byte ExecutionMode { get; set; } // 0=Yes (interruptible) 1=No — IS* TINYINT convention public byte IsInterruptible { get; set; } public int MinimumRunMinutes { get; set; } public int MaxWaitMinutes { get; set; } public DateTime EarlyStart { get; set; } public DateTime ComputedEarlyStart { get; set; } public DateTime Deadline { get; set; } public int Priority { get; set; } // Batch grouping public string RootBatchNumber { get; set; } = string.Empty; public short BatchItemCount { get; set; } public string? BatchedDetailIds { get; set; } // JSON int array e.g. [1201,1205,1209] public decimal TotalBatchQty { get; set; } // Decision — 0=Scheduled 1=Subcontract 2=MonitorOnly 3=FailedNoCandidates 4=FailedNoSlot public byte Decision { get; set; } public int? MachineId { get; set; } public int? PatternId { get; set; } public bool? PatternNewMount { get; set; } public DateTime? ScheduledStart { get; set; } public DateTime? ScheduledEnd { get; set; } public int? SlotWaitMins { get; set; } public int? DeadlineSlackMins { get; set; } public bool ShelfLifeViolation { get; set; } // Scoring public double? WinningScore { get; set; } public short CandidatesConsidered { get; set; } public string? CandidatesJson { get; set; } // [{MachineId,Score,SlotFound,RejectReason,PatternId,PatternMounted}] public string? FailureReason { get; set; } // human-readable explanation for Decision 3 & 4 // Joined from MITEM public string? ItemName { get; set; } public string? ItemCode { get; set; } } }