-
Notifications
You must be signed in to change notification settings - Fork 658
implemented terms page of fixed deposit accounts Feature #2543
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
25 changes: 17 additions & 8 deletions
25
...ata/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/FixedDepositRepositoryImpl.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 |
|---|---|---|
| @@ -1,20 +1,29 @@ | ||
| /* | ||
| * Copyright 2024 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 | ||
| */ | ||
| 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.FixedDepositRepository | ||
| import com.mifos.core.network.datamanager.DataManagerFixedDeposit | ||
| import com.mifos.core.network.model.FixedDepositTemplate | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| class FixedDepositRepositoryImpl (private val dataManagerFixedDeposit: DataManagerFixedDeposit): FixedDepositRepository{ | ||
| class FixedDepositRepositoryImpl(private val dataManagerFixedDeposit: DataManagerFixedDeposit) : | ||
| FixedDepositRepository { | ||
|
|
||
| override fun getFixedDepositTemplate(clientId: Int,productId: Int?): Flow<DataState<FixedDepositTemplate>> { | ||
| return dataManagerFixedDeposit.getFixedDepositTemplate(clientId,productId).asDataStateFlow() | ||
| override fun getFixedDepositTemplate( | ||
| clientId: Int, | ||
| productId: Int?, | ||
| ): Flow<DataState<FixedDepositTemplate>> { | ||
| return dataManagerFixedDeposit.getFixedDepositTemplate(clientId, productId) | ||
| .asDataStateFlow() | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| } |
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
18 changes: 13 additions & 5 deletions
18
...twork/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerFixedDeposit.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 |
|---|---|---|
| @@ -1,12 +1,20 @@ | ||
| /* | ||
| * 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 | ||
| */ | ||
| package com.mifos.core.network.datamanager | ||
|
|
||
| import com.mifos.core.network.BaseApiManager | ||
| import com.mifos.core.network.model.FixedDepositTemplate | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| class DataManagerFixedDeposit (private val baseApiManager: BaseApiManager){ | ||
| class DataManagerFixedDeposit(private val baseApiManager: BaseApiManager) { | ||
|
|
||
| fun getFixedDepositTemplate(clientId:Int,productId: Int?): Flow<FixedDepositTemplate> = | ||
| baseApiManager.fixedDepositService.fixedDepositProductTemplate(clientId,productId) | ||
|
|
||
| } | ||
| fun getFixedDepositTemplate(clientId: Int, productId: Int?): Flow<FixedDepositTemplate> = | ||
| baseApiManager.fixedDepositService.fixedDepositProductTemplate(clientId, productId) | ||
| } |
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
39 changes: 35 additions & 4 deletions
39
core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositTemplate.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 |
|---|---|---|
| @@ -1,24 +1,55 @@ | ||
| /* | ||
| * 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 | ||
| */ | ||
| package com.mifos.core.network.model | ||
|
|
||
| import com.mifos.core.model.objects.account.saving.FieldOfficerOptions | ||
| import com.mifos.core.model.utils.IgnoredOnParcel | ||
| import com.mifos.core.model.objects.template.recurring.Currency | ||
| import com.mifos.core.model.objects.template.recurring.interest.InterestCalculationDaysInYearTypeOption | ||
| import com.mifos.core.model.objects.template.recurring.interest.InterestCalculationTypeOption | ||
| import com.mifos.core.model.objects.template.recurring.interest.InterestCompoundingPeriodTypeOption | ||
| import com.mifos.core.model.objects.template.recurring.interest.InterestPostingPeriodTypeOption | ||
| import com.mifos.core.model.objects.template.recurring.period.PeriodFrequencyTypeOption | ||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
|
|
||
|
|
||
| @Serializable | ||
| data class FixedDepositTemplate( | ||
|
|
||
| @SerialName("clientId") | ||
| val clientId: Int? = null, | ||
|
|
||
| @SerialName(value = "clientName") | ||
| val clientName: String? = null, | ||
|
|
||
| @SerialName(value = "currency") | ||
| val currency: Currency? = null, | ||
|
|
||
| @SerialName("productOptions") | ||
| val productOptions: List<FixedDepositProductOption>? = null, | ||
|
|
||
| @SerialName("fieldOfficerOptions") | ||
| val fieldOfficerOptions: List<FieldOfficerOptions>? = null, | ||
|
|
||
| ) | ||
| @SerialName("periodFrequencyTypeOptions") | ||
| val periodFrequencyTypeOptions: List<PeriodFrequencyTypeOption>? = null, | ||
|
|
||
| @SerialName("interestCompoundingPeriodTypeOptions") | ||
| val interestCompoundingPeriodTypeOptions: List<InterestCompoundingPeriodTypeOption>? = null, | ||
|
|
||
| @SerialName("interestPostingPeriodTypeOptions") | ||
| val interestPostingPeriodTypeOptions: List<InterestPostingPeriodTypeOption>? = null, | ||
|
|
||
| @SerialName("interestCalculationDaysInYearTypeOptions") | ||
| val interestCalculationDaysInYearTypeOptions: List<InterestCalculationDaysInYearTypeOption>? = null, | ||
|
|
||
| @SerialName("interestCalculationTypeOptions") | ||
| val interestCalculationTypeOptions: List<InterestCalculationTypeOption>? = null, | ||
|
|
||
| ) |
23 changes: 11 additions & 12 deletions
23
core/network/src/commonMain/kotlin/com/mifos/core/network/services/FixedDepositService.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 |
|---|---|---|
| @@ -1,26 +1,25 @@ | ||
| /* | ||
| * 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 | ||
| */ | ||
| package com.mifos.core.network.services | ||
|
|
||
| import com.mifos.core.network.model.FixedDepositTemplate | ||
| import com.mifos.room.basemodel.APIEndPoint | ||
| import de.jensklingenberg.ktorfit.http.Query | ||
| import de.jensklingenberg.ktorfit.http.GET | ||
| import de.jensklingenberg.ktorfit.http.Query | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| interface FixedDepositService { | ||
|
|
||
| @GET( APIEndPoint.FIXED_DEPOSIT + "/template") | ||
| @GET(APIEndPoint.FIXED_DEPOSIT + "/template") | ||
| fun fixedDepositProductTemplate( | ||
| @Query("clientId") clientId: Int, | ||
| @Query("productId") productId: Int?, | ||
| ): Flow<FixedDepositTemplate> | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
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.
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.
🧩 Analysis chain
Route rename and typed navigation look correct; verify
onFinishbehaviorThe route rename to
CreateFixedDepositAccountRouteand usage incomposable<CreateFixedDepositAccountRoute>plus thenavigateToCreateFixedDepositRoutehelper are consistent and type-safe.One thing to double‑check:
onFinish = {}means the screen won’t trigger any navigation on completion. If the UX is supposed to move to account details or back to the client screen after creating the fixed deposit, you may want to wire a real navigation callback here.Naming nit (optional): for consistency you might consider renaming
navigateToCreateFixedDepositRoutetonavigateToCreateFixedDepositAccountRoute.Also applies to: 22-30, 32-35
🏁 Script executed:
Length of output: 6921
🏁 Script executed:
Length of output: 1116
Data class naming violates Kotlin conventions; review comment shows intended but unapplied fix
The review comment displays
CreateFixedDepositAccountRoute(PascalCase) as the "final state," but the actual code defines the data class ascreateFixedDepositAccountRoute(camelCase). Kotlin conventions require data classes to use PascalCase. The code needs to be updated:createFixedDepositAccountRoutetoCreateFixedDepositAccountRoutecomposable<CreateFixedDepositAccountRoute>CreateFixedDepositAccountRoute(clientId=clientId)The
onFinish = {}(no-op) and navigation wiring are as expected. The helper functionnavigateToCreateFixedDepositRouteis correctly imported and used inClientNavigation.kt.🤖 Prompt for AI Agents