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

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.annotation.SimpleFieldFormat;
import cn.stylefeng.roses.kernel.sys.api.format.UserNameFormatProcess;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@TableName("flow_design_model")
@Data
@EqualsAndHashCode(callSuper = true)
public class Model extends BaseEntity {

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

    @TableField("business_category_id")
    @ChineseDescription("所属业务分类id")
    private Long businessCategoryId;

    @TableField("model_name")
    @ChineseDescription("模型名称")
    private String modelName;

    @TableField("model_code")
    @ChineseDescription("模型编码")
    private String modelCode;

    @TableField("model_icon_type")
    @ChineseDescription("图标类型：1-文件id，2-选择图片")
    private Integer modelIconType;

    @TableField("model_icon")
    @ChineseDescription("模型图标，存icon编号对应前端资源")
    private String modelIcon;

    @TableField("model_icon_file_id")
    @ChineseDescription("模型图标，自定义上传文件id")
    private Long modelIconFileId;

    @TableField("remark")
    @ChineseDescription("说明")
    private String remark;

    @TableField("current_version")
    @ChineseDescription("当前流程定义版本，例如：v1.0")
    private String currentVersion;

    @TableField("latest_definition_id")
    @ChineseDescription("当前最新流程定义id")
    private Long latestDefinitionId;

    @TableField("status_flag")
    @ChineseDescription("状态：1-启用，2-停用")
    private Integer statusFlag;

    @TableField("hidden_flag")
    @ChineseDescription("是否隐藏流程：Y-隐藏，N-不隐藏")
    private String hiddenFlag;

    @TableField("fld_sort")
    @ChineseDescription("排序")
    private BigDecimal fldSort;

    @TableField("manager_user_id")
    @ChineseDescription("流程管理员的用户id")
    @SimpleFieldFormat(processClass = UserNameFormatProcess.class)
    private Long managerUserId;

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

    @TableField(exist = false)
    private String categoryName;

    @TableField(exist = false)
    private Boolean commonFlowFlag = false;

}
