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

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

/**
 * 范围：2500 ~ 2900.
 *
 * @author pengliang on 2023/6/6
 */
@ResErrorCode(describe = "家族相关", minCode = 2500, maxCode = 2600)
public enum FamilyErrorCode implements IResponseErrorCode {

  /**
   * 已有家族,无法新建.
   */
  FAMILY_EXISTENCE(2500, "You already have a family and cannot be created"),

  /**
   * 没有达到创建家族的条件.
   */
  NOT_QUALIFIED_CREATE_FAMILY(2501, "Does not meet the conditions for creating a family"),

  /**
   * 创始人不能退出家族.
   */
  FOUNDER_NOT_ALLOWED_EXIT_FAMILY(2502, "Family founders cannot withdraw"),

  /**
   * 没有家族信息，核对失败.
   */
  NOT_EXIST_FAMILY_INFO_DATA(2503, "No family information, verification failed"),

  /**
   * 家族满员，无法加入.
   */
  FAMILY_MEMBER_MAX(2504, "Family members have reached, unable to join new members"),

  /**
   * 已存在家族，无法加入.
   */
  THERE_ARE_FAMILIES_ERROR(2505, "Family already exists, unable to join"),

  /**
   * 家族拒绝用户加入.
   */
  FAMILY_REFUSE_JOIN(2506, "The family has rejected your application to join"),

  /**
   * 不能重复申请.
   */
  REPEAT_APPLICATION(2507, "Do not apply repeatedly, please wait patiently for the result"),

  /**
   * 单据已过期.
   */
  NOT_FOUND_REWARD(2508, "Couldn't find the family reward"),

  /**
   * 家族管理员满员，无法授权.
   */
  FAMILY_MANAGE_MAX(2509, "The administrator is full, unable to add an administrator"),

  /**
   * 族长不能被移除
   */
  ADMIN_DEL_ERROR(2510, "The patriarch cannot be removed"),

  /**
   * 规则最多三条
   */
  UP_TO_THREE_RULES(2511, "Three rules at most"),

  NOT_PERMISSION_VIEW(2512, "You do not have permission to view"),

  /**
   * 用户最近刚退出家族
   */
  USER_RECENT_LEAVE(2513, "Your recently left a family. Please try again 1 day after leaving"),

  /**
   * 家族承运不存在
   */
  USER_NOT_FOUND(2514, "There are no member of this family"),

  /**
   * 宝箱未解锁
   */
  BOX_NOT_UNLOCKED(2515, "The treasure box has not been unlocked yet"),

  /**
   * 宝箱已领取
   */
  BOX_ALREADY_CLAIMED(2516, "You have already claimed this treasure box"),

  /**
   * 只有族长才能解散家族
   */
  ONLY_ADMIN_CAN_DISBAND_FAMILY(2517, "Only the patriarch can disband the family"),

  /**
   * 用户已加入家族
   */
  USER_JOINED_FAMILY(2518, "The user has joined the family"),

  ;


  private final int code;
  private final String message;

  FamilyErrorCode(int code, String message) {
    this.code = code;
    this.message = message;
  }

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

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

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

}
