package moe.lava.neon.core.di

import moe.lava.neon.api.ApiClient
import moe.lava.neon.api.gateway.GatewayHandler
import moe.lava.neon.core.AppSettings
import moe.lava.neon.core.data.guild.GuildGatewayDataSource
import moe.lava.neon.core.repository.AuthRepository
import moe.lava.neon.core.repository.CaptchaRepository
import moe.lava.neon.core.repository.GatewayRepository
import moe.lava.neon.core.repository.GuildRepository
import moe.lava.neon.core.repository.UserRepository
import org.koin.core.module.dsl.createdAtStart
import org.koin.core.module.dsl.withOptions
import org.koin.dsl.module
import org.koin.plugin.module.dsl.single

val coreModule = module {
    factory { ApiClient() }
    single<AppSettings>()
    single<GatewayHandler>()

    single<GuildGatewayDataSource>()

    single<AuthRepository>()
    single<CaptchaRepository>()
    single<GatewayRepository>()
    single<GuildRepository>() withOptions { createdAtStart() }
    single<UserRepository>()
}
