diff --git a/core/data/src/commonMain/kotlin/com/mifos/core/data/repository/ClientDetailsRepository.kt b/core/data/src/commonMain/kotlin/com/mifos/core/data/repository/ClientDetailsRepository.kt index fb44b9eeb5f..1d6fb8725b9 100644 --- a/core/data/src/commonMain/kotlin/com/mifos/core/data/repository/ClientDetailsRepository.kt +++ b/core/data/src/commonMain/kotlin/com/mifos/core/data/repository/ClientDetailsRepository.kt @@ -39,7 +39,7 @@ interface ClientDetailsRepository { suspend fun getClientCloseTemplate(): DataState - suspend fun getCollateralItems(): DataState> + suspend fun getCollateralItems(clientId: Int): DataState> suspend fun getClient(clientId: Int): ClientEntity @@ -69,4 +69,6 @@ interface ClientDetailsRepository { collateralId: Int, quantity: String, ): DataState + + } diff --git a/core/data/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/ClientDetailsRepositoryImp.kt b/core/data/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/ClientDetailsRepositoryImp.kt index 775245e9e92..e84b95ef45b 100644 --- a/core/data/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/ClientDetailsRepositoryImp.kt +++ b/core/data/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/ClientDetailsRepositoryImp.kt @@ -63,7 +63,7 @@ class ClientDetailsRepositoryImp( } } - override suspend fun getCollateralItems(): DataState> { + override suspend fun getCollateralItems(clientId: Int): DataState> { return try { val res = dataManagerClient.getCollateralItems() return DataState.Success(res) @@ -201,4 +201,4 @@ class ClientDetailsRepositoryImp( DataState.Error(e) } } -} +} \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/mifos/core/network/model/CollateralItem.kt b/core/network/src/commonMain/kotlin/com/mifos/core/network/model/CollateralItem.kt index a7515f5000f..d35b46b9223 100644 --- a/core/network/src/commonMain/kotlin/com/mifos/core/network/model/CollateralItem.kt +++ b/core/network/src/commonMain/kotlin/com/mifos/core/network/model/CollateralItem.kt @@ -1,3 +1,14 @@ +/* + * Copyright 2025 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/android-client/blob/master/LICENSE.md + */ + + /* * Copyright 2025 Mifos Initiative * @@ -20,4 +31,4 @@ data class CollateralItem( val currency: String, val name: String, val id: Int, -) +) \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosActionsListingCardComponent.kt b/core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosActionsListingCardComponent.kt index 281a9466d01..64a39a75251 100644 --- a/core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosActionsListingCardComponent.kt +++ b/core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosActionsListingCardComponent.kt @@ -9,6 +9,7 @@ */ package com.mifos.core.ui.components + import androidclient.core.ui.generated.resources.Res import androidclient.core.ui.generated.resources.client_share_accounts_approved_shares import androidclient.core.ui.generated.resources.client_share_accounts_pending_for_approval_shares @@ -500,6 +501,88 @@ fun MifosActionsShareListingComponent( } } } +@Composable +fun MifosActionsCollateralDataComponent( + name: String, + quantity: String, + totalValue: String, + totalCollateralValue: String, + menuList: List, + onActionClicked: (Actions) -> Unit, +) { + MifosActionsListingComponentOutline { + Column { + Column( + modifier = Modifier.padding(DesignToken.padding.large), + ) { + MifosListingRowItem( + key = "Name", + value = name, + keyStyle = MifosTypography.titleSmallEmphasized, + valueStyle = MifosTypography.titleSmall, + ) + Spacer(Modifier.height(DesignToken.padding.large)) + Column( + verticalArrangement = Arrangement.spacedBy(DesignToken.padding.extraExtraSmall), + ) { + MifosListingRowItem( + key = stringResource(Res.string.core_ui_quantity), + value = quantity, + ) + MifosListingRowItem( + key = stringResource(Res.string.core_ui_total_value), + value = totalValue, + ) + } + Spacer(Modifier.height(DesignToken.padding.medium)) + MifosListingRowItem( + key = stringResource(Res.string.core_ui_total_collateral_value), + value = totalCollateralValue, + valueColor = MaterialTheme.colorScheme.primary, + ) + } + + Surface( + modifier = Modifier.fillMaxWidth(), + shape = RoundedCornerShape( + bottomStart = DesignToken.padding.medium, + bottomEnd = DesignToken.padding.medium, + ), + ) { + Column( + modifier = Modifier.padding( + vertical = DesignToken.padding.small, + ), + ) { + menuList.map { menuItem -> + Row( + modifier = Modifier.fillMaxWidth() + .height(DesignToken.sizes.avatarMedium) + .clickable { + onActionClicked(menuItem) + }, + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start, + ) { + Icon( + modifier = Modifier.padding(horizontal = DesignToken.padding.large), + imageVector = menuItem.icon, + contentDescription = "", + ) + + Text( + modifier = Modifier.fillMaxWidth(), + text = menuItem::class.simpleName ?: "", + color = MaterialTheme.colorScheme.onSurface, + fontSize = MaterialTheme.typography.bodyLarge.fontSize, + ) + } + } + } + } + } + } +} @Composable fun MifosActionsChargeListingComponent( @@ -724,6 +807,7 @@ fun MifosActionsSavingsListingComponent( } } + @Composable fun MifosActionsClientFeeListingComponent( name: String, @@ -1136,3 +1220,26 @@ private fun PreviewMifosActionsShareListingComponent() { ) } } +@Preview +@Composable +private fun PreviewMifosActionsCollateralDataComponent() { + MifosTheme { + MifosActionsCollateralDataComponent( + name = "Gold ", + quantity = "5", + totalValue = "$2500", + totalCollateralValue = "$2500", + menuList = listOf( + Actions.ViewAccount(), + Actions.ApproveAccount(), + ), + onActionClicked = { action -> + when (action) { + is Actions.ViewAccount -> println(Actions.ViewDocument::class.simpleName) + is Actions.ApproveAccount -> println(Actions.ApproveAccount::class.simpleName) + else -> println("Action not Handled") + } + }, + ) + } +} diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientCollateral/ClientCollateralViewModel.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientCollateral/ClientCollateralViewModel.kt index 0b614d7b897..7c2b1e1565e 100644 --- a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientCollateral/ClientCollateralViewModel.kt +++ b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientCollateral/ClientCollateralViewModel.kt @@ -17,7 +17,9 @@ import com.mifos.core.data.repository.ClientDetailsRepository import com.mifos.core.data.util.NetworkMonitor import com.mifos.core.network.model.CollateralItem import com.mifos.core.ui.components.ResultStatus + import com.mifos.core.ui.util.BaseViewModel + import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch @@ -43,29 +45,28 @@ internal class ClientCollateralViewModel( } private suspend fun loadCollaterals() { - mutableStateFlow.update { it.copy(dialogState = ClientCollateralState.DialogState.Loading) } val result = repo.getCollateralItems() - when (result) { - is DataState.Error -> { - mutableStateFlow.update { - it.copy( - dialogState = ClientCollateralState.DialogState.Error( - result.message, - ), - ) - } - } - is DataState.Success -> { - mutableStateFlow.update { - it.copy( - collaterals = result.data, - dialogState = null, - ) - } - } - else -> Unit + when (result) { + is DataState.Error -> { + mutableStateFlow.update { + it.copy( + dialogState = ClientCollateralState.DialogState.Error( + result.message, + ), + ) } } + is DataState.Success -> { + mutableStateFlow.update { + it.copy( + collaterals = result.data, + dialogState = null, + ) + } + } + else -> Unit + } + } private suspend fun saveCollateral() { mutableStateFlow.update { it.copy(dialogState = ClientCollateralState.DialogState.Loading) } diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientGeneral/ClientProfileGeneralNavigation.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientGeneral/ClientProfileGeneralNavigation.kt index 3fe0f6b75d0..d445bfe21c4 100644 --- a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientGeneral/ClientProfileGeneralNavigation.kt +++ b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientGeneral/ClientProfileGeneralNavigation.kt @@ -28,6 +28,7 @@ fun NavGraphBuilder.clientProfileGeneralDestination( fixedDepositAccounts: (Int) -> Unit, recurringDepositAccounts: (Int) -> Unit, sharesAccounts: (Int) -> Unit, + collateralData: (Int) -> Unit, ) { composable { @@ -42,6 +43,7 @@ fun NavGraphBuilder.clientProfileGeneralDestination( sharesAccounts, collateralData, + ) } } diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataNavigation.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataNavigation.kt new file mode 100644 index 00000000000..ab3eb346626 --- /dev/null +++ b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataNavigation.kt @@ -0,0 +1,36 @@ +package com.mifos.feature.client.collateralData + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable + + +import kotlinx.serialization.Serializable + +@Serializable +data class ClientCollateralRoute( + val clientId : Int = -1, +) +fun NavGraphBuilder.clientCollateralDestination( + navController: NavController, + navigateToViewAccount: (Int) -> Unit, +) { + composable { + CollateralScreenRoute( + navController = navController, + viewAccount = navigateToViewAccount, + ) + } + +} +fun NavController.navigateCollateralScreen( + clientId : Int, +){ + this.navigate( + ClientCollateralRoute( + clientId = clientId, + ) + + + ) +} \ No newline at end of file diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataScreen.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataScreen.kt new file mode 100644 index 00000000000..e18a244b838 --- /dev/null +++ b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataScreen.kt @@ -0,0 +1,206 @@ +package com.mifos.feature.client.collateralData + + + + + + + + +import androidclient.feature.client.generated.resources.Res +import androidclient.feature.client.generated.resources.string_not_available + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import androidx.navigation.NavController + +import com.mifos.core.designsystem.component.MifosScaffold +import com.mifos.core.designsystem.component.MifosSweetError +import com.mifos.core.designsystem.icon.MifosIcons +import com.mifos.core.designsystem.theme.DesignToken +import com.mifos.core.designsystem.theme.MifosTypography +import com.mifos.core.designsystem.utils.onClick +import com.mifos.core.ui.components.Actions +import com.mifos.core.ui.components.MifosActionsCollateralDataListingComponent + +import com.mifos.core.ui.components.MifosBreadcrumbNavBar +import com.mifos.core.ui.components.MifosEmptyCard +import com.mifos.core.ui.components.MifosProgressIndicator +import com.mifos.core.ui.util.EventsEffect + +import org.jetbrains.compose.resources.stringResource +import org.koin.compose.viewmodel.koinViewModel + + + +@Composable +internal fun CollateralScreenRoute( + navController: NavController, + viewAccount: (Int) -> Unit, + viewModel: ClientCollateralViewmodel = koinViewModel(), +) { + val state by viewModel.stateFlow.collectAsStateWithLifecycle() + + EventsEffect(viewModel.eventFlow) { event -> + when (event) { + is CollateralEvent.ViewAccount -> viewAccount(event.accountsId) + } + } + + CollateralScreen( + state = state, + navController = navController, + onAction = remember(viewModel) { { viewModel.trySendAction(it) } }, + ) + + CollateralDialog( + state = state, + onAction = remember(viewModel) { { viewModel.trySendAction(it) } }, + ) +} + +@Composable +internal fun CollateralScreen( + navController: NavController, + state: CollateralUiState, + onAction: (CollateralAction) -> Unit, +) { + MifosScaffold( + title = "Collateral data", + onBackPressed = {}, + ) { paddingValues -> + Column( + modifier = Modifier.padding(paddingValues) + .fillMaxSize(), + ) { + MifosBreadcrumbNavBar( + navController = navController, + ) + + when (state.isLoading) { + true -> MifosProgressIndicator() + + false -> { + Column( + modifier = Modifier.fillMaxSize() + .padding(horizontal = DesignToken.padding.large), + ) { + CollateralHeader( + totalItem = state.accounts.size.toString(), + onAction = onAction, + ) + + Spacer(modifier = Modifier.height(DesignToken.padding.large)) + + if (state.accounts.isNotEmpty()) { + val emptyText = stringResource(Res.string.string_not_available) + + LazyColumn { + item { + state.accounts.forEachIndexed { index, account -> + MifosActionsCollateralDataListingComponent( + name = account.name ?: emptyText, + quantity = account.quantity?.toString() ?: emptyText, + totalValue = account.total?.toString() ?: emptyText, + totalCollateralValue = account.totalCollateral?.toString() ?: emptyText, + menuList = (listOf(Actions.ViewAccount())), + onActionClicked = { actions -> + when (actions) { + is Actions.ViewAccount -> { + onAction( + CollateralAction.ViewAccount(accountId = -1) + ) + } + + else -> { + + } + } + + } + + + ) + + Spacer(Modifier.height(DesignToken.padding.small)) + } + } + } + } else { + MifosEmptyCard() + } + } + } + } + } + } +} + +@Composable +private fun CollateralHeader( + totalItem: String, + onAction: (CollateralAction) -> Unit, +) { + Row( + modifier = Modifier.fillMaxWidth(), + ) { + Column { + Text( + text = "Collateral Data", + style = MifosTypography.titleMedium + ) + + Text( + text = totalItem + " " + "items", + style = MifosTypography.labelMedium, + ) + + } + + Spacer(modifier = Modifier.weight(1f)) + + // add a cross icon when its active, talk with design team + Icon( + modifier = Modifier.onClick { onAction.invoke(CollateralAction.ToggleSearchBar) }, + imageVector = MifosIcons.Search , + + contentDescription = null, + ) + + Icon( + modifier = Modifier.onClick { onAction.invoke(CollateralAction.ToggleFiler) }, + imageVector = MifosIcons.Filter, + contentDescription = null, + ) + } +} + +@Composable +private fun CollateralDialog( + state: CollateralUiState, + onAction: (CollateralAction) -> Unit, +) { + when (state.dialogState) { + is CollateralUiState.DialogState.Error -> { + MifosSweetError( + message = state.dialogState.message, + onclick = { onAction.invoke(CollateralAction.Refresh) }, + ) + } + + null -> {} + } +} \ No newline at end of file diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataViewModel.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataViewModel.kt new file mode 100644 index 00000000000..e3ac73dcd8c --- /dev/null +++ b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/collateralData/CollateralDataViewModel.kt @@ -0,0 +1,154 @@ +package com.mifos.feature.client.collateralData + + +import androidx.lifecycle.SavedStateHandle +import androidx.lifecycle.viewModelScope +import androidx.navigation.toRoute +import com.mifos.core.common.utils.DataState +import com.mifos.core.data.repository.ClientDetailsRepository +import com.mifos.core.ui.util.BaseViewModel + +import com.mifos.core.network.model.CollateralItem + + +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch + + +class ClientCollateralViewmodel ( + savedStateHandle: SavedStateHandle, + private val repository: ClientDetailsRepository +): BaseViewModel( + initialState = CollateralUiState() +){ + private val route = savedStateHandle.toRoute() + override fun handleAction(action: CollateralAction) { + when (action) { + is CollateralAction.CardClicked -> handleCardClicked(action.activeIndex) + CollateralAction.ToggleFiler -> toggleFiler() + CollateralAction.ToggleSearchBar -> toggleSearchBar() + is CollateralAction.ViewAccount -> sendEvent(CollateralEvent.ViewAccount(action.accountId)) + CollateralAction.Refresh -> fetchAllCollateralAccount() + + } + + } + init{ + fetchAllCollateralAccount() + } + private fun fetchAllCollateralAccount(){ + viewModelScope.launch { + mutableStateFlow.update{ + it.copy( + isLoading = true, + ) + + } + try{ + val result = repository.getCollateralItems() + + when(result){ + is DataState.Success -> { + mutableStateFlow.update { + it.copy( + isLoading = false, + accounts = result.data, + dialogState = null + ) + } + + } + is DataState.Error -> { + mutableStateFlow.update { + it.copy( + isLoading = false, + dialogState = CollateralUiState.DialogState.Error(result.message) + ) + } + } + is DataState.Loading -> { + mutableStateFlow.update { + it.copy( + isLoading = true + ) + } + + + } + + + } + + + + }catch(e : Exception){ + mutableStateFlow.update{ + it.copy( + isLoading = false, + dialogState = CollateralUiState.DialogState.Error(e.message ?: "Unknown Error") + ) + } + } + } + + } + private fun toggleFiler() { + mutableStateFlow.update { + it.copy( + isFilterActive = !state.isFilterActive, + ) + } + + + } + private fun toggleSearchBar() { + mutableStateFlow.update { + it.copy( + isSearchBarActive = !it.isSearchBarActive, + ) + } + + } + private fun handleCardClicked(index : Int){ + mutableStateFlow.update { + it.copy( + isCardActive = !it.isCardActive, + currentlyActiveIndex = index, + ) + } + + } + + +} + +data class CollateralUiState( + val isLoading : Boolean = false, + val isFilterActive : Boolean = false, + val accounts : List = emptyList(), + val isSearchBarActive :Boolean = false, + val isCardActive : Boolean = false, + val currentlyActiveIndex: Int = -1, + val dialogState : DialogState? = null,){ + + sealed interface DialogState{ + data class Error (val message : String) : DialogState + } + + + + +} +sealed interface CollateralEvent{ + data class ViewAccount ( val accountsId : Int) : CollateralEvent + +} +sealed interface CollateralAction{ + data object ToggleFiler : CollateralAction + data object ToggleSearchBar : CollateralAction + data class CardClicked (val activeIndex : Int ): CollateralAction + data class ViewAccount (val accountId : Int) : CollateralAction + data object Refresh : CollateralAction + + +} diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt index b2e068670f7..0fcf6245fb5 100644 --- a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt +++ b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt @@ -60,6 +60,8 @@ import com.mifos.feature.client.clientUpcomingCharges.navigateToClientUpcomingCh import com.mifos.feature.client.clientUpdateDefaultAccount.navigateToUpdateDefaultAccountRoute import com.mifos.feature.client.clientUpdateDefaultAccount.updateDefaultAccountDestination import com.mifos.feature.client.clientsList.ClientListScreen +import com.mifos.feature.client.collateralData.clientCollateralDestination +import com.mifos.feature.client.collateralData.navigateCollateralScreen import com.mifos.feature.client.createNewClient.CreateNewClientScreen import com.mifos.feature.client.fixedDepositAccount.clientFixedDepositAccountDestination import com.mifos.feature.client.fixedDepositAccount.navigateToFixedDepositAccountRoute @@ -175,6 +177,7 @@ fun NavGraphBuilder.clientNavGraph( recurringDepositAccounts = navController::navigateToRecurringDepositAccountRoute, collateralData = {}, sharesAccounts = navController::navigateToShareAccountsScreen, + collateralDatadates = navController::navigateCollateralScreen, fixedDepositAccounts = navController::navigateToFixedDepositAccountRoute, upcomingCharges = navController::navigateToClientUpcomingChargesRoute, ) @@ -215,6 +218,7 @@ fun NavGraphBuilder.clientNavGraph( onNavigateNext = navController::navigateToClientDetailsProfileRouteOnStatus, navController = navController, ) + clientStaffDestination( onNavigateBack = navController::popBackStack, onNavigateNext = navController::navigateToClientDetailsProfileRouteOnStatus, @@ -272,6 +276,10 @@ fun NavGraphBuilder.clientNavGraph( navController = navController, navigateToViewAccount = {}, ) + clientCollateralDestination( + navController = navController, + navigateToViewAccount = {}, + ) } } diff --git a/feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ViewClientCollateralsRoute.kt b/feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ViewClientCollateralsRoute.kt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/loanAccountSummary/LoanAccountSummaryScreenRoute.kt b/feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/loanAccountSummary/LoanAccountSummaryScreenRoute.kt index 52d7757445a..9668469d396 100644 --- a/feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/loanAccountSummary/LoanAccountSummaryScreenRoute.kt +++ b/feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/loanAccountSummary/LoanAccountSummaryScreenRoute.kt @@ -34,7 +34,8 @@ fun NavGraphBuilder.loanAccountSummary( approveLoan: (loadId: Int, loanWithAssociations: LoanWithAssociationsEntity) -> Unit, disburseLoan: (Int) -> Unit, onRepaymentClick: (LoanWithAssociationsEntity) -> Unit, -) { + + ) { composable { LoanAccountSummaryScreen( navigateBack = onBackPressed, @@ -46,6 +47,7 @@ fun NavGraphBuilder.loanAccountSummary( approveLoan = approveLoan, disburseLoan = disburseLoan, onRepaymentClick = onRepaymentClick, + ) } } diff --git a/feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/NewLoanAccountViewModel.kt b/feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/NewLoanAccountViewModel.kt index d7b6a0cc143..ac419b633c1 100644 --- a/feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/NewLoanAccountViewModel.kt +++ b/feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/newLoanAccount/NewLoanAccountViewModel.kt @@ -613,7 +613,7 @@ internal class NewLoanAccountViewModel( } private suspend fun loadCollaterals() { - val result = repo.getCollateralItems() + val result = repo.getCollateralItems(clientId = state.clientId) when (result) { is DataState.Error -> {} is DataState.Success -> { @@ -760,7 +760,7 @@ constructor( val showChargesDatePick: Boolean = false, val chargeAmount: String = "", -) { + ) { sealed interface DialogState { data class Error(val message: String) : DialogState data object AddNewCollateral : DialogState @@ -868,4 +868,4 @@ data class CreatedCharges( val type: String?, val amount: Double? = 0.0, val collectedOn: String = "", -) +) \ No newline at end of file diff --git a/feature/savings/build.gradle.kts b/feature/savings/build.gradle.kts index 53f95809bf9..ef98964520c 100644 --- a/feature/savings/build.gradle.kts +++ b/feature/savings/build.gradle.kts @@ -25,6 +25,7 @@ kotlin{ implementation(compose.components.uiToolingPreview) implementation(compose.ui) implementation(libs.kotlinx.serialization.json) + } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b778d1faffc..cc1afe31830 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] accompanistPermission = "0.34.0" androidDesugarJdkLibs = "2.1.4" -androidGradlePlugin = "8.7.3" +androidGradlePlugin = "8.12.2" androidTools = "31.8.0" androidxActivity = "1.10.0" androidxAppCompat = "1.7.0" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dda119f6159..f8d3446b552 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Feb 02 11:29:16 IST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file