using System;
using System.Collections.Generic;

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

/// <summary>
/// 整合记录修改结果
/// 包含修改操作的详细结果和验证信息
/// </summary>
public class IntegrationRecordModifyResult
{
    /// <summary>
    /// 修改是否成功
    /// </summary>
    public bool IsSuccess { get; set; }

    /// <summary>
    /// 成功消息
    /// </summary>
    public string SuccessMessage { get; set; } = string.Empty;

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

    /// <summary>
    /// 修改成功的任务详情
    /// </summary>
    public List<TaskModificationDetail> ModifiedTasks { get; set; } = new();

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

    /// <summary>
    /// 警告消息列表
    /// </summary>
    public List<string> WarningMessages { get; set; } = new();
}

/// <summary>
/// 任务修改详情
/// 记录单个任务的修改详细信息
/// </summary>
public class TaskModificationDetail
{
    /// <summary>
    /// 任务ID
    /// </summary>
    public long TaskId { get; set; }

    /// <summary>
    /// 任务代码
    /// </summary>
    public string TaskCode { get; set; } = string.Empty;

    /// <summary>
    /// 修改是否成功
    /// </summary>
    public bool IsSuccess { get; set; }

    /// <summary>
    /// 人员是否被修改
    /// </summary>
    public bool PersonnelModified { get; set; }

    /// <summary>
    /// 设备是否被修改
    /// </summary>
    public bool EquipmentModified { get; set; }

    /// <summary>
    /// 原始人员ID
    /// </summary>
    public long? OriginalPersonnelId { get; set; }

    /// <summary>
    /// 原始人员姓名
    /// </summary>
    public string OriginalPersonnelName { get; set; } = string.Empty;

    /// <summary>
    /// 新的人员ID
    /// </summary>
    public long? NewPersonnelId { get; set; }

    /// <summary>
    /// 新的人员姓名
    /// </summary>
    public string NewPersonnelName { get; set; } = string.Empty;

    /// <summary>
    /// 原始设备ID
    /// </summary>
    public long? OriginalEquipmentId { get; set; }

    /// <summary>
    /// 原始设备名称
    /// </summary>
    public string OriginalEquipmentName { get; set; } = string.Empty;

    /// <summary>
    /// 新的设备ID
    /// </summary>
    public long? NewEquipmentId { get; set; }

    /// <summary>
    /// 新的设备名称
    /// </summary>
    public string NewEquipmentName { get; set; } = string.Empty;

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime ModificationTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    public string ModifiedBy { get; set; } = string.Empty;

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

    /// <summary>
    /// 警告消息列表
    /// </summary>
    public List<string> WarningMessages { get; set; } = new();
}