namespace TCMSDAL.DTO; // ── Defect pattern library ──────────────────────────────────────────────────── public class TCMSDefectPatternDTO { public int PatternId { get; set; } public string PatternCode { get; set; } = string.Empty; // e.g. MISSING-NEG-VALIDATION public string Description { get; set; } = string.Empty; public bool IsActive { get; set; } = true; } // ── Defect ──────────────────────────────────────────────────────────────────── public class TCMSDefectDTO { public int DefectId { get; set; } public string Title { get; set; } = string.Empty; public int ModuleId { get; set; } public string Entity { get; set; } = string.Empty; // e.g. "Branch", "Voucher" public string Operation { get; set; } = string.Empty; // Save / Update / Delete / Calculate public string StepsToReproduce { get; set; } = string.Empty; public string ExpectedResult { get; set; } = string.Empty; public string ActualResult { get; set; } = string.Empty; public string Priority { get; set; } = "P2"; // P1 / P2 / P3 public int? RootCausePatternId { get; set; } public bool RequiresRca { get; set; } public string Status { get; set; } = "Open"; // Open / InProgress / Fixed / Verified / Closed public int? LinkedTestCaseId { get; set; } // auto-created @skip stub public int TenantId { get; set; } public int CreatedById { get; set; } public DateTime CreatedOn { get; set; } public int ModifiedById { get; set; } public DateTime ModifiedOn { get; set; } // Joined display fields (read-only) public string? ModuleName { get; set; } public string? LinkedTestCaseCode { get; set; } public string? PatternCode { get; set; } } public class TCMSDefectListDTO { public int DefectId { get; set; } public string Title { get; set; } = string.Empty; public string ModuleName { get; set; } = string.Empty; public string Entity { get; set; } = string.Empty; public string Priority { get; set; } = string.Empty; public string Status { get; set; } = string.Empty; public string? PatternCode { get; set; } public string? LinkedTestCaseCode{ get; set; } public bool RequiresRca { get; set; } public DateTime CreatedOn { get; set; } } // ── CAPA gap report ─────────────────────────────────────────────────────────── public class TCMSCapaGapDTO { public string PatternCode { get; set; } = string.Empty; public string PatternDesc { get; set; } = string.Empty; public int DefectCount { get; set; } // how many defects have this pattern public string ModuleName { get; set; } = string.Empty; public int ModuleId { get; set; } public bool HasCoverage { get; set; } // true = this module has ≥1 test tagged with the pattern public int CoveredCount { get; set; } // number of test cases covering this pattern in this module }