package com.red.circle.wallet.inner.error;


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

/**
 * 范围：5000 ～ 5200 钱包相关业务code.
 *
 * @author pengliang on 2019/10/19 23:25
 */
@ResErrorCode(describe = "钱包系相关", minCode = 5000, maxCode = 5200)
public enum WalletErrorCode implements IResponseErrorCode {

  /**
   * 余额不足.
   */
  INSUFFICIENT_BALANCE(5000, "balance not made"),

  /**
   * 错误的金额.
   */
  ERROR_AMOUNT(5001, "Amount error"),

  /**
   * 扣款失败.
   */
  DEDUCTION_FAILED(5002, "Deduction failed"),

  /**
   * 发货失败.
   */
  DELIVERY_FAILED(5003, "Delivery failed"),

  /**
   * 重复发货.
   */
  REPEAT_SHIPMENT(5004, "Repeat shipment"),

  /**
   * 初始化钱包锁.
   */
  INIT_WALLET_LOCK(5005, "Init wallet lock"),

  /**
   * 必须>0.
   */
  REQUIRED_GT_ZERO(5006, "Required be zero"),

  /**
   * 数值为空或小于零
   */
  NUMBER_VIOLATION_ERROR(5007, "The value is empty or less than zero"),

  /**
   * 用户工资不能重复导入
   */
  USER_SALARY_CANNOT_IMPORTED_REPEATEDLY(5008, "User salaries cannot be imported repeatedly"),

  /**
   * 支付密码输入次数已用完.
   */
  PAY_PASSWORD_EXHAUSTED(5009, "Password input count has been exhausted"),

  /**
   * 支付密码错误.
   */
  PAY_PASSWORD_ERROR(5010, "Password error"),

  /**
   * 已被设置.
   */
  PAY_PASSWORD_ALREADY_SET_UP(5011, "Already set up "),

  /**
   * 支付密码不符合规则.
   */
  PAY_PASSWORD_NOT_COMPLY_WITH_RULES(5012, "Password does not comply with rules"),

  /**
   * 目标用户不是充值代理
   */
  TARGET_USER_NOT_RECHARGE_AGENCY(5013, "The target user is not a recharge agency."),

  /**
   * 不能转账给自己
   */
  NOT_TRANSFER_YOURSELF(5014, "You can't transfer money to yourself."),
  ;


  private final Integer code;
  private final String message;

  WalletErrorCode(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();
  }

}
