namespace TCMSDAL.DTO;
///
/// Coverage report — per-module breakdown of test coverage by category.
/// Source: MTCMSTESTCASE × TTCMSRUNRESULT × MTCMSMODULE.
///
public sealed class TCMSCoverageReportDTO
{
public int ModuleId { get; set; }
public string ModuleCode { get; set; } = string.Empty;
public string ModuleName { get; set; } = string.Empty;
public string Priority { get; set; } = string.Empty;
public int TotalTestCases { get; set; }
public int P1Count { get; set; }
public int P2Count { get; set; }
public int P3Count { get; set; }
// By test type
public int CrudCount { get; set; }
public int ValidationCount { get; set; }
public int FunctionalCount { get; set; }
public int NegativeCount { get; set; }
public int BoundaryCount { get; set; }
public int ApiCount { get; set; }
// Coverage %
public decimal OverallCoveragePct { get; set; }
public decimal P1CoveragePct { get; set; }
public decimal P2CoveragePct { get; set; }
// Latest run stats
public int LastRunPass { get; set; }
public int LastRunFail { get; set; }
public int LastRunSkip { get; set; }
public DateTime? LastRunDate { get; set; }
}
///
/// Heatmap cell — all modules × priority tier (P1/P2/P3).
/// Used by the Angular coverage heatmap component.
///
public sealed class TCMSCoverageHeatmapDTO
{
public string ModuleCode { get; set; } = string.Empty;
public string ModuleName { get; set; } = string.Empty;
// Columns: P1 / P2 / P3 coverage % (0–100)
public decimal P1Pct { get; set; }
public decimal P2Pct { get; set; }
public decimal P3Pct { get; set; }
// Gap: 100 - coverage%
public decimal P1GapPct { get; set; }
public decimal P2GapPct { get; set; }
public decimal P3GapPct { get; set; }
/// Traffic-light: Green ≥80 | Yellow 50–79 | Red <50
public string P1Status { get; set; } = string.Empty;
public string P2Status { get; set; } = string.Empty;
public string P3Status { get; set; } = string.Empty;
}
///
/// LTCMSCOVERAGESNAPSHOT — immutable log row; written after every CI run.
/// Used for trend analysis.
///
public sealed class TCMSCoverageSnapshotDTO
{
public int SnapshotId { get; set; }
public int ModuleId { get; set; }
public int TestRunId { get; set; }
public decimal CoveragePct { get; set; }
public int TotalCases { get; set; }
public int PassedCases { get; set; }
public DateTime SnapshotDate { get; set; }
public int TenantId { get; set; }
}