package com.czg.account.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 会员积分
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 2.0 2024-10-25
 */
@Data
@Table("tb_shop_user")
public class MemberPoints implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 会员id
     */
    @Id(keyType = KeyType.Auto)
    @Column(value = "id")
    private Long shopUserId;
    /**
     * 店铺id
     */
    private Long sourceShopId;
    private Long mainShopId;
    /**
     * 会员名称
     */
    @Column("nick_name")
    private String nickName;
    /**
     * 会员头像
     */
    @Column("head_img")
    private String headImg;
    /**
     * 手机号码
     */
    @Column("phone")
    private String phone;
    /**
     * 账户积分
     */
    @Column("account_points")
    private Integer accountPoints;
    /**
     * 最近一次积分变动时间
     */
    @Column("last_points_change_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastPointsChangeTime;
    /**
     * 最近一次浮动积分
     */
    @Column("last_float_points")
    private Integer lastFloatPoints;
    /**
     * 是否会员 1-是 0-否
     */
    @Column("is_vip")
    private Integer vip;
}