package cn.stylefeng.team.portal.modular.management.entity;

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.EnumFieldFormat;
import cn.stylefeng.team.portal.api.enums.PortalScopeTypeEnum;
import cn.stylefeng.workflow.api.enums.FlowAuthLinkTypeEnum;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

@TableName("portal_design_permission")
@Data
@EqualsAndHashCode(callSuper = true)
public class PortalDesignPermission extends BaseEntity {

    @TableId(value = "permission_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键id")
    private Long permissionId;

    @TableField("design_id")
    @ChineseDescription("门户设计id")
    private Long designId;

    @TableField("link_scope_type")
    @ChineseDescription("关联类型：10-机构，20-人员")
    @EnumFieldFormat(processEnum = FlowAuthLinkTypeEnum.class)
    private Integer linkScopeType;

    @TableField("link_business_id")
    @ChineseDescription("关联的业务id，例如，类型是10就是机构id")
    private Long linkBusinessId;

    @TableField("scope_type")
    @ChineseDescription("范围类型：1-指定范围，2-指定部门及以下")
    @EnumFieldFormat(processEnum = PortalScopeTypeEnum.class)
    private Integer scopeType;

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

    @TableField(exist = false)
    @ChineseDescription("关联业务的名称")
    private String linkBusinessName;

}