Skip to content

Commit d02f5e5

Browse files
feat: share application details (#2942)
1 parent d355e1e commit d02f5e5

File tree

42 files changed

+1420
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1420
-1
lines changed

cmp-navigation/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ kotlin {
3939
implementation(projects.feature.status)
4040
implementation(projects.feature.loanApplication)
4141
implementation(projects.feature.savingsApplication)
42+
implementation(projects.feature.shareApplication)
4243
// Core Modules
4344
implementation(projects.core.data)
4445
implementation(projects.core.common)

cmp-navigation/src/commonMain/kotlin/cmp/navigation/authenticated/AuthenticatedNavigation.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ import org.mifos.mobile.feature.savingsaccount.navigation.savingsNavGraph
5555
import org.mifos.mobile.feature.savingsaccount.savingsAccountDetails.navigateToSavingsAccountDetailsScreen
5656
import org.mifos.mobile.feature.settings.faq.faqDestination
5757
import org.mifos.mobile.feature.settings.faq.navigateToFaq
58+
import org.mifos.mobile.feature.share.application.navigation.navigateToShareApplicationGraph
59+
import org.mifos.mobile.feature.share.application.navigation.shareApplicationNavGraph
5860
import org.mifos.mobile.feature.status.navigation.StatusNavigationRoute
5961
import org.mifos.mobile.feature.status.navigation.statusDestination
6062
import org.mifos.mobile.feature.third.party.transfer.navigation.thirdPartyTransferNavGraph
@@ -113,6 +115,9 @@ internal fun NavGraphBuilder.authenticatedGraph(
113115

114116
is HomeNavigationDestination.ApplySavings ->
115117
navController.navigateToSavingsApplicationGraph()
118+
119+
is HomeNavigationDestination.ApplyShare ->
120+
navController.navigateToShareApplicationGraph()
116121
}
117122
}
118123

@@ -190,6 +195,10 @@ internal fun NavGraphBuilder.authenticatedGraph(
190195
navigateToAuthenticateScreen = navController::navigateToVerifyPasscodeScreen,
191196
)
192197

198+
shareApplicationNavGraph(
199+
navController = navController,
200+
)
201+
193202
passcodeDestination(
194203
onPasscodeConfirm = navController::popBackStack,
195204
)

cmp-navigation/src/commonMain/kotlin/cmp/navigation/di/KoinModules.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import org.mifos.mobile.feature.recent.transaction.di.recentTransactionModule
3535
import org.mifos.mobile.feature.savings.application.di.savingsApplicationModule
3636
import org.mifos.mobile.feature.savingsaccount.di.savingsAccountModule
3737
import org.mifos.mobile.feature.settings.di.SettingsModule
38+
import org.mifos.mobile.feature.share.application.di.shareApplicationModule
3839
import org.mifos.mobile.feature.shareaccount.di.shareAccountModule
3940
import org.mifos.mobile.feature.status.di.StatusModule
4041
import org.mifos.mobile.feature.third.party.transfer.di.ThirdPartyTransferModule
@@ -81,6 +82,7 @@ object KoinModules {
8182
StatusModule,
8283
loanApplicationModule,
8384
savingsApplicationModule,
85+
shareApplicationModule,
8486
)
8587
}
8688

core/common/src/commonMain/kotlin/org/mifos/mobile/core/common/Constants.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,5 @@ object Constants {
113113
const val NAVIGATE_BACK_TO_LOAN = "navigate_back_to_loan"
114114

115115
const val APPLY_SAVINGS = "apply_savings"
116+
const val APPLY_SHARE = "apply_share"
116117
}

