using System.ComponentModel.DataAnnotations;
namespace DorkNet.Server.Data.Entities;
///
/// QA test case — wire type RecNet.TestCase
/// (Cpp2IL_CS/.../RecNet/TestCase.cs). The 2020 Rec Room
/// client uses this to surface JIRA-tracked test cases in an
/// internal QA tab; users with the developer role claim a case,
/// run it in the named room, then submit a Pass/Fail status.
///
/// Field names + types match the client's
/// TestCase.Deserialize exactly. is the
/// TestCaseStatus enum: 0=NotYetTested, 1=Claimed, 2=Failed,
/// 3=Passed.
///
public class TestCaseEntity
{
/// EF primary key (long autoincrement) — kept separate
/// from the wire string so we can index cleanly.
public long Pk { get; set; }
/// Wire field Id (string) — typically the JIRA
/// issue key like RR-1234.
[MaxLength(64)]
public string Id { get; set; } = string.Empty;
[MaxLength(64)]
public string Key { get; set; } = string.Empty;
[MaxLength(256)]
public string Title { get; set; } = string.Empty;
[MaxLength(2000)]
public string Description { get; set; } = string.Empty;
[MaxLength(128)]
public string RoomName { get; set; } = string.Empty;
/// TestCaseStatus enum: 0=NotYetTested, 1=Claimed,
/// 2=Failed, 3=Passed.
public int Status { get; set; } = 0;
public int MinNumAssignedPlayers { get; set; } = 1;
/// JSON list of player ids currently claimed on this
/// test case. Mirrors wire AssignedPlayerIds (List<int>).
public string AssignedPlayerIdsJson { get; set; } = "[]";
/// Sibling JSON list of names for display (kept in sync
/// with ).
public string AssignedPlayerNamesJson { get; set; } = "[]";
/// JSON list of tag strings.
public string TagsJson { get; set; } = "[]";
[MaxLength(512)]
public string JiraUrl { get; set; } = string.Empty;
[MaxLength(512)]
public string JiraBugUrl { get; set; } = string.Empty;
/// Optional FK to the this
/// case belongs to (null = orphan / standalone).
public uint? TestPassId { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
/// Wire type RecNet.TestPass — a versioned bundle of
/// test cases the QA team groups for a release pass. Listed via
/// GET api/testcasemanagement/v1/testpasssummary; one fetched
/// in detail via GET api/testcasemanagement/v1/testpass/{id}.
///
public class TestPassEntity
{
/// Wire Id is uint — store as long PK and cast.
public uint Id { get; set; }
[MaxLength(128)]
public string Name { get; set; } = string.Empty;
[MaxLength(2000)]
public string Description { get; set; } = string.Empty;
public DateTime StartDate { get; set; } = DateTime.UtcNow;
/// Null while the pass is still active.
public DateTime? EndDate { get; set; }
public bool WasManuallyClosed { get; set; } = false;
/// JSON list of tag strings.
public string TagsJson { get; set; } = "[]";
}