package com.ylx.point.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 积分扣减明细对象 point_deduct_detail
 *
 * @author wzj
 * @date 2026-04-17
 */
@Data
@TableName("point_deduct_detail")
public class PointDeductDetail implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 消耗/过期流水ID (point_user_log.id, op_type=2or3)
     */
    @TableField("deduct_log_id")
    private Long deductLogId;

    /**
     * 被扣减的获得流水ID (point_user_log.id, op_type=1)
     */
    @TableField("earn_log_id")
    private Long earnLogId;

    /**
     * 本次从该批次扣减的积分数(正整数)
     */
    @TableField("deduct_points")
    private Integer deductPoints;

    /**
     * 用户openID(冗余,便于分区查询)
     */
    @TableField("open_id")
    private String openId;

    /**
     * 年月YYYYMM(与主表保持一致,分表用)
     */
    @TableField("month")
    private String month;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
}