package com.red.circle.common.business.enums;

import java.util.Objects;

/**
 * 钻石来源.
 *
 * @author pengliang on 2020/5/31
 */
public enum DiamondOrigin {

  /**
   * 活动奖励.
   */
  ACTIVITY_REWARD("Activity reward"),

  /**
   * 房间扶持奖励.
   */
  ROOM_SUPPORT_REWARD("Room support reward"),

  /**
   * 房间扶持奖励 - 房主奖励.
   */
  ROOM_HOMEOWNER_SUPPORT_REWARD("Room support reward Homeowner"),

  /**
   * cp奖励.
   */
  CP_REWARD("CP Reward"),

  /**
   * 爆水晶游戏.
   */
  GAME_BURST_CRYSTAL("Game burst crystal"),

  /**
   * 房间奖励.
   */
  ROOM_REWARD("Room reward"),

  /**
   * 周星.
   */
  WEEK_STAR("Week Star"),

  /**
   * 邀请新用户注册奖励.
   */
  INVITED_NEW_USER_REWARD("Invited new user reward"),

  /**
   * 邀请用户首次充值奖励.
   */
  INVITED_USER_FIRST_RECHARGE_REWARD("Invited user first recharge reward"),

  /**
   * 邀请用户注册 (invite register).
   */
  INVITE_REGISTER("invite register"),

  /**
   * 邀请的用户首次充值.
   */
  INVITE_FIRST_RECHARGE("Invited user first recharge"),

  /**
   * 邀请用户每笔充值奖励百分比.
   */
  INVITED_USER_EACH_RECHARGE("Invited user each recharge"),

  /**
   * 购买贵族vip.
   */
  PURCHASE_NOBLE_VIP("Purchase aristocratic VIP"),

  /**
   * 购买赠送贵族vip-钻石.
   */
  PURCHASE_NOBLE_VIP_GIVEAWAY("Purchase aristocratic VIP,Give away"),

  /**
   * 购买赠送贵族vip-钻石.
   */
  GIVEAWAY_GOLD_NOBLE_VIP("[gold]Giveaway aristocratic VIP"),

  /**
   * 购买头像框-钻石.
   */
  PURCHASING_AVATAR_FRAME("Purchasing props avatar frame"),

  /**
   * 购买资料卡-钻石.
   */
  PURCHASING_DATA_CARD("Purchasing data card"),

  /**
   * 购买聊天气泡-钻石.
   */
  PURCHASING_CHAT_BUBBLE("Purchasing props chat bubble"),

  /**
   * 购买车辆-钻石.
   */
  PURCHASING_CAR("Purchasing props car"),

  /**
   * 购买装扮-钻石.
   */
  PURCHASING_LAYOUT("Purchasing props layout"),

  /**
   * 赠送头像框-钻石.
   */
  PURCHASING_AVATAR_FRAME_GIVEAWAY("Purchasing props avatar frame,Give away "),

  /**
   * 购买资料卡-钻石.
   */
  PURCHASING_DATA_CARD_GIVEAWAY("Purchasing data card,Give away"),

  /**
   * 赠送聊天气泡-钻石.
   */
  PURCHASING_CHAT_BUBBLE_GIVEAWAY("Purchasing props chat bubble,Give away "),

  /**
   * 购买主题-钻石.
   */
  PURCHASING_THEME("Purchasing props themes"),

  /**
   * 赠送主题-钻石.
   */
  PURCHASING_THEME_GIVEAWAY("Give away Prop theme"),

  /**
   * 赠送车辆.
   */
  PURCHASING_CAR_GIVEAWAY("Purchasing props car,Give away"),

  /**
   * 赠送装扮.
   */
  PURCHASING_LAYOUT_GIVEAWAY("Purchasing props layout,Give away"),

  /**
   * 兑换积分.
   */
  EXCHANGE("Exchange"),

  /**
   * 赠送礼物.
   */
  GIVE_GIFT("Give a gift"),

  /**
   * 接收礼物.
   */
  ACCEPT_GIFT("Accept gift"),

  /**
   * 补给.
   */
  COMPENSATE("Compensate"),

  /**
   * 违规扣除.
   */
  REMOVE("Violation"),

