Repo created

This commit is contained in:
Fr4nz D13trich 2025-11-22 13:56:56 +01:00
parent 75dc487a7a
commit 39c29d175b
6317 changed files with 388324 additions and 2 deletions

View file

@ -0,0 +1,8 @@
plugins {
id(ThunderbirdPlugins.Library.jvm)
alias(libs.plugins.android.lint)
}
dependencies {
api(projects.feature.account.api)
}

View file

@ -0,0 +1,14 @@
package net.thunderbird.feature.account.core
import kotlinx.coroutines.flow.Flow
import net.thunderbird.feature.account.AccountId
import net.thunderbird.feature.account.profile.AccountProfile
interface AccountCoreExternalContract {
interface AccountProfileLocalDataSource {
fun getById(accountId: AccountId): Flow<AccountProfile?>
suspend fun update(accountProfile: AccountProfile)
}
}

View file

@ -0,0 +1,10 @@
package net.thunderbird.feature.account.core
import net.thunderbird.feature.account.core.data.DefaultAccountProfileRepository
import net.thunderbird.feature.account.profile.AccountProfileRepository
import org.koin.core.module.Module
import org.koin.dsl.module
val featureAccountCoreModule: Module = module {
single<AccountProfileRepository> { DefaultAccountProfileRepository(get()) }
}

View file

@ -0,0 +1,22 @@
package net.thunderbird.feature.account.core.data
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.distinctUntilChanged
import net.thunderbird.feature.account.AccountId
import net.thunderbird.feature.account.core.AccountCoreExternalContract.AccountProfileLocalDataSource
import net.thunderbird.feature.account.profile.AccountProfile
import net.thunderbird.feature.account.profile.AccountProfileRepository
class DefaultAccountProfileRepository(
private val localDataSource: AccountProfileLocalDataSource,
) : AccountProfileRepository {
override fun getById(accountId: AccountId): Flow<AccountProfile?> {
return localDataSource.getById(accountId)
.distinctUntilChanged()
}
override suspend fun update(accountProfile: AccountProfile) {
localDataSource.update(accountProfile)
}
}