package com.example.myapplication

import android.app.Application
import com.example.myapplication.database.AppDb
import com.example.myapplication.database.repository.OfflineCategoryRepository
import com.example.myapplication.database.repository.OfflineProductRepository

class MyApp : Application() {
    val db by lazy { AppDb.getInstance(this) }

    val productRepository: OfflineProductRepository by lazy {
        OfflineProductRepository(db.productDao())
    }

    val categoryRepository: OfflineCategoryRepository by lazy {
        OfflineCategoryRepository(db.categoryDao())
    }
}