using System.ComponentModel.DataAnnotations;
using static Managing.Common.Enums;

namespace Managing.Api.Models.Requests;

/// <summary>
/// Request model for GMX token swap operations
/// </summary>
public class SwapTokensRequest
{
    /// <summary>
    /// The ticker symbol of the token to swap from
    /// </summary>
    [Required]
    public Ticker FromTicker { get; set; }

    /// <summary>
    /// The ticker symbol of the token to swap to
    /// </summary>
    [Required]
    public Ticker ToTicker { get; set; }

    /// <summary>
    /// The amount to swap
    /// </summary>
    [Required]
    [Range(0.0000000000001, double.MaxValue, ErrorMessage = "Amount must be greater than 0")]
    public double Amount { get; set; }

    /// <summary>
    /// The order type (market or limit)
    /// </summary>
    public string OrderType { get; set; } = "market";

    /// <summary>
    /// The trigger ratio for limit orders (optional)
    /// </summary>
    public double? TriggerRatio { get; set; }

    /// <summary>
    /// The allowed slippage percentage (default 0.5%)
    /// </summary>
    [Range(0, 100, ErrorMessage = "Allowed slippage must be between 0 and 100")]
    public double AllowedSlippage { get; set; } = 0.5;
}