package com.xdap.self_development.service;


import com.xdap.self_development.controller.form.HandleApprovalRequest;
import com.xdap.self_development.controller.form.HandleReturnNodeForm;
import com.xdap.self_development.controller.form.UpdateNodeForm;
import com.xdap.self_development.controller.request.ApprovalNodeRequest;
import com.xdap.self_development.domain.dto.*;
import com.xdap.self_development.domain.enums.ParamValueVersionEnum;
import com.xdap.self_development.domain.pojo.ApprovalConfigPojo;
import com.xdap.self_development.domain.pojo.EngineParamDetailPojo;
import com.xdap.self_development.domain.pojo.EngineReviewListPojo;
import com.xdap.self_development.domain.pojo.ParamApprovalRecordPojo;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;

public interface ActivitiProcessService {
    List<ActivitiDataDTO> initiateApproval(String modelID, String userID);
    //开始审批
    void startActiviti(ApprovalNodeRequest approvalNodeRequest);
    //查看
    ActivitiDataAndRecordDTO showActivitiData(ShowActivitiDTO showActivitiDTO);
    //操作
    String handleApproval(HandleApprovalDTO handleApprovalDTO);

    boolean getIsDirect(String flowId);

    ApprovalNodesDTO getApprovalUsers(@NotBlank String flowId);

    void directSendingApproval(@NotBlank String templateId, @NotBlank String userId);

    List<String> getReturnNodes(@NotBlank String flowId);

    void handleReturnToNode(@Valid HandleReturnNodeForm form);

    void handleReturn(@Valid HandleApprovalRequest request);

    void processApproval(
            EngineReviewListPojo flow,
            HandleApprovalDTO request,
            ApprovalConfigPojo currentNode,
            ParamApprovalRecordPojo lastedRecord,
            List<EngineParamDetailPojo> list
    );
    void cancelProcess(
            EngineReviewListPojo flow,
            ApprovalConfigPojo node,
            ParamValueVersionEnum status,
            String userId
    );
    void updateTasks(
            EngineReviewListPojo flow,
            String status,
            Integer enableReturn,
            ApprovalConfigPojo currentNode
    );
    void processNextNode(
            EngineReviewListPojo flow,
            ApprovalConfigPojo currentNode,
            String userId,
            List<EngineParamDetailPojo> list
    );
    void addNodeTodo(
            EngineReviewListPojo flow,
            ApprovalConfigPojo node,
            String createBy,
            Integer enableReturn
    );

    void updateFlowTitle(@NotBlank String flowId, @NotBlank String title);

    void continueApproval(@NotBlank String flowId, @NotBlank String userId);

    List<String> getEditableNodes(@NotBlank String flowId);

    void updateNode(UpdateNodeForm form);
}
