namespace TCMSDAL.DTO;
// ── Screen link admin ─────────────────────────────────────────────────────────
public class TCMSScreenLinkDTO
{
public int ScreenLinkId { get; set; }
public int TestCaseId { get; set; }
public string ScreenRoute { get; set; } = string.Empty;
public string ScreenTitle { get; set; } = string.Empty;
public string ModuleName { get; set; } = string.Empty;
public int CreatedById { get; set; }
}
public class TCMSSaveLinkDTO
{
public int TestCaseId { get; set; }
public string ScreenRoute { get; set; } = string.Empty;
public string ScreenTitle { get; set; } = string.Empty;
public string ModuleName { get; set; } = string.Empty;
}
// ── API link admin ────────────────────────────────────────────────────────────
public class TCMSApiLinkDTO
{
public int ApiLinkId { get; set; }
public int TestCaseId { get; set; }
public long? ApiOperationId { get; set; }
public string ApiPath { get; set; } = string.Empty;
public string HttpMethod { get; set; } = string.Empty;
public int CreatedById { get; set; }
}
public class TCMSSaveApiLinkDTO
{
public int TestCaseId { get; set; }
public long? ApiOperationId { get; set; }
public string ApiPath { get; set; } = string.Empty;
public string HttpMethod { get; set; } = string.Empty;
}
// ── Read models (returned to FE widget + traceability view) ──────────────────
/// Full coverage view for a single FE screen — includes Gherkin steps.
public class TCMSScreenCoverageDTO
{
public string ScreenRoute { get; set; } = string.Empty;
public string ScreenTitle { get; set; } = string.Empty;
public string ModuleName { get; set; } = string.Empty;
public int TotalCases { get; set; }
public int P1Count { get; set; }
public int P2Count { get; set; }
public int P3Count { get; set; }
public int PassCount { get; set; }
public int FailCount { get; set; }
public string? LastRunDate { get; set; }
public IEnumerable TestCases { get; set; }
= Enumerable.Empty();
}
/// Slim test case view for traceability — includes Gherkin steps.
public class TCMSTracedTestCaseDTO
{
public int TestCaseId { get; set; }
public int? ScreenLinkId { get; set; } // null for tag-sourced rows; set when from MTCMSSCREENLINK
public int? ApiLinkId { get; set; } // null for tag-sourced rows; set when from MTCMSAPILINK
public string TcId { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string Priority { get; set; } = string.Empty;
public string TestType { get; set; } = string.Empty;
public string ExecutionType { get; set; } = string.Empty;
public string? LastRunStatus { get; set; }
public string? LastRunDate { get; set; }
public IEnumerable Steps { get; set; }
= Enumerable.Empty();
}
/// Single Gherkin step for business-readable rendering.
public class TCMSTracedStepDTO
{
public int TestCaseId { get; set; } // populated by bulk-load query for grouping; not sent to FE
public string StepType { get; set; } = string.Empty; // Given/When/Then/And/But
public string StepText { get; set; } = string.Empty;
}
// ── Screen tree (left-panel of traceability view) ────────────────────────────
/// One node in the screen tree — grouped by ModuleName, sorted by ScreenTitle.
public class TCMSScreenTreeNodeDTO
{
public string ScreenRoute { get; set; } = string.Empty;
public string ScreenTitle { get; set; } = string.Empty;
public string ModuleName { get; set; } = string.Empty;
public int TotalCases { get; set; }
public bool HasCoverage => TotalCases > 0;
}
// ── Coverage gaps ─────────────────────────────────────────────────────────────
/// Screens or API operations with zero linked test cases.
public class TCMSCoverageGapDTO
{
public string Route { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string ModuleName { get; set; } = string.Empty;
public int LinkedCases { get; set; } // 0 = uncovered
public string GapType { get; set; } = string.Empty; // "Screen" | "ApiOperation"
}
// ── API coverage (for AMP operation detail) ───────────────────────────────────
public class TCMSApiCoverageDTO
{
public string ApiPath { get; set; } = string.Empty;
public string HttpMethod { get; set; } = string.Empty;
public int TotalCases { get; set; }
public int PassCount { get; set; }
public int FailCount { get; set; }
public string? LastRunDate { get; set; }
public IEnumerable TestCases { get; set; }
= Enumerable.Empty();
}