package tech.easyflow.approval.entity.vo;

import java.math.BigInteger;

/**
 * 审批动作执行结果。
 */
public class ApprovalActionResult {

    private boolean approvalRequired;

    private BigInteger instanceId;

    /**
     * 构造需要审批的结果。
     *
     * @param instanceId 审批实例 ID
     * @return 审批结果
     */
    public static ApprovalActionResult required(BigInteger instanceId) {
        ApprovalActionResult result = new ApprovalActionResult();
        result.setApprovalRequired(true);
        result.setInstanceId(instanceId);
        return result;
    }

    /**
     * 构造直接执行完成的结果。
     *
     * @return 审批结果
     */
    public static ApprovalActionResult direct() {
        ApprovalActionResult result = new ApprovalActionResult();
        result.setApprovalRequired(false);
        return result;
    }

    public boolean isApprovalRequired() {
        return approvalRequired;
    }

    public void setApprovalRequired(boolean approvalRequired) {
        this.approvalRequired = approvalRequired;
    }

    public BigInteger getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(BigInteger instanceId) {
        this.instanceId = instanceId;
    }
}
