package cn.stylefeng.workflow.api.entity.design;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseBusinessEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.workflow.api.pojo.config.MyFlowDesign;
import cn.stylefeng.workflow.api.pojo.config.SixGraphDesign;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;

@TableName(value = "flow_design_definition", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class Definition extends BaseBusinessEntity {

    @TableId(value = "definition_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键")
    private Long definitionId;

    @TableField("model_id")
    @ChineseDescription("流程模型id")
    private Long modelId;

    @TableField("definition_version")
    @ChineseDescription("流程版本，例如：v1.0")
    private String definitionVersion;

    @TableField(value = "x_six_graph_json", typeHandler = JacksonTypeHandler.class)
    @ChineseDescription("存储ant x6引擎的流程图json")
    private SixGraphDesign xSixGraphJson;

    @TableField(value = "my_flow_design", typeHandler = JacksonTypeHandler.class)
    @ChineseDescription("仿钉钉模式的流程设计的json")
    private MyFlowDesign myFlowDesign;

    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    @ChineseDescription("租户号")
    private Long tenantId;

    @TableField(exist = false)
    @ChineseDescription("模型名称")
    private String modelName;

}
