using System.ComponentModel.DataAnnotations;

namespace QYZH.InteractiveMagazine.Models.Dto.Points;

/// <summary>
/// 手动增加积分输入
/// </summary>
public class ManualAddPointsInput
{
    /// <summary>
    /// 增加数量（必须大于0）
    /// </summary>
    [Range(1, int.MaxValue, ErrorMessage = "增加积分数量必须大于0")]
    public int Amount { get; set; }

    /// <summary>
    /// 操作原因（必填）
    /// </summary>
    [Required(ErrorMessage = "操作原因不能为空")]
    public string Reason { get; set; } = string.Empty;
}

/// <summary>
/// 手动扣除积分输入
/// </summary>
public class ManualDeductPointsInput
{
    /// <summary>
    /// 扣除数量（必须大于0）
    /// </summary>
    [Range(1, int.MaxValue, ErrorMessage = "扣除积分数量必须大于0")]
    public int Amount { get; set; }

    /// <summary>
    /// 操作原因（必填）
    /// </summary>
    [Required(ErrorMessage = "操作原因不能为空")]
    public string Reason { get; set; } = string.Empty;
}

/// <summary>
/// 手动积分操作输出
/// </summary>
public class ManualPointsOutput
{
    /// <summary>
    /// 积分流水记录Id
    /// </summary>
    public long RecordId { get; set; }

    /// <summary>
    /// 操作前积分余额
    /// </summary>
    public int PreviousBalance { get; set; }

    /// <summary>
    /// 操作后积分余额
    /// </summary>
    public int NewBalance { get; set; }

    /// <summary>
    /// 变动数量（正数为增加，负数为扣除）
    /// </summary>
    public int ChangeAmount { get; set; }

    /// <summary>
    /// 操作人
    /// </summary>
    public string OperatorName { get; set; } = string.Empty;

    /// <summary>
    /// 操作时间
    /// </summary>
    public DateTime OperatedAt { get; set; }
}