  /**
   * 国王王后king
   */
  WEEK_USER_CONSUME("King reward"),

  /**
   * 砖石兑换金币.
   */
  DIAMOND_EXCHANGE_GOLD("Exchange"),

  /**
   * 直播积分.
   */
  LIVE_BROADCAST_INTEGRAL("Live broadcast points"),

  /**
   * 每日任务.
   */
  DAILY_TASK("Daily task"),

  /**
   * 钻石打卡.
   */
  CHECK_IN_DIAMOND("Check in diamond"),

  /**
   * 累计充值奖励.
   */
  CUMULATIVE_RECHARGE_REWARDS("Cumulative recharge rewards"),

  /**
   * 官方赠送.
   */
  OFFICIAL_GIFT("OFFICIAL_GIFT"),

  /**
   * 过期.
   */
  EXPIRED("Expired"),

  /**
   * 系统误发
   */
  SYSTEM_MISREPRESENTED("[System] System misrepresented"),

  /**
   * 激活宠物.
   */
  ACTIVATE_PET("Activate pet"),

  /**
   * 宠物奖励.
   */
  PET_REWARD("Pet reward"),

  /**
   * 宠物转盘抽奖.
   */
  PET_TURNTABLE_LOTTERY("Pet Turntable Lottery"),

  /**
   * 砸金蛋.
   */
  EGG("Smash the golden egg"),

  /**
   * 每周国王.
   */
  WEEK_KING("Week King"),

  /**
   * 每周王后.
   */
  WEEK_QUEEN("Week Queen"),

  /**
   * 游戏王奖励.
   */
  GAME_KING_AWARD("Game King Award"),

  /**
   * 每周cp奖励
   */
  WEEK_CP_GIFT("Week CP Gift"),

  /**
   * 每日签到抽奖
   */
  DAILY_REGISTER("Daily sign-in raffle"),

  /**
   * 邀请用户奖励
   */
  INVITE_USER_REWARDS("Invite User Rewards"),

  /**
   * 每周游戏任务奖励.
   */
  WEEKLY_GAME_TASKS("Weekly game tasks"),

  /**
   * 每周最佳特殊关系奖励.
   */
  ACTIVITY_FRIENDSHIP_CARD_REWARDS("Best Special Relationship Award"),

  /**
   * 收款单据.
   */
  COLLECTION_RECEIPT("Collection receipt"),

  /**
   * 主播代理系统奖励.
   */
  HOST_AGENT_SYSTEM_REWARD("Rewards for the host agent system"),

  /**
   * 政策奖励.
   */
  POLICY_REWARDS("Policy rewards"),

  /**
   * 接受幸运礼物.
   */
  ACCEPT_LUCKY_GIFTS("Accept Lucky Gifts"),

  /**
   * 购买红包皮肤-钻石.
   */
  PURCHASING_RED_PACKET("Purchasing props red envelope cover"),

  /**
   * 赠送红包皮肤-钻石.
   */
  PURCHASING_RED_PACKET_GIVEAWAY("Purchasing props red envelope cover,Give away "),

  /**
   * 邀请用户红包抽奖.
   */
  INVITE_USER_RED_PACKET_LOTTERY("Invite users to draw red envelopes"),


  /**
   * 后台奖励钻石
   */
  REWARD_DIAMOND("Reward diamonds"),

  /**
   * 后台扣除钻石
   */
  DEDUCT_DIAMOND("Deduct diamonds"),

  /**
   * lottery 奖励
   */
  LOTTERY_REWARD("Lottery Diamonds Rewards"),
  ;


  private final String desc;

  DiamondOrigin(String desc) {
    this.desc = desc;
  }

  public static boolean isSysTeamOperation(String key) {
    try {
      DiamondOrigin originGroupEnum = DiamondOrigin.valueOf(key);
      return Objects.equals(originGroupEnum, REMOVE)
          || Objects.equals(originGroupEnum, COMPENSATE);
    } catch (Exception ignore) {
      // ingore
    }
    return false;
  }

  public static String getDesc(String name) {
    try {
      return DiamondOrigin.valueOf(name).getDesc();
    } catch (Exception ex) {
      // ingore
    }
    return "";
  }

  public String getDesc() {
    return desc;
  }
}
