Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
package com.mifos.core.data.di

import com.mifos.core.common.network.MifosDispatchers
import com.mifos.core.data.datasource.SearchRecordLocalDataSource
import com.mifos.core.data.datasource.SearchRecordLocalDataSourceImpl
import com.mifos.core.data.activate.ActivateRepository
import com.mifos.core.data.activate.impl.ActivateRepositoryImpl
import com.mifos.core.data.searchrecord.SearchRecordRepository
import com.mifos.core.data.searchrecord.impl.SearchRecordRepositoryImpl
import com.mifos.core.data.searchrecord.local.SearchRecordLocalDataSource
import com.mifos.core.data.searchrecord.local.SearchRecordLocalDataSourceImpl
import com.mifos.core.data.repository.AmountTransferRepository
import com.mifos.core.data.repository.AppLockRepository
import com.mifos.core.data.repository.CenterDetailsRepository
Expand Down Expand Up @@ -67,7 +69,6 @@ import com.mifos.core.data.repository.SavingsAccountRepository
import com.mifos.core.data.repository.SavingsAccountSummaryRepository
import com.mifos.core.data.repository.SavingsAccountTransactionReceiptRepository
import com.mifos.core.data.repository.SavingsAccountTransactionRepository
import com.mifos.core.data.repository.SearchRecordRepository
import com.mifos.core.data.search.SearchRepository
import com.mifos.core.data.search.impl.SearchRepositoryImpl
import com.mifos.core.data.repository.ShareAccountRepository
Expand Down Expand Up @@ -136,7 +137,6 @@ import com.mifos.core.data.repositoryImp.SavingsAccountRepositoryImp
import com.mifos.core.data.repositoryImp.SavingsAccountSummaryRepositoryImp
import com.mifos.core.data.repositoryImp.SavingsAccountTransactionReceiptRepositoryImpl
import com.mifos.core.data.repositoryImp.SavingsAccountTransactionRepositoryImp
import com.mifos.core.data.repositoryImp.SearchRecordRepositoryImpl
import com.mifos.core.data.repositoryImp.ShareAccountRepositoryImpl
import com.mifos.core.data.repositoryImp.SignatureRepositoryImp
import com.mifos.core.data.repositoryImp.SurveyListRepositoryImp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* See https://github.com/openMF/mifos-x-field-officer-app/blob/master/LICENSE.md
*/
package com.mifos.core.data.repository
package com.mifos.core.data.searchrecord

import com.mifos.core.model.objects.searchrecord.GenericSearchRecord
import com.mifos.core.model.objects.searchrecord.RecordType
Expand All @@ -17,5 +17,5 @@ interface SearchRecordRepository {
fun searchRecords(
recordType: RecordType,
query: String,
): Flow<Result<List<GenericSearchRecord>>>
): Flow<List<GenericSearchRecord>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@
*
* See https://github.com/openMF/mifos-x-field-officer-app/blob/master/LICENSE.md
*/
package com.mifos.core.data.repositoryImp
package com.mifos.core.data.searchrecord.impl

import com.mifos.core.data.datasource.SearchRecordLocalDataSource
import com.mifos.core.data.repository.SearchRecordRepository
import com.mifos.core.data.searchrecord.SearchRecordRepository
import com.mifos.core.data.searchrecord.local.SearchRecordLocalDataSource
import com.mifos.core.model.objects.searchrecord.GenericSearchRecord
import com.mifos.core.model.objects.searchrecord.RecordType
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.map

class SearchRecordRepositoryImpl(
private val localDataSource: SearchRecordLocalDataSource,
Expand All @@ -25,11 +22,5 @@ class SearchRecordRepositoryImpl(
override fun searchRecords(
recordType: RecordType,
query: String,
): Flow<Result<List<GenericSearchRecord>>> =
localDataSource.searchRecords(recordType, query)
.map { Result.success(it) }
.catch { e ->
if (e is CancellationException) throw e
emit(Result.failure(e))
}
): Flow<List<GenericSearchRecord>> = localDataSource.searchRecords(recordType, query)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* See https://github.com/openMF/mifos-x-field-officer-app/blob/master/LICENSE.md
*/
package com.mifos.core.data.datasource
package com.mifos.core.data.searchrecord.local

import com.mifos.core.model.objects.searchrecord.GenericSearchRecord
import com.mifos.core.model.objects.searchrecord.RecordType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* See https://github.com/openMF/mifos-x-field-officer-app/blob/master/LICENSE.md
*/
package com.mifos.core.data.datasource
package com.mifos.core.data.searchrecord.local

import com.mifos.core.common.utils.Constants
import com.mifos.core.model.objects.searchrecord.GenericSearchRecord
Expand Down
5 changes: 2 additions & 3 deletions feature/search-record/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ kotlin {
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(compose.ui)
implementation(projects.core.common)
implementation(projects.core.domain)
implementation(projects.core.model)
implementation(projects.core.data)
implementation(projects.core.ui)
implementation(libs.kotlinx.serialization.json)
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
package com.mifos.feature.searchrecord.di

import com.mifos.feature.searchrecord.SearchRecordViewModel
import com.mifos.feature.searchrecord.ui.SearchRecordViewModel
import org.koin.core.module.dsl.viewModelOf
import org.koin.dsl.module

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025 Mifos Initiative
* Copyright 2026 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -13,13 +13,7 @@ import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import com.mifos.core.model.objects.searchrecord.GenericSearchRecord
import com.mifos.feature.searchrecord.SearchRecordScreen
import kotlinx.serialization.Serializable

@Serializable
data class SearchRecordRoute(
val type: String,
)
import com.mifos.feature.searchrecord.ui.SearchRecordScreen

fun NavGraphBuilder.searchRecordNavigation(
onBackClick: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2026 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mifos-x-field-officer-app/blob/master/LICENSE.md
*/
package com.mifos.feature.searchrecord.navigation

import kotlinx.serialization.Serializable

@Serializable
data class SearchRecordRoute(
val type: String,
)
Loading
Loading