package com.qqchen.deploy.backend.workflow.entity;

import com.fasterxml.jackson.databind.JsonNode;
import com.qqchen.deploy.backend.framework.annotation.LogicDelete;
import com.qqchen.deploy.backend.framework.domain.Entity;
import com.qqchen.deploy.backend.workflow.dto.definition.node.uiVariables.NodeUiVariables;
import com.qqchen.deploy.backend.workflow.enums.NodeCategoryEnums;
import com.vladmihalcea.hibernate.type.json.JsonType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;
@Data
@jakarta.persistence.Entity
@EqualsAndHashCode(callSuper = true)
@Table(name = "workflow_node_definition")
@LogicDelete
public class WorkflowNodeDefinition extends Entity<Long> {

    @Column(name = "node_type", nullable = false)
    private String nodeType;

    @Column(name = "node_code", nullable = false)
    private String nodeCode;

    @Column(name = "node_name", nullable = false)
    private String nodeName;

    private String description;

    @Enumerated(EnumType.STRING)
    @Column(name = "category")
    private NodeCategoryEnums category;


    @Type(JsonType.class)
    @Column(name = "ui_variables", columnDefinition = "text", nullable = false)
    private NodeUiVariables uiVariables;

    @Type(JsonType.class)
    @Column(name = "panel_variables_schema", columnDefinition = "text", nullable = false)
    private JsonNode panelVariablesSchema;

    @Type(JsonType.class)
    @Column(name = "local_variables_schema", columnDefinition = "text", nullable = false)
    private JsonNode localVariablesSchema;

    @Type(JsonType.class)
    @Column(name = "form_variables_schema", columnDefinition = "text", nullable = false)
    private JsonNode formVariablesSchema;

    @Column(nullable = false)
    private Boolean enabled = true;
} 