using System.Collections.Generic;
using System.Threading.Tasks;
using NPP.SmartSchedue.Api.Contracts.Domain.Work;
using ZhonTai.Admin.Core.Repositories;

namespace NPP.SmartSchedue.Api.Contracts.Domain.Work;

/// <summary>
/// 工作任务FL人员关联仓储接口
/// </summary>
public interface IWorkOrderFLPersonnelRepository : IRepositoryBase<WorkOrderFLPersonnelEntity>
{
    /// <summary>
    /// 根据工作任务ID获取FL人员列表
    /// </summary>
    /// <param name="workOrderId">工作任务ID</param>
    /// <returns>FL人员列表</returns>
    Task<List<WorkOrderFLPersonnelEntity>> GetByWorkOrderIdAsync(long workOrderId);

    /// <summary>
    /// 根据FL人员ID获取工作任务列表
    /// </summary>
    /// <param name="flPersonnelId">FL人员ID</param>
    /// <returns>工作任务列表</returns>
    Task<List<WorkOrderFLPersonnelEntity>> GetByPersonnelIdAsync(long personnelId);

    /// <summary>
    /// 批量添加工作任务FL人员关联
    /// </summary>
    /// <param name="workOrderId">工作任务ID</param>
    /// <param name="flPersonnelIds">FL人员ID列表</param>
    /// <param name="flPersonnelNames">FL人员姓名列表</param>
    /// <returns>添加结果</returns>
    Task<bool> BatchAddAsync(long workOrderId, List<long> flPersonnelIds, List<string> flPersonnelNames);

    /// <summary>
    /// 根据工作任务ID删除所有FL人员关联
    /// </summary>
    /// <param name="workOrderId">工作任务ID</param>
    /// <returns>删除结果</returns>
    Task<bool> DeleteByWorkOrderIdAsync(long workOrderId);

    /// <summary>
    /// 更新工作任务的FL人员关联
    /// </summary>
    /// <param name="workOrderId">工作任务ID</param>
    /// <param name="flPersonnelIds">新的FL人员ID列表</param>
    /// <param name="flPersonnelNames">新的FL人员姓名列表</param>
    /// <returns>更新结果</returns>
    Task<bool> UpdateByWorkOrderIdAsync(long workOrderId, List<long> flPersonnelIds, List<string> flPersonnelNames);
}