package com.red.circle.other.inner.asserts.lottery;

import com.red.circle.framework.dto.IResponseErrorCode;
import com.red.circle.framework.dto.ResErrorCode;

/**
 * 抽奖活动错误码: 9700 ~ 9900
 *
 * @author system
 * @since 2025-10-18
 */
@ResErrorCode(describe = "抽奖活动Code", minCode = 9700, maxCode = 9900)
public enum LotteryErrorCode implements IResponseErrorCode {

  /**
   * 活动不存在.
   */
  ACTIVITY_NOT_FOUND(9701, "Activity does not exist"),

  /**
   * 活动编码已存在.
   */
  ACTIVITY_CODE_EXISTS(9702, "Activity code already exists"),

  /**
   * 活动未开始.
   */
  ACTIVITY_NOT_STARTED(9703, "Activity has not started yet"),

  /**
   * 活动已结束.
   */
  ACTIVITY_ENDED(9704, "Activity has ended"),

  /**
   * 活动已关闭.
   */
  ACTIVITY_CLOSED(9705, "Activity is closed"),

  /**
   * 不在活动时间内.
   */
  NOT_IN_ACTIVITY_TIME(9706, "Not within the activity time"),

  /**
   * 今日抽奖次数已用完.
   */
  DRAW_COUNT_EXHAUSTED(9707, "Today's lottery draw limit has been reached"),

  /**
   * 抽奖券不足.
   */
  INSUFFICIENT_TICKETS(9708, "Insufficient lottery tickets"),

  /**
   * 奖品不存在.
   */
  PRIZE_NOT_FOUND(9709, "Prize does not exist"),

  /**
   * 奖品库存不足.
   */
  PRIZE_STOCK_INSUFFICIENT(9710, "Prize stock is insufficient"),

  /**
   * 中奖记录不存在.
   */
  RECORD_NOT_FOUND(9711, "Lottery record does not exist"),

  /**
   * 未中奖.
   */
  NOT_WIN(9712, "Did not win a prize"),

  /**
   * 奖品已发放.
   */
  PRIZE_ALREADY_DELIVERED(9713, "Prize has already been delivered"),

  /**
   * 奖品发放失败.
   */
  PRIZE_DELIVERY_FAILED(9714, "Prize delivery failed"),

  /**
   * 抽奖券已失效.
   */
  TICKET_EXPIRED(9715, "Lottery ticket has expired"),

  /**
   * 抽奖券状态异常.
   */
  TICKET_STATUS_ABNORMAL(9716, "Lottery ticket status is abnormal"),

  /**
   * 用户抽奖券不足.
   */
  USER_TICKET_INSUFFICIENT(9717, "User has insufficient lottery tickets"),

  /**
   * 活动总库存不足.
   */
  ACTIVITY_STOCK_INSUFFICIENT(9718, "Activity total stock is insufficient"),

  /**
   * 奖品概率配置错误.
   */
  PRIZE_PROBABILITY_ERROR(9719, "Prize probability configuration error"),

  /**
   * 活动状态不允许修改.
   */
  ACTIVITY_STATUS_NOT_ALLOW_UPDATE(9720, "Activity status does not allow updates"),

  /**
   * 活动ID不能为空.
   */
  ACTIVITY_ID_REQUIRED(9721, "Activity ID is required"),

  /**
   * 奖品ID不能为空.
   */
  PRIZE_ID_REQUIRED(9722, "Prize ID is required"),

  /**
   * 记录编号不能为空.
   */
  RECORD_NO_REQUIRED(9723, "Record number is required"),

  /**
   * 用户ID不能为空.
   */
  USER_ID_REQUIRED(9724, "User ID is required"),

  /**
   * 发放数量必须大于0.
   */
  GRANT_COUNT_INVALID(9725, "Grant count must be greater than 0"),

  /**
   * 抽奖失败,请稍后重试.
   */
  DRAW_FAILED(9726, "Lottery draw failed, please try again later"),

  /**
   * 无可用奖品.
   */
  NO_AVAILABLE_PRIZE(9727, "No available prize"),

  /**
   * 奖品扣减库存失败.
   */
  PRIZE_DEDUCT_STOCK_FAILED(9728, "Failed to deduct prize stock"),

  /**
   * 用户抽奖次数更新失败.
   */
  USER_DRAW_COUNT_UPDATE_FAILED(9729, "Failed to update user draw count"),

  /**
   * 活动未启用连抽功能.
   */
  MULTI_DRAW_NOT_ENABLED(9730, "Multi-draw feature is not enabled for this activity"),

  /**
   * 没有可提现金额.
   */
  NO_WITHDRAWAL_AMOUNT(9731, "No withdrawal amount available"),

  /**
   * 可提现金额不足.
   */
  INSUFFICIENT_WITHDRAWAL_AMOUNT(9732, "Insufficient withdrawal amount"),

  /**
   * 提现金额不足10.
   */
  INSUFFICIENT_WITHDRAWAL_REQ_AMOUNT(9733, "The withdrawal amount must be greater than 10"),

  ;

  private final Integer code;
  private final String message;

  LotteryErrorCode(Integer code, String message) {
    this.code = code;
    this.message = message;
  }

  @Override
  public Integer getCode() {
    return this.code;
  }

  @Override
  public String getMessage() {
    return message;
  }

  @Override
  public String getErrorCodeName() {
    return this.name();
  }

}
