using System;
using System.Collections.Generic;
using NPP.SmartSchedue.Api.Contracts.Core.Enums;

namespace NPP.SmartSchedue.Api.Contracts.Services.Integration.Output
{
    /// <summary>
    /// 整合记录信息（包含任务集）
    /// 用于根据recordID查询整合记录并返回完整的任务信息
    /// </summary>
    public class IntegrationRecordWithTasksOutput
    {
        /// <summary>
        /// 记录ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 整合批次编码
        /// </summary>
        public string IntegrationBatchCode { get; set; } = string.Empty;

        /// <summary>
        /// 整合时间
        /// </summary>
        public DateTime IntegrationTime { get; set; }

        /// <summary>
        /// 操作员用户ID
        /// </summary>
        public long OperatorUserId { get; set; }

        /// <summary>
        /// 操作员用户名
        /// </summary>
        public string OperatorUserName { get; set; } = string.Empty;

        /// <summary>
        /// 操作员真实姓名
        /// </summary>
        public string OperatorRealName { get; set; } = string.Empty;

        /// <summary>
        /// 策略配置详情
        /// </summary>
        public IntegrationStrategyConfig StrategyConfig { get; set; } = new();

        /// <summary>
        /// 人员分配结果详情
        /// </summary>
        public PersonnelAllocationResult? PersonnelAllocationResult { get; set; }

        /// <summary>
        /// 设备分配结果详情
        /// </summary>
        public EquipmentAllocationResult? EquipmentAllocationResult { get; set; }

        /// <summary>
        /// 成功任务数
        /// </summary>
        public int SuccessTaskCount { get; set; }

        /// <summary>
        /// 失败任务数
        /// </summary>
        public int FailedTaskCount { get; set; }

        /// <summary>
        /// 执行耗时（毫秒）
        /// </summary>
        public long ElapsedMilliseconds { get; set; }

        /// <summary>
        /// 公平性评分
        /// </summary>
        public int FairnessScore { get; set; }

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

        /// <summary>
        /// 备注信息
        /// </summary>
        public string Remarks { get; set; } = string.Empty;

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

        /// <summary>
        /// 涉及的项目编号列表
        /// </summary>
        public List<string> ProjectNumbers { get; set; } = new();

        /// <summary>
        /// 任务详细信息列表
        /// </summary>
        public List<TaskDetailForRecord> TaskDetails { get; set; } = new();

        /// <summary>
        /// 失败原因统计
        /// </summary>
        public Dictionary<string, object> FailureReasonStats { get; set; } = new();

        /// <summary>
        /// 整合类型
        /// </summary>
        public string IntegrationType { get; set; } = string.Empty;

        /// <summary>
        /// 发布状态
        /// </summary>
        public string PublishStatus { get; set; } = string.Empty;
    }


}
