using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NPP.SmartSchedue.Api.Contracts.Services.Integration.Output;

namespace NPP.SmartSchedue.Api.Contracts.Services.Equipment;

/// <summary>
/// 设备服务接口
/// 提供设备查询和可用性检查等功能
/// </summary>
public interface IEquipmentService
{
    /// <summary>
    /// 获取指定日期的可用设备列表
    /// </summary>
    /// <param name="date">查询日期</param>
    /// <param name="processId">工序ID（可选）</param>
    /// <returns>可用设备列表</returns>
    Task<List<EquipmentBasicInfo>> GetAvailableEquipmentAsync(DateTime date, long? processId = null);

    /// <summary>
    /// 检查指定设备在指定日期是否可用
    /// </summary>
    /// <param name="equipmentId">设备ID</param>
    /// <param name="date">检查日期</param>
    /// <returns>是否可用</returns>
    Task<bool> IsEquipmentAvailableAsync(long equipmentId, DateTime date);

    /// <summary>
    /// 获取指定日期范围内的设备使用统计
    /// </summary>
    /// <param name="startDate">开始日期</param>
    /// <param name="endDate">结束日期</param>
    /// <returns>设备使用统计</returns>
    Task<EquipmentUsageStatistics> GetEquipmentUsageStatisticsAsync(DateTime startDate, DateTime endDate);

    /// <summary>
    /// 批量检查设备可用性
    /// </summary>
    /// <param name="equipmentIds">设备ID列表</param>
    /// <param name="date">检查日期</param>
    /// <returns>设备可用性结果字典</returns>
    Task<Dictionary<long, bool>> BatchCheckEquipmentAvailabilityAsync(List<long> equipmentIds, DateTime date);
}