namespace DorkNet.Server.Data.Entities;
///
/// An admin-issued, single-use signup code (Discord-invite style). While
/// the server has signups disabled, the only way to mint a new account is
/// to redeem one of these on the public site's /join page. Each
/// code carries a free-text so admins can track
/// who they handed it to, an optional , and the
/// redemption result ( /
/// ). Codes can be revoked before use.
///
public class SignupCodeEntity
{
public long Id { get; set; }
/// The opaque code string the player types on /join.
/// Uppercase, hyphenated, unambiguous alphabet (no 0/O/1/I).
public string Code { get; set; } = string.Empty;
/// Free-text note for the admin — "who is this for". Shown
/// only in the admin panel, never to the redeemer.
public string Descriptor { get; set; } = string.Empty;
/// Player id of the admin who generated the code (0 if
/// generated by a system/CLI path).
public long CreatedByPlayerId { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
/// Optional hard expiry. Null = never expires.
public DateTime? ExpiresAt { get; set; }
/// Set once the code is redeemed; null while unused.
public long? RedeemedByPlayerId { get; set; }
public DateTime? RedeemedAt { get; set; }
/// Admin kill switch — a revoked code can never be redeemed,
/// even if otherwise valid.
public bool Revoked { get; set; }
}