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


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

/**
 * 用户相关code， 范围： 4000 ～ 4200 状态.
 *
 * @author pengliang on 2019/10/19 23:25
 */
@ResErrorCode(describe = "用户相关", minCode = 4000, maxCode = 4200)
public enum UserErrorCode implements IResponseErrorCode {


  /**
   * 用户未注册.
   */
  USER_NOT_REGISTERED(4000, "User not registered"),

  /**
   * 用户已注册.
   */
  USER_REGISTERED(4001, "User registered"),

  /**
   * 账号已关闭.
   */
  ACCOUNT_CLOSED(4003, "Account closed"),

  /**
   * 账号或密码错误.
   */
  ACCOUNT_OR_PASSWORD_NOT_MATCH(4004, "Incorrect username or password"),

  /**
   * 密码不可为空.
   */
  PASSWORD_NOT_EMPTY(4005, "Password cannot be empty"),

  /**
   * 不支持认证类型.
   */
  AUTH_TYPE_NOT_SUPPORTED(4006, "Authentication type not supported"),

  /**
   * 密码不符合规范.
   */
  PASSWORD_DOES_NOT_MEET_SPECIFICATIONS(4007, "Password does not meet specifications"),

  /**
   * 两次密码输入不匹配.
   */
  PASSWORD_TWO_INPUTS_DO_NOT_MATCH(4008, "Password twice input does not match"),

  /**
   * 没有找到用户信息.
   */
  USER_INFO_NOT_FOUND(4009, "User info not found"),

  /**
   * 用户手机号码不匹配.
   */
  USER_PHONE_NOT_MATCH(4010, "User's mobile number does not match"),

  /**
   * 账号封禁.
   */
  ACCOUNT_ARCHIVE(4011, "account archive"),

  /**
   * 账号冻结.
   */
  ACCOUNT_FREEZE(4012, "account freeze"),

  /**
   * 已注册.
   */
  SOURCE_REGISTERED(4013, "Source is registered"),

  /**
   * 注册黑名单.
   */
  REGISTER_BLACKLIST(4014, "Register blacklist"),

  /**
   * 注册用户性别为空.
   */
  REGISTER_USER_SEX_IS_NULL(4015, "Register user_sex is null"),

  /**
   * 注册失败.
   */
  REGISTRATION_FAILED(4016, "Registration failed"),

  /**
   * 财富等级不足30级.
   */
  INSUFFICIENT_LEVEL_30_ERROR(4017, "You can apply only if you have a wealth level of at least 30"),

  /**
   * 最少保留一个.
   */
  KEEP_AT_LEAST_ONE(4018, "Keep at least one"),

  /**
   * 已被使用.
   */
  ALREADY_USED(4019, "Already used"),

  /**
   * 不可操作自己.
   */
  NOT_OPERATION_ME(4020, "Can't operate yourself"),

  /**
   * 今日已处理.
   */
  PROCESSED_TODAY(4021, "Processed today"),

  /**
   * 当前任务未完成.
   */
  INCOMPLETE_TASK(4022, "Incomplete task"),

  /**
   * 已领取奖励.
   */
  AWARD_RECEIVED(4023, "Award received"),

  /**
   * 手机号码已注册.
   */
  MOBILE_REGISTERED(4024, "Mobile phone number has been registered"),

  /**
   * 密码不符合规则.
   */
  ACCOUNT_PASSWORD_NOT_COMPLY_WITH_RULES(4061, "Password does not comply with rules"),

  /**
   * 密码错误1次.
   */
  PASSWORD_NOT_MATCH_ONE(4057, "Incorrect  password"),

  /**
   * 密码错误2次.
   */
  PASSWORD_NOT_MATCH_TWO(4058, "Incorrect password"),

  /**
   * 密码错误3次以上.
   */
  PASSWORD_NOT_MATCH_THREE(4059, "Wrong password entered multiple times, please try again later"),

  /**
   * 账号错误.
   */
  ACCOUNT_NOT_MATCH(4060, "Incorrect account"),

  /**
   * 账号已注销或数据删除.
   */
  ACCOUNT_IS_DELETE(4061, "Application submitted"),

  /**
   * 手机绑定失败
   */
  MOBILE_BIND_ERROR(4062, "Mobile phone binding failure"),

  /**
   * 区号与手机号码已存在
   */
  UNABLE_BIND_ERROR(4063, "The area code and mobile number already exist"),

  /**
   * 账号已存在
   */
  ACCOUNT_DOES_EXIST(4064, "Account already exists"),

  /**
   * 用户已是经销商卖家身份
   */
  USER_IS_SELLER(4065, "The user is already the dealer seller identity"),

  /**
   * 用户被禁用
   */
  USER_IS_DISABLED(4066, "user was disabled"),

  /**
   * 实体账户正在使用
   */
  ENTITY_ACCOUNT_IS_IN_USE(4067, "The physical account is in use"),

  /**
   * 用户已拥有资源
   */
  USER_RESOURCES_ALREADY_EXISTS(4068, "The user already owns the resource"),
  /**
   * 区域不存在
   */
  SYS_REGION_NOT_EXIST_ERROR(4069, "Area does not exist"),

  /**
   * 编码已存在
   */
  CODE_ALREADY_EXISTS(4070, "Code exists"),

  /**
   * 区域未配置
   */
  SYS_REGION_NOT_CONFIGURED(4071, "Area not configured")

  //新增一个google登录失败
  ,GOOGLE_LOGIN_FAILED(4072, "Google login failed")

  //不在当前团队
  ,NOT_IN_TEAM(4073, "Not in team")

  // 密码不正确
  ,PASSWORD_NOT_MATCH(4074, "password is incorrect")

  // 用户已关注
  ,USER_FOLLOWED(4075, "This user has followed"),

  ;


  private final Integer code;
  private final String message;

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

}
