package com.red.circle.wallet.infra.database.mongo.entity.log;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 同步缓存db日志.
 *
 * @author pengliang on 2023/9/18
 */
@Data
@Accessors(chain = true)
@Document("log_sync_cache_db_balance")
public class LogSyncCacheDbBalance implements Serializable {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 记录id.
   */
  @Id
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  /**
   * 归属系统.
   */
  private String sysOrigin;

  /**
   * 用户id.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long userId;

  /**
   * 收入.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long dbIncome;

  /**
   * 支出
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long dbExpenditure;

  /**
   * 余额.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long dbBalance;

  /**
   * 缓存余额.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long cacheBalance;

  /**
   * 最大容错数额.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long meltingFaultMaxNum;

  /**
   * 扣除.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long syncExpenditure;

  /**
   * 过期时间.
   */
  private Date expireTime;

  /**
   * 创建时间.
   */
  private Date createTime;

}
