using System.Collections.Generic;
using NPP.SmartSchedue.Api.Contracts.Domain.Time;
using NPP.SmartSchedue.Api.Contracts.Domain.Work;
using NPP.SmartSchedue.Api.Contracts.Domain.Personnel;
using NPP.SmartSchedue.Api.Contracts.Domain.Equipment;

namespace NPP.SmartSchedue.Api.Contracts.Services.Integration.Output
{
    /// <summary>
    /// 任务详细信息加载结果
    /// </summary>
    public class TaskDetailLoadResult
    {
        /// <summary>
        /// 任务详细信息列表
        /// </summary>
        public List<TaskDetailInfo> TaskDetails { get; set; } = new List<TaskDetailInfo>();

        /// <summary>
        /// 加载数据统计
        /// </summary>
        public LoadedDataStatistics LoadedDataStatistics { get; set; } = new LoadedDataStatistics();

        /// <summary>
        /// 优化摘要
        /// </summary>
        public string OptimizationSummary { get; set; } = string.Empty;
    }

    /// <summary>
    /// 任务详细信息
    /// </summary>
    public class TaskDetailInfo
    {
        public long TaskId { get; set; }
        public string TaskCode { get; set; } = string.Empty;
        public List<ShiftRuleEntity> ShiftRules { get; set; } = new List<ShiftRuleEntity>();
        public List<QualificationRequirement> QualificationRequirements { get; set; } = new List<QualificationRequirement>();
        public List<WorkOrderFLPersonnelEntity> FLPersonnelRelations { get; set; } = new List<WorkOrderFLPersonnelEntity>();
        public SpecifiedConstraints SpecifiedConstraints { get; set; } = new SpecifiedConstraints();
    }

    /// <summary>
    /// 指定约束
    /// </summary>
    public class SpecifiedConstraints
    {
        public List<EquipmentEntity> SpecifiedEquipments { get; set; } = new List<EquipmentEntity>();
        public List<PersonnelEntity> SpecifiedPersonnels { get; set; } = new List<PersonnelEntity>();
    }

    /// <summary>
    /// 加载数据统计
    /// </summary>
    public class LoadedDataStatistics
    {
        public int TotalTasks { get; set; }
        public int TotalAssociatedRecords { get; set; }
        public int ShiftRulesCount { get; set; }
        public int QualificationRequirementsCount { get; set; }
        public int FLPersonnelRelationsCount { get; set; }
        public int SpecifiedConstraintsCount { get; set; }
    }

    /// <summary>
    /// 资质要求（暂时定义，实际应该从正确的命名空间引用）
    /// </summary>
    public class QualificationRequirement
    {
        public long QualificationId { get; set; }
        public string QualificationName { get; set; } = string.Empty;
    }
}