using System.Text.Json.Serialization;

namespace NeonSprawl.Server.Game.Skills;

/// <summary>JSON body for <c>GET /game/world/skill-definitions</c> (NEO-36).</summary>
public sealed class SkillDefinitionsListResponse
{
    public const int CurrentSchemaVersion = 1;

    [JsonPropertyName("schemaVersion")]
    public int SchemaVersion { get; init; } = CurrentSchemaVersion;

    /// <summary>Loaded skills ordered by stable <c>id</c> (ordinal), matching <see cref="ISkillDefinitionRegistry.GetDefinitionsInIdOrder"/>.</summary>
    [JsonPropertyName("skills")]
    public required IReadOnlyList<SkillDefinitionJson> Skills { get; init; }
}

/// <summary>One row in the read-only skill definition projection.</summary>
public sealed class SkillDefinitionJson
{
    [JsonPropertyName("id")]
    public required string Id { get; init; }

    [JsonPropertyName("displayName")]
    public required string DisplayName { get; init; }

    [JsonPropertyName("category")]
    public required string Category { get; init; }

    [JsonPropertyName("allowedXpSourceKinds")]
    public required IReadOnlyList<string> AllowedXpSourceKinds { get; init; }
}
