package cn.stylefeng.workflow.instance.modular.business.entity;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseBusinessEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.annotation.SimpleFieldFormat;
import cn.stylefeng.team.project.api.format.CategoryNameFormatProcess;
import cn.stylefeng.workflow.design.api.format.ModelNameFormatProcess;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@TableName("flow_business_link")
@Data
@EqualsAndHashCode(callSuper = true)
public class BusinessLink extends BaseBusinessEntity {

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

    @TableField("business_name")
    @ChineseDescription("业务名称")
    private String businessName;

    @TableField("business_code")
    @ChineseDescription("业务的唯一编码，一般用这个编码进行流程发起")
    private String businessCode;

    @TableField("flow_category_id")
    @ChineseDescription("流程分类的id")
    @SimpleFieldFormat(processClass = CategoryNameFormatProcess.class)
    private Long flowCategoryId;

    @TableField("flow_model_id")
    @ChineseDescription("关联的流程模型id")
    @SimpleFieldFormat(processClass = ModelNameFormatProcess.class)
    private Long flowModelId;

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

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

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

}
