using System.Collections.Generic;
using NPP.SmartSchedue.Api.Contracts.Services.Work.Output;

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

/// <summary>
/// 整合记录验证结果
/// 用于重新验证整合记录的分配合理性
/// </summary>
public class IntegrationRecordValidationResult
{
    /// <summary>
    /// 验证是否通过
    /// </summary>
    public bool IsValid { get; set; }

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

    /// <summary>
    /// 冲突详情列表
    /// </summary>
    public List<ConflictDetail> ConflictDetails { get; set; } = new();

    /// <summary>
    /// 更新后的整合指标
    /// </summary>
    public IntegrationMetrics UpdatedMetrics { get; set; } = new();

    /// <summary>
    /// 验证摘要信息
    /// </summary>
    public string ValidationSummary { get; set; } = string.Empty;
}

/// <summary>
/// 冲突详情
/// </summary>
public partial class ConflictDetail
{
    /// <summary>
    /// 冲突类型
    /// </summary>
    public string ConflictType { get; set; } = string.Empty;

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

    /// <summary>
    /// 相关人员ID列表
    /// </summary>
    public List<long> RelatedPersonnelIds { get; set; } = new();

    /// <summary>
    /// 相关设备ID列表
    /// </summary>
    public List<long> RelatedEquipmentIds { get; set; } = new();

    /// <summary>
    /// 冲突描述
    /// </summary>
    public string Description { get; set; } = string.Empty;

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

/// <summary>
/// 整合指标
/// 包含整合过程的各种性能指标
/// </summary>
public class IntegrationMetrics
{
    /// <summary>
    /// 公平性评分
    /// </summary>
    public int FairnessScore { get; set; }

    /// <summary>
    /// 总体设备利用率
    /// </summary>
    public decimal OverallUtilizationRate { get; set; }

    /// <summary>
    /// 成功人员匹配数
    /// </summary>
    public int SuccessfulPersonnelMatches { get; set; }

    /// <summary>
    /// 成功设备匹配数
    /// </summary>
    public int SuccessfulEquipmentMatches { get; set; }

    /// <summary>
    /// 总体匹配成功率
    /// </summary>
    public decimal OverallMatchSuccessRate { get; set; }

    /// <summary>
    /// 平均任务复杂度
    /// </summary>
    public decimal AverageTaskComplexity { get; set; }
}