package com.gxwebsoft.shop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 分销商推荐关系表
 *
 * @author 科技小王子
 * @since 2025-08-11 23:51:41
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ShopDealerReferee对象", description = "分销商推荐关系表")
public class ShopDealerReferee implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "分销商用户ID")
    private Integer dealerId;

    @Schema(description = "分销商名称")
    @TableField(exist = false)
    private String dealerName;

    @Schema(description = "分销商头像")
    @TableField(exist = false)
    private String dealerAvatar;

    @Schema(description = "分销商手机号")
    @TableField(exist = false)
    private String dealerPhone;

    @Schema(description = "用户id(被推荐人)")
    private Integer userId;

    @Schema(description = "昵称")
    @TableField(exist = false)
    private String nickname;

    @Schema(description = "头像")
    @TableField(exist = false)
    private String avatar;

    @Schema(description = "别名")
    @TableField(exist = false)
    private String alias;

    @Schema(description = "手机号")
    @TableField(exist = false)
    private String phone;

    @Schema(description = "是否管理员")
    @TableField(exist = false)
    private Boolean isAdmin;

    @Schema(description = "推荐关系层级(弃用)")
    private Integer level;

    @Schema(description = "来源(如 goods_share)")
    // NOTE: 表 shop_dealer_referee 若未新增该字段，需要 exist=false，避免 MyBatis-Plus 自动生成SQL时报 Unknown column。
    @TableField(exist = false)
    private String source;

    @Schema(description = "场景参数(用于溯源统计，如 inviter=<inviter>&source=goods_share&t=<t>)")
    @TableField(exist = false)
    private String scene;

    @Schema(description = "商城ID")
    private Integer tenantId;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

}
