package com.red.circle.other.app.dto.cmd.task;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.other.inner.enums.config.EnumConfigKey;
import com.red.circle.other.inner.enums.config.TaskRewardTypeEnum;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 每日任务事件.
 *
 * @author pengliang on 2020/11/27
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class DailyTasksEventCmd extends AppExtCommand {

  /**
   * 事件.
   *
   * @eo.required
   */
  @NotNull(message = "event required.")
  private EnumConfigKey event;

  /**
   * 奖励类型.
   */
  private TaskRewardTypeEnum rewardType;

  public String getEventName() {
    return Objects.toString(event);
  }

  public String getRewardTypeName() {
    return Objects.isNull(rewardType) ? null : rewardType.name();
  }

}
