package com.bizzan.bitrade.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 体验金防刷预警记录
 */
@Entity
@Data
@Table(name = "experience_gift_risk_alert")
public class ExperienceGiftRiskAlert {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /** 预警用户ID */
    @Column(name = "member_id", nullable = false)
    private Long memberId;

    /** 4h内领取体验金次数 */
    @Column(name = "receipt_count", nullable = false)
    private Integer receiptCount;

    /** 4h内体验金平仓收益（USDT） */
    @Column(name = "profit_amount", nullable = false)
    private BigDecimal profitAmount;

    /** 状态：0=告警，1=已取消告警 */
    @Column(name = "status", nullable = false)
    private Integer status = 0;

    /** 预警时间 */
    @Column(name = "created_at", nullable = false, updatable = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdAt;

    /** 处理时间 */
    @Column(name = "handled_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date handledAt;

    /** 处理管理员ID */
    @Column(name = "handled_by")
    private Long handledBy;
}
