package de.softwareapp_hb.privateqrscanner

import android.content.Context
import androidx.room.Room
import de.softwareapp_hb.privateqrscanner.data.local.CleanScannerDatabase
import de.softwareapp_hb.privateqrscanner.data.repository.ScanRepository
import de.softwareapp_hb.privateqrscanner.settings.SettingsRepository

class AppContainer(context: Context) {
    private val appContext = context.applicationContext

    private val db: CleanScannerDatabase by lazy {
        Room.databaseBuilder(appContext, CleanScannerDatabase::class.java, "clean_scanner.db").build()
    }

    val settingsRepository: SettingsRepository by lazy {
        SettingsRepository(appContext)
    }

    val scanRepository: ScanRepository by lazy {
        ScanRepository(db.scanDao(), settingsRepository)
    }
}
