using NPP.SmartSchedue.Api.Contracts.Domain.Integration;
using System;

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

/// <summary>
/// 整合记录列表输出
/// 用于分页查询返回的简洁信息
/// </summary>
public class IntegrationRecordListOutput
{
    /// <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>
    /// 项目编号列表（逗号分隔）
    /// </summary>
    public string ProjectNumbers { get; set; } = string.Empty;

    /// <summary>
    /// 原始任务数量
    /// </summary>
    public int OriginalTaskCount { get; set; }

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


    public string PublishStatus { get; set; }

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

    /// <summary>
    /// 成功率（计算属性）
    /// </summary>
    public double SuccessRate => OriginalTaskCount > 0 ? (double)SuccessTaskCount / OriginalTaskCount : 0;

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

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

    /// <summary>
    /// 设备利用率
    /// </summary>
    public decimal EquipmentUtilizationRate { 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 string Remarks { get; set; } = string.Empty;

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