using System.Linq.Expressions;
using DS.Module.Core;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Op.Entity;
namespace DS.WMS.Core.Flow.Interface;
///
/// 租户端工作流
///
public interface IClientFlowInstanceService
{
///
/// 确定是否为最后审批人
///
/// 任务类型
/// 业务ID
/// 业务类型
///
DataResult IsLastMarker(TaskBaseTypeEnum taskType, long bsId, BusinessType? bsType);
///
/// 确定工作流是否正在运行中
///
/// 工作流类型
/// 业务类型
/// 业务ID
///
Task IsRunningAsync(TaskBaseTypeEnum type, BusinessType? businessType = null, params long[] ids);
///
/// 确定工作流是否存在
///
/// 工作流类型
/// 业务类型
/// 自定义查询条件
/// 业务ID
///
Task ExistsAsync(TaskBaseTypeEnum? type = null, BusinessType? businessType = null, Expression>? expression = null, params long[] ids);
///
/// 根据业务ID获取关联工作流
///
/// 工作流类型
/// 业务类型
/// 业务ID
///
Task> GetInstancesAsync(TaskBaseTypeEnum type, BusinessType? businessType = null, params long[] ids);
///
/// 获取工作流实例信息
///
/// 业务ID
/// 业务类型
/// 审批类型
///
Task>> GetInstancesByBizAsync(long businessId, BusinessType? businessType, params TaskBaseTypeEnum[]? types);
///
/// 列表查询
///
///
///
Task>> GetListAsync(PageRequest request);
///
/// 添加编辑
///
///
///
Task EditAsync(FlowInstanceReq req);
///
/// 获取详情
///
///
///
Task> GetAsync(long id);
///
/// 启动实例
///
///
///
Task StartAsync(long id);
///
/// 创建工作流实例
///
///
///
Task CreateAsync(CreateFlowInstanceReq req);
///
/// 工作流审批
///
///
///
Task AuditAsync(FlowInstanceAuditReq req);
///
/// 工作流审批
///
///
///
Task AuditAsync(FlowAuditInfo info);
///
/// 撤销工作流
///
///
/// 备注
///
Task WithdrawAsync(long[] ids, string? note = null);
///
/// 撤销审核
///
/// 任务类型
/// 业务ID
/// 业务类型
/// 备注
///
Task WithdrawAsync(TaskBaseTypeEnum taskType, long[] bsIds,
BusinessType? businessType = null, string? note = null);
///
/// 运行回调更新
///
/// 审核类型
/// 业务ID
/// 业务类型
/// 回调URL
///
Task RunCallbackAsync(TaskBaseTypeEnum taskType, long bsId, BusinessType? businessType = null, string? callbackURL = null);
///
/// 获取流程操作历史
///
/// 业务ID
/// bsType
///
Task>> GetHistoriesAsync(long bsId, BusinessType? bsType);
}