using System.ComponentModel.DataAnnotations;
using QYZH.InteractiveMagazine.Models.Enum;
namespace QYZH.InteractiveMagazine.Models.Dto.Compensation;
///
/// 补偿任务分页查询输入
///
public class CompensationTaskQueryInput : PageQueryModel
{
///
/// 按用户Id筛选
///
public long? UserId { get; set; }
///
/// 按任务类型筛选(PetFeeding/UserPoints/UserGrowth/SendNotification)
///
public CompensationTaskTypeEnum? TaskType { get; set; }
///
/// 按状态筛选(Pending/Processing/Success/Failed/Cancelled)
///
public CompensationTaskStatusEnum? Status { get; set; }
///
/// 按业务来源筛选(CheckIn/Purchase/Activity等)
///
public string? BusinessSource { get; set; }
}
///
/// 手动重试补偿任务输入
///
public class CompensationRetryInput
{
///
/// 重试原因
///
[Required(ErrorMessage = "重试原因不能为空")]
public string Reason { get; set; } = string.Empty;
}
///
/// 标记补偿任务已解决输入
///
public class CompensationResolveInput
{
///
/// 处理说明
///
[Required(ErrorMessage = "处理说明不能为空")]
public string ResolveNote { get; set; } = string.Empty;
}
///
/// 补偿任务管理输出(含用户昵称)
///
public class CompensationManageOutput
{
///
/// 任务Id
///
public long Id { get; set; }
///
/// 任务类型
///
public CompensationTaskTypeEnum TaskType { get; set; }
///
/// 业务来源
///
public string BusinessSource { get; set; } = string.Empty;
///
/// 关联业务Id
///
public string? BusinessId { get; set; }
///
/// 用户Id
///
public long UserId { get; set; }
///
/// 用户昵称
///
public string? UserName { get; set; }
///
/// 处理参数(JSON)
///
public string Payload { get; set; } = string.Empty;
///
/// 异常消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 异常来源
///
public string ErrorSource { get; set; } = string.Empty;
///
/// 已重试次数
///
public int RetryCount { get; set; }
///
/// 最大重试次数
///
public int MaxRetries { get; set; }
///
/// 状态
///
public CompensationTaskStatusEnum Status { get; set; }
///
/// 最后处理时间
///
public DateTime? ProcessedAt { get; set; }
///
/// 计划执行时间
///
public DateTime? ScheduledAt { get; set; }
///
/// 处理结果
///
public string? ResultMessage { get; set; }
///
/// 创建时间
///
public DateTime CreatedAt { get; set; }
}
///
/// 补偿任务详情输出(含审计字段)
///
public class CompensationManageDetailOutput
{
///
/// 任务Id
///
public long Id { get; set; }
///
/// 任务类型
///
public CompensationTaskTypeEnum TaskType { get; set; }
///
/// 业务来源
///
public string BusinessSource { get; set; } = string.Empty;
///
/// 关联业务Id
///
public string? BusinessId { get; set; }
///
/// 用户Id
///
public long UserId { get; set; }
///
/// 用户昵称
///
public string? UserName { get; set; }
///
/// 处理参数(JSON)
///
public string Payload { get; set; } = string.Empty;
///
/// 异常消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 异常来源
///
public string ErrorSource { get; set; } = string.Empty;
///
/// 已重试次数
///
public int RetryCount { get; set; }
///
/// 最大重试次数
///
public int MaxRetries { get; set; }
///
/// 状态
///
public CompensationTaskStatusEnum Status { get; set; }
///
/// 最后处理时间
///
public DateTime? ProcessedAt { get; set; }
///
/// 计划执行时间
///
public DateTime? ScheduledAt { get; set; }
///
/// 处理结果
///
public string? ResultMessage { get; set; }
///
/// 创建时间
///
public DateTime CreatedAt { get; set; }
///
/// 创建人
///
public string? CreatedBy { get; set; }
///
/// 修改人
///
public string? UpdatedBy { get; set; }
///
/// 修改时间
///
public DateTime? UpdatedAt { get; set; }
}