using System.Collections.Generic;

namespace NPP.SmartSchedue.Api.Contracts.Services.Integration.Output
{
    /// <summary>
    /// 任务需求分析结果
    /// </summary>
    public class TaskRequirementAnalysisResult
    {
        /// <summary>
        /// 工序需求列表
        /// </summary>
        public List<TaskProcessRequirement> ProcessRequirements { get; set; } = new List<TaskProcessRequirement>();

        /// <summary>
        /// 资源需求统计
        /// </summary>
        public ResourceRequirement ResourceRequirements { get; set; } = new ResourceRequirement();

        /// <summary>
        /// 时间分布分析
        /// </summary>
        public TimeDistribution TimeDistribution { get; set; } = new TimeDistribution();

        /// <summary>
        /// 分析摘要
        /// </summary>
        public string AnalysisSummary { get; set; } = string.Empty;
    }

    /// <summary>
    /// 任务工序需求
    /// </summary>
    public class TaskProcessRequirement
    {
        public long TaskId { get; set; }
        public long ProcessId { get; set; }
        public List<string> RequiredQualifications { get; set; } = new List<string>();
        public System.TimeSpan? EstimatedDuration { get; set; }
        public long? EquipmentTypeId { get; set; }
    }

    /// <summary>
    /// 资源需求
    /// </summary>
    public class ResourceRequirement
    {
        public Dictionary<long, int> QualificationRequirements { get; set; } = new Dictionary<long, int>();
        public Dictionary<string, double> EquipmentTypeRequirements { get; set; } = new Dictionary<string, double>();
    }

    /// <summary>
    /// 时间分布
    /// </summary>
    public class TimeDistribution
    {
        public Dictionary<int, int> HourlyDistribution { get; set; } = new Dictionary<int, int>();
        public Dictionary<long, int> ShiftDistribution { get; set; } = new Dictionary<long, int>();
        public List<int> PeakHours { get; set; } = new List<int>();
    }
}