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

import com.red.circle.framework.dto.Command;
import com.red.circle.framework.dto.PageQuery;
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
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class GiftQryCmd extends Command {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 查询条件.
   */
  private PageQuery pageQuery;

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

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

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

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

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

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

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

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

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

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

  public boolean checkCreateTimeDesc() {
    return Objects.equals(sortType, SortType.CREATE_TIME_DESC);
  }

  public boolean checkAmountDesc() {
    return Objects.equals(sortType, SortType.AMOUNT_DESC);
  }

  public boolean checkSortDesc() {
    return Objects.equals(sortType, SortType.SORT_DESC);
  }

 public enum SortType {
    CREATE_TIME_DESC, AMOUNT_DESC, SORT_DESC
  }
}
