package com.quyunshuo.module.home.enums

import com.quyunshuo.androidbaseframemvvm.base.addressenum.PayEnum
import com.quyunshuo.module.home.R

enum class PayNavEnum(val payType: Int, val code: String, val navId: Int) {
    TWO_CODE(PayEnum.TWO_CODE.nameId, PayEnum.TWO_CODE.code, R.id.home_qrcodefragment), BILL_COIN(
        PayEnum.TWO_CODE.nameId,
        PayEnum.BILL_COIN.code,
        R.id.home_billcoinfragment
    ),
    NAYAX(PayEnum.TWO_CODE.nameId, PayEnum.NAYAX.code, R.id.home_swipingcardfragment), MDB_NO_CASH(
        PayEnum.TWO_CODE.nameId,
        PayEnum.MDB_NO_CASH.code,
        R.id.home_mdbcardfragment
    ),
    FREE(PayEnum.TWO_CODE.nameId, PayEnum.FREE.code, R.id.home_freemakefragment);

    companion object {
        fun getEnumByValue(code: String): PayNavEnum {
            for (anEnum in PayNavEnum.values()) {
                if (anEnum.code == code) {
                    return anEnum
                }
            }
            return TWO_CODE
        }

    }
}