using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using NPP.SmartSchedue.Api.Contracts.Services.Equipment.Dto;

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

/// <summary>
/// 设备本地服务接口（专用于SmartSchedule模块）
/// </summary>
public interface IEquipmentLocalService
{
    /// <summary>
    /// 获取设备列表
    /// </summary>
    /// <param name="input">查询条件</param>
    /// <returns>设备列表</returns>
    Task<List<EquipmentListOutput>> GetListAsync(GetEquipmentListInput input);

    /// <summary>
    /// 获取设备详情
    /// </summary>
    /// <param name="id">设备ID</param>
    /// <returns>设备详情</returns>
    Task<EquipmentListOutput> GetAsync(long id);

    /// <summary>
    /// 获取可用设备列表
    /// </summary>
    /// <param name="date">指定日期</param>
    /// <param name="processId">工序ID（可选）</param>
    /// <returns>可用设备列表</returns>
    Task<List<EquipmentListOutput>> 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="date">指定日期</param>
    /// <returns>需要维护的设备列表</returns>
    Task<List<EquipmentListOutput>> GetNeedMaintenanceAsync(DateTime date);

    /// <summary>
    /// 获取需要校验的设备列表
    /// </summary>
    /// <param name="date">指定日期</param>
    /// <returns>需要校验的设备列表</returns>
    Task<List<EquipmentListOutput>> GetNeedCalibrationAsync(DateTime date);

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