using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 试卷管理服务
/// </summary>
public interface IExamPaperService
{
    /// <summary>
    /// 按监测计划初始化试卷
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task BatchInit(ExamPaperBatchInitInput input);
    /// <summary>
    /// 分配双向细目表编制人
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task AssignTwclWriter(AssignExamPaperWriterInput input);
    /// <summary>
    /// 分配问题建议撰写人
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task AssignSuggestionWriter(AssignExamPaperWriterInput input);
    /// <summary>
    /// 根据ID获取试卷详情
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    Task<ExamPaperOutput> GetById(int id);
    /// <summary>
    /// 根据监测计划ID获取试卷列表（管理端）
    /// </summary>
    /// <param name="examPlanId"></param>
    /// <returns></returns>
    Task<List<ExamPaperLiteOutput>> GetListByExamPlanId(int examPlanId);
    /// <summary>
    /// 获取双向细目表监测计划列表（管理端）
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<PageResult<ExamPaperTodoPlanOutput>> QueryExamPlanPageList(ExamPlanPageInput input);
    /// <summary>
    /// 导出TQES导入文件格式文件包
    /// </summary>
    /// <param name="examPlanId"></param>
    /// <returns></returns>
    /// <exception cref="Exception"></exception>
    Task<(string, byte[])> ExportTqesFile(int examPlanId);


    /// <summary>
    /// 分页查询编撰人监测计划列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<PageResult<ExamPaperTodoPlanOutput>> QueryWriterExamPlanPageList(ExamPaperExamPlanPageInput input);
    /// <summary>
    /// 根据监测计划ID获取待处理试卷列表
    /// </summary>
    /// <param name="examPlanId"></param>
    /// <param name="writerType"></param>
    /// <returns></returns>
    Task<List<ExamPaperLiteOutput>> GetWriterListByExamPlanId(int examPlanId, ExamPaperWriterType writerType);


    /// <summary>
    /// 保存问题建议
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task SaveSuggestion(SaveExamPaperSuggestion input);
    /// <summary>
    /// 提交双向细目表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task SubmitTwcl(BaseId input);
    /// <summary>
    /// 提交问题建议
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task SubmitSuggestion(BaseId input);
}
