package com.czg.account.entity;

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 1.0 2025-02-25
 */
@Data
@Table("tb_member_points_log")
public class MemberPointsLog implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id(keyType = KeyType.Auto)
    private Long id;
    /**
     * 店铺id
     */
    private Long shopId;
    /**
     * 店铺用户id
     */
    private Long shopUserId;
    /**
     * 摘要信息（如：兑换某个商品/消费多少钱/充值多少钱/新会员赠送积分等）
     */
    private String content;
    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * 浮动类型 add-累加 subtract-扣减
     */
    private String floatType;
    /**
     * 浮动积分(非0正负数)
     */
    private Integer floatPoints;
    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;
}