using QYZH.InteractiveMagazine.Models.Dto;
using QYZH.InteractiveMagazine.Models.Dto.Compensation;
using QYZH.InteractiveMagazine.Models.Entity;

namespace QYZH.InteractiveMagazine.IService;

/// <summary>
/// 补偿任务管理服务接口
/// </summary>
public interface ICompensationManageService : IBaseService<CompensationTask>
{
    /// <summary>
    /// 分页查询补偿任务
    /// </summary>
    /// <param name="input">查询参数</param>
    /// <returns>分页结果</returns>
    Task<PageListModel<CompensationManageOutput>> GetListAsync(CompensationTaskQueryInput input);

    /// <summary>
    /// 手动重试补偿任务（将状态改为 Pending，重置 RetryCount）
    /// </summary>
    /// <param name="taskId">任务Id</param>
    /// <param name="operatorId">操作人Id</param>
    /// <param name="operatorName">操作人用户名</param>
    /// <param name="input">重试参数</param>
    /// <param name="ipAddress">IP地址</param>
    Task RetryAsync(long taskId, long operatorId, string operatorName, CompensationRetryInput input, string? ipAddress = null);

    /// <summary>
    /// 标记补偿任务为已解决
    /// </summary>
    /// <param name="taskId">任务Id</param>
    /// <param name="operatorId">操作人Id</param>
    /// <param name="operatorName">操作人用户名</param>
    /// <param name="input">解决参数</param>
    /// <param name="ipAddress">IP地址</param>
    Task ResolveAsync(long taskId, long operatorId, string operatorName, CompensationResolveInput input, string? ipAddress = null);

    /// <summary>
    /// 获取补偿任务详情
    /// </summary>
    /// <param name="taskId">任务Id</param>
    /// <returns>任务详情</returns>
    Task<CompensationManageDetailOutput> GetDetailAsync(long taskId);
}
