package com.prodhack.moscow2025.common.di

import android.content.Context
import androidx.room.Room
import com.prodhack.moscow2025.data.data_providers.local_db.AppDatabase
import org.koin.core.annotation.ComponentScan
import org.koin.core.annotation.Module
import org.koin.core.annotation.Single

@Module
@ComponentScan("com.prodhack.moscow2025.presentation")
class AppModule

@Module
@ComponentScan("com.prodhack.moscow2025.domain")
class DomainModule

@Module
@ComponentScan("com.prodhack.moscow2025.data")
class DataModule{
	@Single
	fun provideDatabase(context: Context): AppDatabase =
		Room.databaseBuilder(
			context,
			AppDatabase::class.java,
			"t_tasks.db"
		).fallbackToDestructiveMigration()
			.build()
}
