Skip to content

Commit 4a904b1

Browse files
shashank-0-0shashank-0-0
andauthored
implemented terms page of fixed deposit accounts Feature (#2543)
Co-authored-by: shashank-0-0 <ss068467@gmail.com>
1 parent f22b0d4 commit 4a904b1

File tree

16 files changed

+399
-93
lines changed

16 files changed

+399
-93
lines changed
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
* Copyright 2024 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/android-client/blob/master/LICENSE.md
9+
*/
110
package com.mifos.core.data.repository
211

312
import com.mifos.core.common.utils.DataState
@@ -7,8 +16,6 @@ import kotlinx.coroutines.flow.Flow
716
interface FixedDepositRepository {
817
fun getFixedDepositTemplate(
918
clientId: Int,
10-
productId: Int?
19+
productId: Int?,
1120
): Flow<DataState<FixedDepositTemplate>>
12-
13-
14-
}
21+
}
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1+
/*
2+
* Copyright 2024 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/android-client/blob/master/LICENSE.md
9+
*/
110
package com.mifos.core.data.repositoryImp
211

3-
412
import com.mifos.core.common.utils.DataState
513
import com.mifos.core.common.utils.asDataStateFlow
614
import com.mifos.core.data.repository.FixedDepositRepository
715
import com.mifos.core.network.datamanager.DataManagerFixedDeposit
816
import com.mifos.core.network.model.FixedDepositTemplate
917
import kotlinx.coroutines.flow.Flow
1018

