package com.red.circle.console.app.dto.cmd.app.sys;

import com.red.circle.framework.core.dto.PageCommand;
import java.io.Serial;
import java.time.LocalDate;
import java.util.Objects;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @author houyong on 2020/05/27 10:10
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class GiftConsoleQryCmd extends PageCommand {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 礼物id.
   */
  private Long giftId;

  /**
   * 礼物名称.
   */
  private String giftName;

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

  /**
   * 礼物tab.
   */
  private String giftTab;

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

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

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

  /**
   * false:为删除、true：已删除
   */
  private Boolean del;

  /**
   * 排序方式.
   */
  private GiftConsoleSortType sortType;

  /**
   * 区域.
   */
  private String region;

  public boolean isCreateTimeDesc() {
    return Objects.equals(sortType, GiftConsoleSortType.CREATE_TIME_DESC);
  }

  public boolean isAmountDesc() {
    return Objects.equals(sortType, GiftConsoleSortType.AMOUNT_DESC);
  }

  public boolean isSortDesc() {
    return Objects.equals(sortType, GiftConsoleSortType.SORT_DESC);
  }

  public enum GiftConsoleSortType {
    CREATE_TIME_DESC, AMOUNT_DESC, SORT_DESC
  }
}
