package com.tangem.features.feed.entry.components

import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.markets.PreselectedMarketsInterval
import com.tangem.domain.markets.PreselectedMarketsOrder
import com.tangem.domain.markets.PreselectedTokenDetailsSection
import com.tangem.domain.markets.TokenMarketParams
import com.tangem.domain.models.earn.PreselectedEarnType
import kotlinx.serialization.Serializable

@Serializable
sealed interface FeedEntryRoute {

    @Serializable
    data class MarketTokenDetails(
        val token: TokenMarketParams,
        val appCurrency: AppCurrency,
        val shouldShowPortfolio: Boolean,
        val analyticsParams: AnalyticsParams? = null,
        val preselectedSection: PreselectedTokenDetailsSection? = null,
        val shouldOpenExchanges: Boolean = false,
        val exchangesCount: Int? = null,
    ) : FeedEntryRoute {

        @Serializable
        data class AnalyticsParams(
            val blockchain: String?,
            val source: String,
        )
    }

    @Serializable
    data class MarketTokenList(
        val preselectedOrder: PreselectedMarketsOrder? = null,
        val preselectedInterval: PreselectedMarketsInterval? = null,
    ) : FeedEntryRoute

    @Serializable
    data class NewsDetail(val articleId: Int, val preselectedArticlesId: List<Int>) : FeedEntryRoute

    @Serializable
    data class NewsList(val preselectedCategoryId: Int? = null) : FeedEntryRoute

    @Serializable
    data class Earn(
        val preselectedEarnType: PreselectedEarnType? = null,
        val preselectedNetworkId: String? = null,
    ) : FeedEntryRoute
}