using System;
using System.Collections.Generic;
using CncModels.Dto.Machine;
using CncModels.Dto;

namespace CncService.Interface
{
    /// <summary>
    /// 机床管理服务接口
    /// </summary>
    public interface IMachineService
    {
        /// <summary>
        /// 分页查询机床列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>分页结果</returns>
        PagedResult<MachineListItem> GetList(MachineQuery query);

        /// <summary>
        /// 根据ID获取机床详情
        /// </summary>
        /// <param name="id">机床ID</param>
        /// <returns>机床详情</returns>
        MachineDetailResponse GetById(int id);

        /// <summary>
        /// 新增机床
        /// </summary>
        /// <param name="request">创建参数</param>
        /// <returns>新建机床的ID</returns>
        int Create(CreateMachineRequest request);

        /// <summary>
        /// 编辑机床信息
        /// </summary>
        /// <param name="id">机床ID</param>
        /// <param name="request">修改参数</param>
        /// <returns>是否更新成功</returns>
        bool Update(int id, UpdateMachineRequest request);

        /// <summary>
        /// 删除机床并解绑相关工人
        /// </summary>
        /// <param name="id">机床ID</param>
        /// <returns>是否删除成功</returns>
        bool Delete(int id);

        /// <summary>
        /// 批量删除机床并解绑相关工人
        /// </summary>
        /// <param name="ids">机床ID列表</param>
        /// <returns>删除的记录数</returns>
        int BatchDelete(List<int> ids);

        /// <summary>
        /// 启用或禁用机床
        /// </summary>
        /// <param name="id">机床ID</param>
        /// <returns>是否切换成功</returns>
        bool ToggleEnabled(int id);

        /// <summary>
        /// 获取机床实时采集状态
        /// </summary>
        /// <param name="id">机床ID</param>
        /// <returns>实时状态信息</returns>
        MachineStatusResponse GetStatus(int id);

        /// <summary>
        /// 获取机床今日产量明细
        /// </summary>
        /// <param name="id">机床ID</param>
        /// <returns>今日产量列表</returns>
        List<MachineTodayProdItem> GetTodayProduction(int id);

        /// <summary>
        /// 获取机床7天产量趋势
        /// </summary>
        /// <param name="id">机床ID</param>
        /// <returns>趋势数据列表</returns>
        List<MachineTrendItem> GetProductionTrend(int id);

        /// <summary>
        /// 获取机床近期采集记录
        /// </summary>
        /// <param name="id">机床ID</param>
        /// <returns>采集记录列表</returns>
        List<MachineCollectRecordItem> GetCollectRecords(int id);
    }
}
