package tech.easyflow.ai.entity;

import com.easyagents.core.model.chat.tool.Tool;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import tech.easyflow.ai.easyagents.tool.WorkflowTool;
import tech.easyflow.ai.entity.base.WorkflowBase;
import tech.easyflow.system.permission.resource.VisibilityResource;

/**
 * 实体类。
 *
 * @author michael
 * @since 2024-08-23
 */

@Table("tb_workflow")
public class Workflow extends WorkflowBase implements VisibilityResource {

    @Column(ignore = true)
    private Boolean approvalPending;

    @Column(ignore = true)
    private String currentApprovalActionType;

    @Column(ignore = true)
    private String displayPublishStatus;

    @Column(ignore = true)
    private String createdByName;

    public Tool toFunction(boolean needEnglishName) {
        return new WorkflowTool(this, needEnglishName);
    }

    public Tool toFunction(boolean needEnglishName, String definitionId) {
        return new WorkflowTool(this, needEnglishName, definitionId);
    }

    public Boolean getApprovalPending() {
        return approvalPending;
    }

    public void setApprovalPending(Boolean approvalPending) {
        this.approvalPending = approvalPending;
    }

    public String getCurrentApprovalActionType() {
        return currentApprovalActionType;
    }

    public void setCurrentApprovalActionType(String currentApprovalActionType) {
        this.currentApprovalActionType = currentApprovalActionType;
    }

    public String getDisplayPublishStatus() {
        return displayPublishStatus;
    }

    public void setDisplayPublishStatus(String displayPublishStatus) {
        this.displayPublishStatus = displayPublishStatus;
    }

    /**
     * 获取创建人展示名称。
     *
     * @return 创建人展示名称
     */
    public String getCreatedByName() {
        return createdByName;
    }

    /**
     * 设置创建人展示名称。
     *
     * @param createdByName 创建人展示名称
     */
    public void setCreatedByName(String createdByName) {
        this.createdByName = createdByName;
    }
}
