using System.Text.Json.Serialization;

namespace HoneyBox.Model.Models.Asset;

/// <summary>
/// 资产记录查询请求
/// </summary>
public class AssetRecordRequest
{
    /// <summary>
    /// 类型过滤 (0=全部)
    /// </summary>
    [JsonPropertyName("type")]
    public int Type { get; set; } = 0;

    /// <summary>
    /// 页码
    /// </summary>
    [JsonPropertyName("page")]
    public int Page { get; set; } = 1;

    /// <summary>
    /// 每页数量
    /// </summary>
    [JsonPropertyName("limit")]
    public int Limit { get; set; } = 15;
}

/// <summary>
/// 资产记录DTO
/// </summary>
public class AssetRecordDto
{
    /// <summary>
    /// 变动金额 (带正负号)
    /// </summary>
    [JsonPropertyName("change_money")]
    public string ChangeMoney { get; set; } = string.Empty;

    /// <summary>
    /// 变动说明
    /// </summary>
    [JsonPropertyName("content")]
    public string Content { get; set; } = string.Empty;

    /// <summary>
    /// 添加时间 (格式: Y-m-d H:i:s)
    /// </summary>
    [JsonPropertyName("addtime")]
    public string AddTime { get; set; } = string.Empty;
}

/// <summary>
/// 资产记录分页响应 (兼容PHP API格式)
/// </summary>
public class AssetRecordPageResponse
{
    /// <summary>
    /// 记录列表
    /// </summary>
    [JsonPropertyName("list")]
    public List<AssetRecordDto> List { get; set; } = new();

    /// <summary>
    /// 最后一页页码
    /// </summary>
    [JsonPropertyName("last_page")]
    public int LastPage { get; set; }

    /// <summary>
    /// 当前页码
    /// </summary>
    [JsonPropertyName("current_page")]
    public int CurrentPage { get; set; }

    /// <summary>
    /// 总记录数
    /// </summary>
    [JsonPropertyName("total")]
    public int Total { get; set; }
}
