namespace DorkNet.Server.Data.Entities;
///
/// Single-row table holding server-wide runtime toggles that admins can
/// flip from the SPA without a redeploy. Modelled after
/// : is pinned to 1
/// so EF Core has a key to track changes against, and reads/writes
/// touch one row.
///
/// Add new boolean (or scalar) columns directly to this entity as more
/// toggles appear — keeping them strongly typed beats a generic
/// key/value table for the dozen-or-so global switches we'll ever have.
///
public class ServerSettingsEntity
{
public int Id { get; set; } = 1;
/// When true, the watch's account-creation endpoints
/// (POST /account/create and POST /api/account/v1/create)
/// short-circuit with Success=false and the watch surfaces
/// the error to the player. Existing logins are unaffected; only
/// brand-new account requests are blocked.
public bool SignupsDisabled { get; set; }
/// When true, the watch's weekly-challenge map reports
/// CompletedRequired — the player must finish every listed
/// challenge before the gift unlocks. Mirrors
/// ChallengeMap.CompletedRequired on the 2020.03 client.
public bool WeeklyChallengesCompletedRequired { get; set; } = true;
/// JSON-serialised List<WeeklyChallengeTemplate>
/// (see ServerSettingsService). Empty string falls back to
/// ServerSettingsService.DefaultWeeklyChallenges(). Admin-
/// editable from the SPA Settings page so the weekly slate can change
/// without a redeploy.
public string WeeklyChallengesJson { get; set; } = string.Empty;
/// JSON-serialised WeeklyChallengeReward — the gift
/// granted when the week's challenges complete (XP + tokens, plus an
/// optional store skin identified by Slug). Empty string falls
/// back to ServerSettingsService.DefaultWeeklyReward().
public string WeeklyChallengeRewardJson { get; set; } = string.Empty;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}