package com.ylx.point.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ylx.common.annotation.Excel;
import com.ylx.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 用户积分流水对象 point_user_log
 *
 * @author wzj
 * @date 2026-03-25
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class PointUserLog extends BaseEntity {
    private static final long serialVersionUID = -383943846291022514L;

    /**
     * $column.columnComment
     */
    private Long id;

    /**
     * 用户ID
     */
    @Excel(name = "用户的openID")
    private String openId;

    /**
     * 活动ID
     */
    @Excel(name = "活动ID")
    private Long activityId;

    /**
     * 活动名称
     */
    @Excel(name = "活动名称")
    private String activityName;

    /**
     * 任务ID
     */
    @Excel(name = "任务ID")
    private Long taskId;

    @Excel(name = "任务名称")
    private String taskName;

    /**
     * 1-普通任务 2-签到任务
     */
    @Excel(name = "1-普通任务 2-签到任务")
    private Integer taskType;

    /**
     * 积分变动值
     */
    @Excel(name = "积分变动值")
    private Integer points;

    /**
     * 变动后总余额 (快照)
     */
    @Excel(name = "变动后总余额 (快照)")
    private Integer balanceAfter;

    /**
     * 关联ID: 消耗/过期记录指向被扣减的"获得记录ID"
     */
    @Excel(name = "关联ID: 消耗/过期记录指向被扣减的获得记录ID")
    private Long sourceLogId;

    /**
     * 业务订单号/流水号
     */
    @Excel(name = "业务订单号/流水号")
    private String bizOrderId;

    /**
     * 该笔积分的过期时间 (仅获得记录有值)
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "该笔积分的过期时间 (仅获得记录有值)", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expireTime;

    /**
     * 该笔获得的积分记录是否已过期  0-未过期 1-已过期
     */
    @Excel(name = "该笔获得的积分记录是否已过期  0-未过期 1-已过期")
    private Integer isExpired;

    /**
     * 操作类型 1-收入 2-支出 3-过期
     */
    @Excel(name = "1-收入 2-支出 3-过期")
    private Integer opType;

    /**
     * 年月(YYYYMM)
     */
    @Excel(name = "年月(YYYYMM)")
    private String month;

    @TableField(exist = false)
    private String createBy;

    @TableField(exist = false)
    private String updateBy;

    @TableField("create_time")
    private Date createTime;

    @TableField(exist = false)
    private Date updateTime;

}
