package com.adealink.weparty.module.wallet.data

import com.adealink.frame.aab.util.getCompatString
import com.adealink.weparty.R


enum class Currency(val type: Int) {
    COIN(0),
    DIAMOND(1),
    BEAN(2);


    fun desc(): String {
        return when (this) {
            BEAN -> {
                getCompatString(R.string.common_bean)
            }

            COIN -> {
                getCompatString(R.string.common_coin)
            }

            DIAMOND -> {
                getCompatString(R.string.common_diamond)
            }
        }
    }

    companion object {
        @JvmStatic
        fun map(currency: Int?): Currency? {
            currency ?: return null
            return entries.find { it.type == currency }
        }
    }
}

enum class PayChannel(val value: String, val type: Int) {
    Google("default", 2);

    companion object {
        fun map(channel: String): PayChannel? {
            return entries.firstOrNull { it.value == channel }
        }

        fun map(type: Int): PayChannel? {
            return entries.firstOrNull { it.type == type }
        }
    }
}