core/data/src/commonMain/kotlin/org/mifos/mobile/core/data/di/RepositoryModule.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import org.mifos.mobile.core.data.repository.NotificationRepository
2424
import org.mifos.mobile.core.data.repository.RecentTransactionRepository
2525
import org.mifos.mobile.core.data.repository.ReviewLoanApplicationRepository
2626
import org.mifos.mobile.core.data.repository.SavingsAccountRepository
27+
import org.mifos.mobile.core.data.repository.ShareAccountRepository
2728
import org.mifos.mobile.core.data.repository.ThirdPartyTransferRepository
2829
import org.mifos.mobile.core.data.repository.TransferRepository
2930
import org.mifos.mobile.core.data.repository.UserAuthRepository
@@ -41,6 +42,7 @@ import org.mifos.mobile.core.data.repositoryImpl.NotificationRepositoryImp
4142
import org.mifos.mobile.core.data.repositoryImpl.RecentTransactionRepositoryImp
4243
import org.mifos.mobile.core.data.repositoryImpl.ReviewLoanApplicationRepositoryImpl
4344
import org.mifos.mobile.core.data.repositoryImpl.SavingsAccountRepositoryImp
45+
import org.mifos.mobile.core.data.repositoryImpl.ShareAccountRepositoryImp
4446
import org.mifos.mobile.core.data.repositoryImpl.ThirdPartyTransferRepositoryImp
4547
import org.mifos.mobile.core.data.repositoryImpl.TransferRepositoryImp
4648
import org.mifos.mobile.core.data.repositoryImpl.UserAuthRepositoryImp
@@ -70,6 +72,7 @@ val RepositoryModule = module {
7072
single<TransferRepository> { TransferRepositoryImp(get(), get(ioDispatcher)) }
7173
single<UserAuthRepository> { UserAuthRepositoryImp(get(), get(ioDispatcher)) }
7274
single<UserDetailRepository> { UserDetailRepositoryImp(get(), get(ioDispatcher)) }
75+
single<ShareAccountRepository> { ShareAccountRepositoryImp(get(), get(ioDispatcher)) }
7376
includes(platformModule)
7477
single<PlatformDependentDataModule> { getPlatformDataModule }
7578
single<NetworkMonitor> { getPlatformDataModule.networkMonitor }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright 2025 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
9+
*/
10+
package org.mifos.mobile.core.data.repository
11+
12+
import kotlinx.coroutines.flow.Flow
13+
import org.mifos.mobile.core.common.DataState
14+
import org.mifos.mobile.core.model.entity.Page
15+
import org.mifos.mobile.core.model.entity.templates.shareProduct.ShareDetails
16+
import org.mifos.mobile.core.model.entity.templates.shares.ShareProduct
17+
18+
interface ShareAccountRepository {
19+
20+
fun getShareProducts(clientId: Long?): Flow<DataState<Page<ShareProduct>>>
21+
22+
fun getShareProductById(productId: Long, clientId: String?): Flow<DataState<ShareDetails>>
23+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2025 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
9+
*/
10+
package org.mifos.mobile.core.data.repositoryImpl
11+
12+
import kotlinx.coroutines.CoroutineDispatcher
13+
import kotlinx.coroutines.flow.Flow
14+
import kotlinx.coroutines.flow.flowOn
15+
import org.mifos.mobile.core.common.DataState
16+
import org.mifos.mobile.core.common.asDataStateFlow
17+
import org.mifos.mobile.core.data.repository.ShareAccountRepository
18+
import org.mifos.mobile.core.model.entity.Page
19+
import org.mifos.mobile.core.model.entity.templates.shareProduct.ShareDetails
20+
import org.mifos.mobile.core.model.entity.templates.shares.ShareProduct
21+
import org.mifos.mobile.core.network.DataManager
22+
23+
class ShareAccountRepositoryImp(
24+
private val dataManager: DataManager,
25+
private val ioDispatcher: CoroutineDispatcher,
26+
) : ShareAccountRepository {
27+
28+
override fun getShareProducts(clientId: Long?): Flow<DataState<Page<ShareProduct>>> {
29+
return dataManager.shareAccountApi.getShareProducts(clientId)
30+
.asDataStateFlow().flowOn(ioDispatcher)
31+
}
32+
33+
override fun getShareProductById(
34+
productId: Long,
35+
clientId: String?,
36+
): Flow<DataState<ShareDetails>> {
37+
return dataManager.shareAccountApi.getShareProductById(productId, clientId)
38+
.asDataStateFlow().flowOn(ioDispatcher)
39+
}
40+
}

core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/icon/MifosIcons.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import fluent.ui.system.icons.filled.ChevronRight
6969
import fluent.ui.system.icons.filled.CoinMultiple
7070
import fluent.ui.system.icons.filled.ContactCardRibbon
7171
import fluent.ui.system.icons.filled.DarkTheme
72+
import fluent.ui.system.icons.filled.DataHistogram
7273
import fluent.ui.system.icons.filled.DataWhisker
7374
import fluent.ui.system.icons.filled.Delete
7475
import fluent.ui.system.icons.filled.Document
@@ -193,6 +194,7 @@ object MifosIcons {
193194
val ShareAccount = FluentIcons.Filled.DataWhisker
194195
val ApplyForLoan = FluentIcons.Filled.Receipt
195196
val ApplyForSavings = FluentIcons.Filled.Savings
197+
val ApplyForShare = FluentIcons.Filled.DataHistogram
196198
val TransactionHistory = FluentIcons.Filled.ChatHistory
197199
val Charges = FluentIcons.Filled.Feed
198200
val Beneficiary = FluentIcons.Filled.ContactCardRibbon
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright 2025 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
9+
*/
10+
package org.mifos.mobile.core.model.entity.templates.shareProduct
11+
12+
import kotlinx.serialization.Serializable
13+
import org.mifos.mobile.core.model.Parcelable
14+
import org.mifos.mobile.core.model.Parcelize
15+
16+
@Serializable
17+
@Parcelize
18+
data class AccountingMappings(
19+
val shareReferenceId: GlAccount? = null,
20+
val incomeFromFeeAccountId: GlAccount? = null,
21+
val shareEquityId: GlAccount? = null,
22+
val shareSuspenseId: GlAccount? = null,
23+
) : Parcelable
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2025 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
9+
*/
10+
package org.mifos.mobile.core.model.entity.templates.shareProduct
11+
12+
import kotlinx.serialization.Serializable
13+
import org.mifos.mobile.core.model.Parcelable
14+
import org.mifos.mobile.core.model.Parcelize
15+
16+
@Serializable
17+
@Parcelize
18+
data class AccountingRule(
19+
val id: Int? = null,
20+
val code: String? = null,
21+
val value: String? = null,
22+
) : Parcelable

0 commit comments

Comments
 (0)