using System;
using System.Collections.Generic;

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

/// <summary>
/// 创建待办结果
/// </summary>
public class CreateTodoResult
{
    /// <summary>
    /// 创建是否成功
    /// </summary>
    public bool IsSuccess { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedTime { get; set; }

    /// <summary>
    /// 待办类型
    /// </summary>
    public string TodoType { get; set; } = string.Empty;

    /// <summary>
    /// 创建的待办数量
    /// </summary>
    public int CreatedTodoCount { get; set; }

    /// <summary>
    /// 成功创建的待办ID列表
    /// </summary>
    public List<long> SuccessfulTodoIds { get; set; } = new();

    /// <summary>
    /// 创建失败的负责人ID及失败原因
    /// </summary>
    public Dictionary<long, string> FailedAssignees { get; set; } = new();

    /// <summary>
    /// 待办标题
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 截止时间
    /// </summary>
    public DateTime? DueDate { get; set; }

    /// <summary>
    /// 结果摘要
    /// </summary>
    public string ResultSummary { get; set; } = string.Empty;

    /// <summary>
    /// 错误消息列表
    /// </summary>
    public List<string> ErrorMessages { get; set; } = new();
}

/// <summary>
/// 整合发布验证错误信息
/// 用于发布前验证的错误详情
/// </summary>
public class IntegrationValidationError
{
    /// <summary>
    /// 错误类型
    /// </summary>
    public string ErrorType { get; set; } = string.Empty;

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

    /// <summary>
    /// 相关字段名
    /// </summary>
    public string RelatedFieldName { get; set; } = string.Empty;

    /// <summary>
    /// 相关任务ID列表
    /// </summary>
    public List<long> RelatedTaskIds { get; set; } = new();

    /// <summary>
    /// 错误代码
    /// </summary>
    public string ErrorCode { get; set; } = string.Empty;

    /// <summary>
    /// 解决建议
    /// </summary>
    public string Suggestion { get; set; } = string.Empty;
}