package com.bizzan.bitrade.constant;

import com.bizzan.bitrade.core.BaseEnum;
import com.fasterxml.jackson.annotation.JsonValue;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum TransactionType implements BaseEnum {
    /** 0 - 充值 */
    RECHARGE("充值"),
    /** 1 - 提现 */
    WITHDRAW("提现"),
    /** 2 - 转账 */
    TRANSFER_ACCOUNTS("转账"),
    /** 3 - 币币交易 */
    EXCHANGE("币币交易"),
    /** 4 - 法币买入 */
    OTC_BUY("法币买入"),
    /** 5 - 法币卖出 */
    OTC_SELL("法币卖出"),
    /** 6 - 签到奖励 */
    ACTIVITY_AWARD("签到奖励"),
    /** 7 - 推广奖励 */
    PROMOTION_AWARD("推广奖励"),
    /** 8 - 合约跟单奖励 */
    DIVIDEND("合约跟单奖励"),
    /** 9 - 投票 */
    VOTE("投票"),
    /** 10 - 人工充值 */
    ADMIN_RECHARGE("人工充值"),
    /** 11 - 配对 */
    MATCH("配对"),
    /** 12 - 交易奖励 */
    ACTIVITY_BUY("交易奖励"),
    /** 13 - CTC买入 */
    CTC_BUY("CTC买入"),
    /** 14 - CTC卖出 */
    CTC_SELL("CTC卖出"),
    /** 15 - 红包发出 */
    RED_OUT("红包发出"),
    /** 16 - 红包领取 */
    RED_IN("红包领取"),
    /** 17 - 提现码提现 */
    WITHDRAWCODE_OUT("提现码提现"),
    /** 18 - 提现码充值 */
    WITHDRAWCODE_IN("提现码充值"),
    /** 19 - 永续合约手续费 */
    CONTRACT_FEE("永续合约手续费"),
    /** 20 - 永续合约盈利 */
    CONTRACT_PROFIT("永续合约盈利"),
    /** 21 - 永续合约亏损 */
    CONTRACT_LOSS("永续合约亏损"),
    /** 22 - 期权合约失败 */
    OPTION_FAIL("期权合约失败"),
    /** 23 - 期权合约手续费 */
    OPTION_FEE("期权合约手续费"),
    /** 24 - 期权合约奖金 */
    OPTION_REWARD("期权合约奖金"),
    /** 25 - 合约返佣 */
    CONTRACT_AWARD("合约返佣"),
    /** 26 - 合约资金费率 */
    CONTRACT_OVERNIGHT_FEE("合约资金费率"),
    /** 27 - 永续合约爆仓 */
    CONTRACT_BLAST_FEE("永续合约爆仓"),
    /** 28 - 活动手续费 */
    GAME_FEE("活动手续费"),
    /** 29 - 活动盈利 */
    GAME_PROFIT("活动盈利"),
    /** 30 - 活动亏损 */
    GAME_LOSS("活动亏损"),
    /** 31 - 活动返佣 */
    GAME_AWARD("活动返佣"),
    /** 32 - 平级奖励 */
    LEVEL_AWARD("平级奖励"),
    /** 33 - 平台手续费收入 */
    PLATFORM_FEE_AWARD("平台手续费收入"),
    /** 34 - 秒合约失败 */
    SECOND_FAIL("秒合约失败"),
    /** 35 - 秒合约奖金 */
    SECOND_REWARD("秒合约奖金"),
    /** 36 - 理财利息 */
    FINANCE_REWARD("理财利息"),
    /** 37 - 合约跟单手续费 */
    FOLLOW_FEE("合约跟单手续费"),
    /** 38 - 合约跟单盈利 */
    FOLLOW_PROFIT("合约跟单盈利"),
    /** 39 - 合约跟单亏损 */
    FOLLOW_LOSS("合约跟单亏损"),
    /** 40 - 合约跟单分润 */
    FOLLOW_DIVIDEND("合约跟单分润"),
    /** 41 - 合约跟单返佣 */
    FOLLOW_AWARD("合约跟单返佣"),
    /** 42 - 跟单资金费率 */
    FOLLOW_OVERNIGHT_FEE("跟单资金费率"),
    /** 43 - 现货盈利 */
    SPOT_PROFIT("现货盈利"),
    /** 44 - 现货亏损 */
    SPOT_LOSS("现货亏损"),
    /** 45 - 现货手续费 */
    SPOT_FEE("现货手续费"),
    /** 46 - 现货返佣 */
    SPOT_AWARD("现货返佣"),
    /** 47 - 体验金提现 */
    EXPERIENCE_GIFT_WITHDRAW("体验金提现"),
    /** 48 - 现货交易 */
    SPOT("现货交易"),
    /** 49 - 质押（系统冻结，资金账户→质押锁定余额） */
    STAKING_IN("质押"),
    /** 50 - 质押到期解冻释放（锁定余额→质押可用余额） */
    STAKING_RELEASE("质押解冻释放"),
    /** 51 - 空投奖励（入账质押钱包可用余额） */
    AIRDROP_REWARD("空投奖励"),
    /** 52 - 用户主动划转：资金账户 → 质押钱包可用余额 */
    STAKING_DEPOSIT("划入质押钱包"),
    /** 53 - 用户主动划转：质押钱包可用余额 → 资金账户 */
    STAKING_WITHDRAW("质押钱包划出");

    private String cnName;
    @Override
    @JsonValue
    public int getOrdinal() {
        return this.ordinal();
    }

    public static TransactionType valueOfOrdinal(int ordinal){
        switch (ordinal){
            case 0:return RECHARGE;
            case 1:return WITHDRAW;
            case 2:return TRANSFER_ACCOUNTS;
            case 3:return EXCHANGE;
            case 4:return OTC_BUY;
            case 5:return OTC_SELL;
            case 6:return ACTIVITY_AWARD;
            case 7:return PROMOTION_AWARD;
            case 8:return DIVIDEND;
            case 9:return VOTE;
            case 10:return ADMIN_RECHARGE;
            case 11:return MATCH;
            case 12:return ACTIVITY_BUY;
            case 13:return CTC_BUY;
            case 14:return CTC_SELL;
            case 15:return RED_OUT;
            case 16:return RED_IN;
            case 17:return WITHDRAWCODE_OUT;
            case 18:return WITHDRAWCODE_IN;
            case 19:return CONTRACT_FEE;
            case 20:return CONTRACT_PROFIT;
            case 21:return CONTRACT_LOSS;
            case 22:return OPTION_FAIL;
            case 23:return OPTION_FEE;
            case 24:return OPTION_REWARD;
            case 25:return CONTRACT_AWARD;
            case 26:return CONTRACT_OVERNIGHT_FEE;
            case 27:return CONTRACT_BLAST_FEE;
            case 28:return GAME_FEE;
            case 29:return GAME_PROFIT;
            case 30:return GAME_LOSS;
            case 31:return GAME_AWARD;
            case 32:return LEVEL_AWARD;
            case 33:return PLATFORM_FEE_AWARD;
            case 34:return SECOND_FAIL;
            case 35:return SECOND_REWARD;
            case 36:return FINANCE_REWARD;
            case 37:return FOLLOW_FEE;
            case 38:return FOLLOW_PROFIT;
            case 39:return FOLLOW_LOSS;
            case 40:return FOLLOW_DIVIDEND;
            case 41:return FOLLOW_AWARD;
            case 42:return FOLLOW_OVERNIGHT_FEE;
            case 43:return SPOT_PROFIT;
            case 44:return SPOT_LOSS;
            case 45:return SPOT_FEE;
            case 46:return SPOT_AWARD;
            case 47:return EXPERIENCE_GIFT_WITHDRAW;
            case 48:return SPOT;
            case 49:return STAKING_IN;
            case 50:return STAKING_RELEASE;
            case 51:return AIRDROP_REWARD;
            case 52:return STAKING_DEPOSIT;
            case 53:return STAKING_WITHDRAW;
            default:return null;
        }
    }
    public static int parseOrdinal(TransactionType ordinal) {
        if (TransactionType.RECHARGE.equals(ordinal)) {
            return 0;
        } else if (TransactionType.WITHDRAW.equals(ordinal)) {
            return 1;
        } else if (TransactionType.TRANSFER_ACCOUNTS.equals(ordinal)) {
            return 2;
        } else if (TransactionType.EXCHANGE.equals(ordinal)) {
            return 3;
        } else if (TransactionType.OTC_BUY.equals(ordinal)) {
            return 4;
        } else if (TransactionType.OTC_SELL.equals(ordinal)) {
            return 5;
        } else if (TransactionType.ACTIVITY_AWARD.equals(ordinal)) {
            return 6;
        }else if (TransactionType.PROMOTION_AWARD.equals(ordinal)) {
            return 7;
        }else if (TransactionType.DIVIDEND.equals(ordinal)) {
            return 8;
        }else if (TransactionType.VOTE.equals(ordinal)) {
            return 9;
        }else if (TransactionType.ADMIN_RECHARGE.equals(ordinal)) {
            return 10;
        }else if (TransactionType.MATCH.equals(ordinal)) {
            return 11;
        }else if (TransactionType.ACTIVITY_BUY.equals(ordinal)) {
            return 12;
        }else if (TransactionType.CTC_BUY.equals(ordinal)) {
            return 13;
        }else if (TransactionType.CTC_SELL.equals(ordinal)) {
            return 14;
        }else if (TransactionType.RED_OUT.equals(ordinal)) {
            return 15;
        }else if (TransactionType.RED_IN.equals(ordinal)) {
            return 16;
        }else if (TransactionType.WITHDRAWCODE_OUT.equals(ordinal)){
            return 17;
        }else if (TransactionType.WITHDRAWCODE_IN.equals(ordinal)){
            return 18;
        }else if(TransactionType.CONTRACT_FEE.equals(ordinal)){
            return 19;
        }else if(TransactionType.CONTRACT_PROFIT.equals(ordinal)){
            return 20;
        }else if(TransactionType.CONTRACT_LOSS.equals(ordinal)){
            return 21;
        }else if(TransactionType.OPTION_FAIL.equals(ordinal)){
            return 22;
        }else if(TransactionType.OPTION_FEE.equals(ordinal)){
            return 23;
        }else if(TransactionType.OPTION_REWARD.equals(ordinal)){
            return 24;
        }else if(TransactionType.CONTRACT_AWARD.equals(ordinal)){
            return 25;
        }else if(TransactionType.CONTRACT_OVERNIGHT_FEE.equals(ordinal)){
            return 26;
        }else if(TransactionType.CONTRACT_BLAST_FEE.equals(ordinal)){
            return 27;
        }else if(TransactionType.GAME_FEE.equals(ordinal)){
            return 28;
        }else if(TransactionType.GAME_PROFIT.equals(ordinal)){
            return 29;
        }else if(TransactionType.GAME_LOSS.equals(ordinal)){
            return 30;
        }else if(TransactionType.GAME_AWARD.equals(ordinal)){
            return 31;
        }else if(TransactionType.LEVEL_AWARD.equals(ordinal)){
            return 32;
        }else if(TransactionType.PLATFORM_FEE_AWARD.equals(ordinal)){
            return 33;
        }else if(TransactionType.SECOND_FAIL.equals(ordinal)){
            return 34;
        }else if(TransactionType.SECOND_REWARD.equals(ordinal)){
            return 35;
        }else if(TransactionType.FINANCE_REWARD.equals(ordinal)){
            return 36;
        }else if(TransactionType.FOLLOW_FEE.equals(ordinal)){
            return 37;
        }else if(TransactionType.FOLLOW_PROFIT.equals(ordinal)){
            return 38;
        }else if(TransactionType.FOLLOW_LOSS.equals(ordinal)){
            return 39;
        }else if(TransactionType.FOLLOW_DIVIDEND.equals(ordinal)){
            return 40;
        }else if(TransactionType.FOLLOW_AWARD.equals(ordinal)){
            return 41;
        }else if(TransactionType.FOLLOW_OVERNIGHT_FEE.equals(ordinal)){
            return 42;
        }else if(TransactionType.SPOT_PROFIT.equals(ordinal)){
            return 43;
        }else if(TransactionType.SPOT_LOSS.equals(ordinal)){
            return 44;
        }else if(TransactionType.SPOT_FEE.equals(ordinal)){
            return 45;
        }else if(TransactionType.SPOT_AWARD.equals(ordinal)){
            return 46;
        }else if(TransactionType.EXPERIENCE_GIFT_WITHDRAW.equals(ordinal)){
            return 47;
        }else if(TransactionType.SPOT.equals(ordinal)){
            return 48;
        }else if(TransactionType.STAKING_IN.equals(ordinal)){
            return 49;
        }else if(TransactionType.STAKING_RELEASE.equals(ordinal)){
            return 50;
        }else if(TransactionType.AIRDROP_REWARD.equals(ordinal)){
            return 51;
        }else if(TransactionType.STAKING_DEPOSIT.equals(ordinal)){
            return 52;
        }else if(TransactionType.STAKING_WITHDRAW.equals(ordinal)){
            return 53;
        }else {
            return -1;
        }
    }

}
