package com.adealink.weparty.module.wallet

import androidx.lifecycle.ViewModelStoreOwner
import com.adealink.frame.aab.BaseDynamicModule
import com.adealink.weparty.R
import com.adealink.weparty.module.wallet.viewmodel.IWalletViewModel

object WalletModule : BaseDynamicModule<IWalletService>(IWalletService::class),
    IWalletService {

    override val featureName: String
        get() = "wallet"

    override val moduleNameResId: Int
        get() = R.string.module_wallet

    override fun emptyService(): IWalletService {
        return object : IWalletService {

            override fun getService(): IWalletService? {
                return null
            }

            override fun logout() {

            }

            override fun getWalletViewModel(owner: ViewModelStoreOwner): IWalletViewModel? {
                return null
            }
        }
    }


    override fun getWalletViewModel(owner: ViewModelStoreOwner): IWalletViewModel? {
        return getService().getWalletViewModel(owner)
    }

    override fun logout() {
        getService().logout()
    }
}