package com.yunzhupaas.visual.service;

import com.yunzhupaas.base.ActionResult;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.base.entity.VisualdevEntity;
import com.yunzhupaas.base.model.VisualDevJsonModel;
import com.yunzhupaas.base.model.flow.DataModel;
import com.yunzhupaas.base.model.flow.FlowFormDataModel;
import com.yunzhupaas.exception.WorkFlowException;
import com.yunzhupaas.onlinedev.model.PaginationModel;
import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO;
import com.yunzhupaas.onlinedev.model.VisualParamModel;

import java.util.List;
import java.util.Map;

public interface VisualdevApi {
    /**
     * 流程表单数据保存
     *
     * @param flowFormDataModel
     * @throws WorkFlowException
     */
    ActionResult saveOrUpdate(FlowFormDataModel flowFormDataModel);

    /**
     * 流程表单数据删除
     *
     * @param formId
     * @param id
     * @return
     * @throws Exception
     */
    boolean delete(String formId, String id);

    /**
     * 流程表单数据详情
     *
     * @param formId
     * @param id
     * @return
     */
    ActionResult info(String formId, String id);

    /**
     * 流程表单配置
     *
     * @param formId
     * @return
     */
    VisualdevEntity getFormConfig(String formId);

    /**
     * 表单列表
     *
     * @param formIds 表单主键集合
     * @return
     */
    List<VisualdevEntity> getFormConfigList(List<String> formIds);

    /**
     * 流程关联表单（一流程多表单）
     *
     * @param flowId
     * @param formIds
     */
    void saveFlowIdByFormIds(String flowId, List<String> formIds);

    VisualdevEntity getReleaseInfo(String formId);

    List<Map<String, Object>> getListWithTableList(VisualDevJsonModel visualDevJsonModel, PaginationModel pagination, UserInfo userInfo);

    VisualdevModelDataInfoVO getEditDataInfo(String id, VisualdevEntity visualdevEntity);

    DataModel visualCreate(VisualParamModel model) throws Exception;

    DataModel visualUpdate(VisualParamModel model) throws Exception;

    void visualDelete(VisualParamModel model) throws Exception;

    /**
     * 根据表名和规则删除功能表单数据
     */
    void deleteByTableName(FlowFormDataModel model) throws Exception;
}

