import 'package:fis_jsonrpc/rpc.dart';
import 'package:fis_common/event/event_type.dart';
import 'package:flyinsono/pages/schedule/schedule_notification/schedule_notification_controller.dart';

abstract class IServerTaskManager {
  FEventHandler<ApplicationNotification> onReceiveNotification =
      FEventHandler<ApplicationNotification>();

  ///获取任务列表
  Future<List<TaskBaseDTO>> getTaskList({
    String keyWord = '',
    VTaskStatus status = VTaskStatus.Completed,
  });

  ///创建任务
  Future<String> createTask({
    String? businessCode,
    required List<CreateTaskDetailInfo> taskDetailList,
    String? name,
    VTaskType taskType = VTaskType.UserExport,
  });

  ///查询主任务详情
  Future<MainTaskDTO?> getMainTaskDetailAsync(String mainTaskCode);

  ///获取任务详情
  Future<TaskDTO?> getTaskDetail(String taskCode);

  Future<bool> canCelTasks(
      String currentSelectedTaskId, List<TaskDetail> taskDetailList);

  ///触发任务完成通知
  void onTaskCompleted(TaskCompletedNotification value);
}
