package com.red.circle.other.infra.database.mongo.entity.activity;

import cn.hutool.core.convert.Convert;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 消耗活动.
 *
 * @author pengshigang on 2023/5/25
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@Document("consume_activity_count")
@FieldDefaults(level = AccessLevel.PRIVATE)
public class ConsumeActivityCount extends Convert implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * userId_区域ID.
   */
  @Id
  String id;

  /**
   * 区域ID.
   */
  String regionId;

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

  /**
   * 目标值.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  Long target;

  /**
   * 已领取奖励ID.
   */
  List<String> receivedIds;

  /**
   * 创建时间.
   */
  Timestamp createTime;

  /**
   * 过期时间.
   */
  Timestamp expiredTime;

}
