using System.Collections.Generic;

namespace NPP.SmartSchedue.Api.Contracts.Services.Work.Output;

/// <summary>
/// 批量添加工作任务输出模型
/// </summary>
public class BatchWorkOrderAddOutput
{
    /// <summary>
    /// 成功添加的任务ID列表
    /// </summary>
    public List<long> SuccessIds { get; set; } = new List<long>();

    /// <summary>
    /// 失败的任务信息列表
    /// </summary>
    public List<BatchWorkOrderError> FailedItems { get; set; } = new List<BatchWorkOrderError>();

    /// <summary>
    /// 总任务数
    /// </summary>
    public int TotalCount { get; set; }

    /// <summary>
    /// 成功数量
    /// </summary>
    public int SuccessCount { get; set; }

    /// <summary>
    /// 失败数量
    /// </summary>
    public int FailedCount { get; set; }

    /// <summary>
    /// 是否全部成功
    /// </summary>
    public bool IsAllSuccess => FailedCount == 0;

    /// <summary>
    /// 批量操作是否成功
    /// </summary>
    public bool IsSuccess { get; set; }

    /// <summary>
    /// 操作消息
    /// </summary>
    public string Message { get; set; }
}

/// <summary>
/// 批量操作错误信息
/// </summary>
public class BatchWorkOrderError
{
    /// <summary>
    /// 任务在批量列表中的索引
    /// </summary>
    public int Index { get; set; }

    /// <summary>
    /// 任务代码
    /// </summary>
    public string WorkOrderCode { get; set; }

    /// <summary>
    /// 错误消息
    /// </summary>
    public string ErrorMessage { get; set; }

    /// <summary>
    /// 错误详情
    /// </summary>
    public string ErrorDetail { get; set; }
}