package com.czg.market.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

import java.io.Serial;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 会员积分变动记录 实体类。
 *
 * @author ww
 * @since 2025-12-08
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("mk_points_user_record")
public class MkPointsUserRecord implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 积分用户Id
     */
    private Long mkPointsUserId;
    private Long shopId;
    private Long shopUserId;

    /**
     * 摘要信息（如：兑换某个商品/消费多少钱/充值多少钱/新会员赠送积分等）
     */
    private String content;
    @Column(ignore = true)
    private String shopName;

    /**
     * 订单编号
     */
    private String sourceId;

    /**
     * 浮动类型 add-累加 subtract-扣减
     */
    private String floatType;

    /**
     * 浮动积分(非0正负数)
     */
    private Long floatPoints;
    /**
     * 变动后积分
     */
    private Long balancePoints;

    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

}