11-
class FixedDepositRepositoryImpl (private val dataManagerFixedDeposit: DataManagerFixedDeposit): FixedDepositRepository{
19+
class FixedDepositRepositoryImpl(private val dataManagerFixedDeposit: DataManagerFixedDeposit) :
20+
FixedDepositRepository {
1221

13-
override fun getFixedDepositTemplate(clientId: Int,productId: Int?): Flow<DataState<FixedDepositTemplate>> {
14-
return dataManagerFixedDeposit.getFixedDepositTemplate(clientId,productId).asDataStateFlow()
22+
override fun getFixedDepositTemplate(
23+
clientId: Int,
24+
productId: Int?,
25+
): Flow<DataState<FixedDepositTemplate>> {
26+
return dataManagerFixedDeposit.getFixedDepositTemplate(clientId, productId)
27+
.asDataStateFlow()
1528
}
16-
17-
18-
19-
2029
}

core/database/src/commonMain/kotlin/com/mifos/room/basemodel/APIEndPoint.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ object APIEndPoint {
4242
const val MAKER_CHECKER = "makercheckers"
4343
const val SHARE = "share"
4444

45-
const val FIXED_DEPOSIT ="fixeddepositaccounts"
45+
const val FIXED_DEPOSIT = "fixeddepositaccounts"
4646
}

core/network/src/commonMain/kotlin/com/mifos/core/network/BaseApiManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import com.mifos.core.network.services.ClientService
3333
import com.mifos.core.network.services.CollectionSheetService
3434
import com.mifos.core.network.services.DataTableService
3535
import com.mifos.core.network.services.DocumentService
36+
import com.mifos.core.network.services.FixedDepositService
3637
import com.mifos.core.network.services.GroupService
3738
import com.mifos.core.network.services.LoanService
3839
import com.mifos.core.network.services.NoteService
@@ -44,7 +45,6 @@ import com.mifos.core.network.services.SearchService
4445
import com.mifos.core.network.services.ShareAccountService
4546
import com.mifos.core.network.services.StaffService
4647
import com.mifos.core.network.services.SurveyService
47-
import com.mifos.core.network.services.FixedDepositService
4848
import com.mifos.core.network.services.createCenterService
4949
import com.mifos.core.network.services.createChargeService
5050
import com.mifos.core.network.services.createCheckerInboxService
@@ -53,14 +53,14 @@ import com.mifos.core.network.services.createClientService
5353
import com.mifos.core.network.services.createCollectionSheetService
5454
import com.mifos.core.network.services.createDataTableService
5555
import com.mifos.core.network.services.createDocumentService
56+
import com.mifos.core.network.services.createFixedDepositService
5657
import com.mifos.core.network.services.createGroupService
5758
import com.mifos.core.network.services.createLoanService
5859
import com.mifos.core.network.services.createNoteService
5960
import com.mifos.core.network.services.createOfficeService
6061
import com.mifos.core.network.services.createRecurringAccountService
6162
import com.mifos.core.network.services.createRunReportsService
6263
import com.mifos.core.network.services.createSavingsAccountService
63-
import com.mifos.core.network.services.createFixedDepositService
6464
import com.mifos.core.network.services.createSearchService
6565
import com.mifos.core.network.services.createShareAccountService
6666
import com.mifos.core.network.services.createStaffService
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
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/android-client/blob/master/LICENSE.md
9+
*/
110
package com.mifos.core.network.datamanager
211

312
import com.mifos.core.network.BaseApiManager
413
import com.mifos.core.network.model.FixedDepositTemplate
514
import kotlinx.coroutines.flow.Flow
615

7-
class DataManagerFixedDeposit (private val baseApiManager: BaseApiManager){
16+
class DataManagerFixedDeposit(private val baseApiManager: BaseApiManager) {
817

9-
fun getFixedDepositTemplate(clientId:Int,productId: Int?): Flow<FixedDepositTemplate> =
10-
baseApiManager.fixedDepositService.fixedDepositProductTemplate(clientId,productId)
11-
12-
}
18+
fun getFixedDepositTemplate(clientId: Int, productId: Int?): Flow<FixedDepositTemplate> =
19+
baseApiManager.fixedDepositService.fixedDepositProductTemplate(clientId, productId)
20+
}

core/network/src/commonMain/kotlin/com/mifos/core/network/di/DataMangerModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import com.mifos.core.network.datamanager.DataManagerClient
1919
import com.mifos.core.network.datamanager.DataManagerCollectionSheet
2020
import com.mifos.core.network.datamanager.DataManagerDataTable
2121
import com.mifos.core.network.datamanager.DataManagerDocument
22+
import com.mifos.core.network.datamanager.DataManagerFixedDeposit
2223
import com.mifos.core.network.datamanager.DataManagerGroups
2324
import com.mifos.core.network.datamanager.DataManagerIdentifiers
24-
import com.mifos.core.network.datamanager.DataManagerFixedDeposit
2525
import com.mifos.core.network.datamanager.DataManagerLoan
2626
import com.mifos.core.network.datamanager.DataManagerNote
2727
import com.mifos.core.network.datamanager.DataManagerOffices

core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositProductOption.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
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/android-client/blob/master/LICENSE.md
9+
*/
110
package com.mifos.core.network.model
211

3-
412
import kotlinx.serialization.SerialName
513
import kotlinx.serialization.Serializable
614

@@ -14,4 +22,4 @@ data class FixedDepositProductOption(
1422

1523
@SerialName("withHoldTax")
1624
val withHoldTax: Boolean? = null,
17-
)
25+
)
Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,55 @@
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/android-client/blob/master/LICENSE.md
9+
*/
110
package com.mifos.core.network.model
211

312
import com.mifos.core.model.objects.account.saving.FieldOfficerOptions
4-
import com.mifos.core.model.utils.IgnoredOnParcel
13+
import com.mifos.core.model.objects.template.recurring.Currency
14+
import com.mifos.core.model.objects.template.recurring.interest.InterestCalculationDaysInYearTypeOption
15+
import com.mifos.core.model.objects.template.recurring.interest.InterestCalculationTypeOption
16+
import com.mifos.core.model.objects.template.recurring.interest.InterestCompoundingPeriodTypeOption
17+
import com.mifos.core.model.objects.template.recurring.interest.InterestPostingPeriodTypeOption
18+
import com.mifos.core.model.objects.template.recurring.period.PeriodFrequencyTypeOption
519
import kotlinx.serialization.SerialName
620
import kotlinx.serialization.Serializable
721

8-
9-
1022
@Serializable
1123
data class FixedDepositTemplate(
24+
1225
@SerialName("clientId")
1326
val clientId: Int? = null,
1427

1528
@SerialName(value = "clientName")
1629
val clientName: String? = null,
1730

31+
@SerialName(value = "currency")
32+
val currency: Currency? = null,
33+
1834
@SerialName("productOptions")
1935
val productOptions: List<FixedDepositProductOption>? = null,
2036

2137
@SerialName("fieldOfficerOptions")
2238
val fieldOfficerOptions: List<FieldOfficerOptions>? = null,
2339

24-
)
40+
@SerialName("periodFrequencyTypeOptions")
41+
val periodFrequencyTypeOptions: List<PeriodFrequencyTypeOption>? = null,
42+
43+
@SerialName("interestCompoundingPeriodTypeOptions")
44+
val interestCompoundingPeriodTypeOptions: List<InterestCompoundingPeriodTypeOption>? = null,
45+
46+
@SerialName("interestPostingPeriodTypeOptions")
47+
val interestPostingPeriodTypeOptions: List<InterestPostingPeriodTypeOption>? = null,
48+
49+
@SerialName("interestCalculationDaysInYearTypeOptions")
50+
val interestCalculationDaysInYearTypeOptions: List<InterestCalculationDaysInYearTypeOption>? = null,
51+
52+
@SerialName("interestCalculationTypeOptions")
53+
val interestCalculationTypeOptions: List<InterestCalculationTypeOption>? = null,
54+
55+
)
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
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/android-client/blob/master/LICENSE.md
9+
*/
110
package com.mifos.core.network.services
211

