-
Notifications
You must be signed in to change notification settings - Fork 698
feat(loan): add loan account general screen #2629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
amanna13
wants to merge
32
commits into
openMF:dev
Choose a base branch
from
amanna13:feat/general-tab-loan-section
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
c8529d6
feat: general tab screen for loan account
amanna13 2fc67ac
feat: general tab loan section
amanna13 835dc60
fix: minor changes in ui
amanna13 f558cc5
fix: resolved conflicts and navigation wiring
amanna13 aa92e0c
fix: changed text to camel case
amanna13 2f66d5d
fix: cleanup unused code
amanna13 5957603
fix: updated the currency formatter to use already available component
amanna13 3643e1d
fix: restructured use of DateHelper
amanna13 66ad3df
fix: refactor LoanAccountGeneralScreen to use when(state) for UI stat…
amanna13 387b2b5
fix: refactored certain use of variables
amanna13 8226ed8
fix: fixed table ui
amanna13 6620c66
fix: fixed static checks
amanna13 08757f3
fix: fixed addressed changes
amanna13 8ca66b3
fix: updated incorrect copyright docs
amanna13 b2b701d
fix: fixed changes requested
amanna13 b31cb6c
fix: fixed the unknown error throw
amanna13 668e71f
fix: changed route to use required arg with no default
amanna13 5d7c0dc
fix: use of specific error msg in viewmodel
amanna13 200730d
fix: changed continuous network monitoring to one-time only
amanna13 2400311
fix: fixed empty values in entity and structured loanWithAssociation
amanna13 6b25f3b
fix: used abstract mapper
amanna13 709f801
fix: replaced hardcoded principal waived
amanna13 e3f232a
fix: Network monitor moved to repository layer
amanna13 d6ed44d
fix: updated screen to use theme-aware dynamic colors
amanna13 a06cd12
fix: wrong mapping of proposedAmount
amanna13 7eda71d
fix: changed Map to use sealed interface
amanna13 4bf8325
fix: refactored to use helper function for currency formatter
amanna13 528d8a3
fix: fixed network monitor implementation
amanna13 bfe042b
fix: fixed license issues
amanna13 5e94fef
fix: license issues across files static checks failures
amanna13 5f1a1b8
fix : merge conflicts resolved
Kartikey15dem 92a8106
fix : dto and mappers added
Kartikey15dem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...data/src/commonMain/kotlin/com/mifos/core/data/repository/LoanAccountGeneralRepository.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| * 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.core.data.repository | ||
|
|
||
| import com.mifos.core.common.utils.DataState | ||
| import com.mifos.core.model.objects.account.loan.loanWithAssociations.LoanWithAssociations | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface LoanAccountGeneralRepository { | ||
|
|
||
| fun getLoanById(loanId: Int): Flow<DataState<LoanWithAssociations?>> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...rc/commonMain/kotlin/com/mifos/core/data/repositoryImp/LoanAccountGeneralRepositoryImp.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* | ||
| * 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.core.data.repositoryImp | ||
|
|
||
| import com.mifos.core.common.utils.DataState | ||
| import com.mifos.core.common.utils.asDataStateFlow | ||
| import com.mifos.core.data.repository.LoanAccountGeneralRepository | ||
| import com.mifos.core.data.util.NetworkMonitor | ||
| import com.mifos.core.data.util.withNetworkCheck | ||
| import com.mifos.core.model.objects.account.loan.loanWithAssociations.LoanWithAssociations | ||
| import com.mifos.core.network.datamanager.DataManagerLoan | ||
| import kotlinx.coroutines.CoroutineDispatcher | ||
| import kotlinx.coroutines.flow.Flow | ||
| import kotlinx.coroutines.flow.flowOn | ||
|
|
||
| class LoanAccountGeneralRepositoryImp( | ||
| private val dataManagerLoan: DataManagerLoan, | ||
| private val networkMonitor: NetworkMonitor, | ||
| private val ioDispatcher: CoroutineDispatcher, | ||
| ) : LoanAccountGeneralRepository { | ||
|
|
||
| override fun getLoanById(loanId: Int): Flow<DataState<LoanWithAssociations?>> { | ||
| return networkMonitor.withNetworkCheck( | ||
| dataManagerLoan.getLoanById(loanId) | ||
| .asDataStateFlow(), | ||
| ).flowOn(ioDispatcher) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation mixes concerns (network state handling, error mapping, and data fetching) and may lead to incorrect behavior (e.g.,
combinetriggering network calls even when offline). It would be better to align on the expected architecture and responsibilities first.I’d suggest discussing this approach with @niyajali on Slack before proceeding with further implementation.