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

import com.red.circle.framework.core.dto.PageCommand;
import com.red.circle.other.inner.enums.game.RedPacketEnum;
import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Objects;

import com.red.circle.tool.core.date.LocalDateTimeUtils;
import lombok.Data;

/**
 * <p>
 * 红包发送记录.
 * </p>
 *
 * @author pengshigang
 * @since 2021-6-10
 */
@Data
public class GameRedPacketBackQryCmd extends PageCommand {

  private static final long serialVersionUID = 1L;

  /**
   * 红包ID.
   */
  private Long id;

  /**
   * 系统平台.
   */
  private String sysOrigin;

  /**
   * 红包类型
   */
  private RedPacketEnum type;

  /**
   * 关联id.
   */
  private Long relationId;

  /**
   * 接受人ID.
   */
  private Long receiverId;

  /**
   * 开始时间.
   */
  private Long startCreateDate;

  /**
   * 结束时间.
   */
  private Long endCreateDate;

  /**
   * 最后一条记录ID.
   */
  private Long lastId;

  /**
   * 数量.
   */
  private Integer limit;

  public LocalDateTime startTimeToLocalDateTime() {
    return Objects.nonNull(startCreateDate) ? LocalDateTimeUtils.convert(startCreateDate) : null;
  }

  public LocalDateTime endTimeToLocalDateTime() {
    return Objects.nonNull(endCreateDate) ? LocalDateTimeUtils.convert(endCreateDate) : null;
  }
}