312
import com.mifos.core.network.model.FixedDepositTemplate
413
import com.mifos.room.basemodel.APIEndPoint
5-
import de.jensklingenberg.ktorfit.http.Query
614
import de.jensklingenberg.ktorfit.http.GET
15+
import de.jensklingenberg.ktorfit.http.Query
716
import kotlinx.coroutines.flow.Flow
817

9-
10-
11-
12-
13-
1418
interface FixedDepositService {
1519

16-
@GET( APIEndPoint.FIXED_DEPOSIT + "/template")
20+
@GET(APIEndPoint.FIXED_DEPOSIT + "/template")
1721
fun fixedDepositProductTemplate(
1822
@Query("clientId") clientId: Int,
1923
@Query("productId") productId: Int?,
2024
): Flow<FixedDepositTemplate>
2125
}
22-
23-
24-
25-
26-

feature/client/src/commonMain/composeResources/values/strings.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,4 +578,14 @@
578578
<string name="charges_view_charges">View Charges</string>
579579
<string name="charges_client_update_not_support_error_msg">Updating client charges is not supported. Please delete the existing charge and create a new one.</string>
580580

581+
<string name="feature_fixed_deposit_deposit_amount">Deposit Amount</string>
582+
<string name="feature_fixed_deposit_deposit_period_type">Deposit Period Type</string>
583+
<string name="feature_fixed_interest_compounding">Interest Compounding</string>
584+
<string name="feature_fixed_interest_compounding_period">Interest Compounding Period</string>
585+
<string name="feature_fixed_interest_posting_period">Interest Posting Period</string>
586+
<string name="feature_fixed_interest_calculated_using">Interest Calculated Using</string>
587+
<string name="feature_fixed_days_in_year">Days in year</string>
588+
<string name="feature_fixed_deposit_terms_page">Terms</string>
589+
<string name="feature_fixed_deposit_deposit_period">Deposit Period</string>
590+
581591
</resources>

0 commit comments

Comments
 (0)