package com.red.circle.other.inner.model.cmd.material;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.red.circle.other.inner.enums.material.BadgeConfigTypeEnum;
import com.red.circle.tool.core.parse.DataTypeUtils;
import java.io.Serializable;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author pengliang on 2021/11/23
 */
@Data
@Accessors(chain = true)
public class PrizeDescribe implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * 跟踪id.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long trackId;

  /**
   * 类型.
   */
  private String type;

  /**
   * 明细类型.
   */
  private String detailType;

  /**
   * 内容.
   */
  private String content;

  /**
   * 奖励数.
   */
  private Integer quantity;

  /**
   * 备注.
   */
  private String remark;

  public Long getContentLong() {
    return DataTypeUtils.toLong(this.getContent());
  }

  public boolean isRoomBadge() {
    return BadgeConfigTypeEnum.ROOM_BADGE.eq(getDetailType());
  }

}
