using System.Collections.Generic;

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

/// <summary>
/// 批量工作任务分配更新结果输出
/// </summary>
public class BatchWorkOrderAssignmentUpdateOutput
{
    /// <summary>
    /// 批量操作是否整体成功
    /// </summary>
    public bool Success { get; set; }

    /// <summary>
    /// 总体消息
    /// </summary>
    public string Message { get; set; } = "";

    /// <summary>
    /// 各任务的处理结果
    /// </summary>
    public List<WorkOrderAssignmentResult> Results { get; set; } = new List<WorkOrderAssignmentResult>();

    /// <summary>
    /// 成功处理的任务数量
    /// </summary>
    public int SuccessCount { get; set; }

    /// <summary>
    /// 失败处理的任务数量
    /// </summary>
    public int FailureCount { get; set; }

    /// <summary>
    /// 有警告的任务数量
    /// </summary>
    public int WarningCount { get; set; }

    /// <summary>
    /// 批量操作摘要
    /// </summary>
    public string Summary { get; set; } = "";
}

/// <summary>
/// 单个任务的分配结果
/// </summary>
public class WorkOrderAssignmentResult
{
    /// <summary>
    /// 任务ID
    /// </summary>
    public long WorkOrderId { get; set; }

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

    /// <summary>
    /// 处理是否成功
    /// </summary>
    public bool Success { get; set; }

    /// <summary>
    /// 处理消息
    /// </summary>
    public string Message { get; set; } = "";

    /// <summary>
    /// 验证警告列表
    /// </summary>
    public List<ValidationWarning> Warnings { get; set; } = new List<ValidationWarning>();

    /// <summary>
    /// 验证错误列表
    /// </summary>
    public List<ValidationError> Errors { get; set; } = new List<ValidationError>();

    /// <summary>
    /// 更新后的任务信息
    /// </summary>
    public WorkOrderGetOutput UpdatedWorkOrder { get; set; }
}