namespace QMSDAL.DTO
{
// ── Checklist engine resolution context ──────────────────────────────────
// Describes the operational context that triggered the checklist engine.
// The engine uses these fields to select applicable MCHECKLISTAPPLICABILITY rules.
public class ChecklistContextDTO
{
public int OuId { get; set; } = -1;
public int PeriodId { get; set; } = -1;
public int BizTransactionTypeId { get; set; } = -1;
public int ObjectBizTransactionTypeId { get; set; } = -1;
public int ObjectHeaderTypeId { get; set; } = -1;
public int ObjectHeaderId { get; set; } = -1;
public int ObjectTypeId { get; set; } = -1;
public int ObjectId { get; set; } = -1;
public int ProcessId { get; set; } = -1;
public int ItemId { get; set; } = -1;
public int SkuId { get; set; } = -1;
public int IndentId { get; set; } = -1;
public int IndentDetailId { get; set; } = -1;
public int WorkcenterId { get; set; } = -1;
/// Phase 9b -- BizProcess module stage this execution is being audited against (ScopeType=6).
public int BizProcessStageId { get; set; } = -1;
/// Used for FrequencyType=3 (EveryNLots) evaluation
public int LotSequenceNumber { get; set; } = 1;
}
// ── Engine resolution candidate (internal — raw DB row) ──────────────────
public class ChecklistResolutionCandidateDTO
{
public int ChecklistApplicabilityId { get; set; }
public int ChecklistId { get; set; }
public string ChecklistName { get; set; } = string.Empty;
public int DisplayMode { get; set; }
public int Timing { get; set; }
public int IsBlocking { get; set; }
public int IsMandatory { get; set; }
public int TeamId { get; set; }
public int ScopeType { get; set; }
public int Priority { get; set; }
public int FrequencyType { get; set; }
public decimal FrequencyValue { get; set; }
public DateTime? EffectiveFrom { get; set; }
public DateTime? EffectiveTo { get; set; }
}
// ── Pending checklist returned to the frontend ────────────────────────────
public class PendingChecklistDTO
{
public int ChecklistId { get; set; }
public string ChecklistCode { get; set; } = string.Empty;
public string ChecklistName { get; set; } = string.Empty;
public int DisplayMode { get; set; }
public int Timing { get; set; }
public int IsBlocking { get; set; }
public int TeamId { get; set; }
public string? TeamName { get; set; }
public int ItemCount { get; set; }
public List Items { get; set; } = new();
}
// ── Engine raw item row (flat JOIN result — grouped in BLL) ──────────────
public class ChecklistItemRawDTO
{
public int ChecklistDetailId { get; set; }
public int ChecklistId { get; set; }
public int SlNo { get; set; }
public string? Section { get; set; }
public string DetailText { get; set; } = string.Empty;
public int ActionType { get; set; }
public int UomId { get; set; }
public string? UomName { get; set; }
public decimal? MinVal { get; set; }
public decimal? MaxVal { get; set; }
public int LovTypeId { get; set; }
public int IsMandatory { get; set; }
public string? HelpText { get; set; }
public int FailAction { get; set; }
public int TenantId { get; set; }
// LOV option columns — present when ActionType=4 (LEFT JOIN MLOV)
public int? LovId { get; set; }
public string? LovName { get; set; }
}
}