#nullable enable
using System;

namespace IGP.UnitySDK.GameKit
{
    // Request DTOs mirror the curio Runtime Leaderboard API service
    // (apps/api/src/runtime/dto/leaderboard-request.dto.ts).
    // Optional fields are nullable and omitted from the wire payload when null
    // (the SDK serializes request bodies with NullValueHandling.Ignore).

    // Statistics period. Currently only PERMANENT is supported.
    public static class IGPLeaderboardPeriod
    {
        public const string Permanent = "PERMANENT";
    }

    [Serializable]
    public class IGPLeaderboardPeriodOptions
    {
        public string? period; // PERMANENT
    }

    [Serializable]
    public sealed class IGPListLeaderboardsByGameOptions : IGPLeaderboardPeriodOptions
    {
        public string? leaderboardId; // optional metadata filter
    }

    [Serializable]
    public sealed class IGPGetLeaderboardQuery : IGPLeaderboardPeriodOptions
    {
        public int? start;     // 0-based start rank offset
        public int? count;     // 1..100, default 20
        public bool? includeSelf; // true to request current user's own rank
    }

    [Serializable]
    public sealed class IGPSubmitLeaderboardScoreRequest
    {
        public int gameId;       // API business field; mirrors attached appId
        public long value;       // integer; higher ranks first
        public string? eventId;  // optional idempotency key for retries
        public string? sessionId; // optional game session id (pass-through)
    }

    [Serializable]
    public sealed class IGPQueryLeaderboardScoresRequest
    {
        public int gameId;                               // API business field; mirrors attached appId
        public string[] userIds = Array.Empty<string>(); // 1..50 non-empty ids
        public string? period;                            // PERMANENT
    }
}
