Skip to content

Commit 377ec90

Browse files
authored
Merge branch 'development' into feature/loan-transactions-export-dialog
2 parents e85c04b + b24fe7a commit 377ec90

File tree

9 files changed

+60
-25
lines changed

9 files changed

+60
-25
lines changed

core/network/src/commonMain/kotlin/com/mifos/core/network/mappers/clients/GetClientsClientIdAccountMapper.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ object GetClientsClientIdAccountMapper :
104104
LoanTypeEntity(
105105
id = loanType.id?.toInt(),
106106
code = loanType.code,
107-
value = loanType.description,
107+
value = loanType.value,
108108
)
109109
},
110110
loanCycle = it.loanCycle,
111+
originalLoan = it.originalLoan,
112+
loanBalance = it.loanBalance,
113+
amountPaid = it.amountPaid,
111114
)
112115
} ?: emptyList(),
113116

@@ -191,9 +194,12 @@ object GetClientsClientIdAccountMapper :
191194
loanType = GetClientsLoanAccountsType(
192195
id = it.loanType?.id?.toLong(),
193196
code = it.loanType?.code,
194-
description = it.loanType?.value,
197+
value = it.loanType?.value,
195198
),
196199
loanCycle = it.loanCycle,
200+
loanBalance = it.loanBalance,
201+
originalLoan = it.originalLoan,
202+
amountPaid = it.amountPaid,
197203
)
198204
}.toSet(),
199205
)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,10 @@ data class GetClientsLoanAccounts(
4343

4444
val status: GetClientsLoanAccountsStatus? = null,
4545

46+
val originalLoan: Double? = null,
47+
48+
val loanBalance: Double? = null,
49+
50+
val amountPaid: Double? = null,
51+
4652
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data class GetClientsLoanAccountsType(
2424

2525
val code: String? = null,
2626

27-
val description: String? = null,
27+
val value: String? = null,
2828

2929
val id: Long? = null,
3030
)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@
454454
<string name="client_savings_savings_accounts">Savings Accounts</string>
455455
<string name="client_savings_item">item</string>
456456
<string name="client_savings_pending_approval">Pending Approval</string>
457-
<string name="client_savings_not_avilable">Not Available</string>
457+
<string name="client_savings_not_available">Not Available</string>
458458

459459
<string name="client_collateral_title">Client Collateral</string>
460460
<string name="client_collateral_choose_type">Choose Collateral Type</string>
@@ -520,6 +520,9 @@
520520
<string name="client_signature_draw">Draw</string>
521521
<string name="client_signature_more">More</string>
522522

523+
<!-- Client Loan Accounts-->
524+
<string name="client_loan_accounts_not_available">Not Available</string>
525+
523526
<!-- Client Share Account-->
524527
<string name="client_share_accounts_share_accounts">Share Accounts</string>
525528
<string name="client_share_accounts_an_error_occurred">An error occurred</string>

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientGeneral/ClientProfileGeneralScreen.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import androidclient.feature.client.generated.resources.client_performance_histo
1717
import androidclient.feature.client.generated.resources.client_performance_history_total_savings_label
1818
import androidclient.feature.client.generated.resources.client_profile_general_header_actions
1919
import androidclient.feature.client.generated.resources.client_profile_general_header_performance_history
20-
import androidclient.feature.client.generated.resources.client_savings_not_avilable
20+
import androidclient.feature.client.generated.resources.client_savings_not_available
2121
import androidx.compose.foundation.background
2222
import androidx.compose.foundation.clickable
2323
import androidx.compose.foundation.layout.Arrangement
@@ -241,14 +241,14 @@ fun PerformanceHistoryCard(state: ClientProfileGeneralState) {
241241
PerformanceHistoryRows(
242242
stringResource(Res.string.client_performance_history_loan_cycle_count_label),
243243
performanceHistory.loanCyclesCount?.toString()
244-
?: stringResource(Res.string.client_savings_not_avilable),
244+
?: stringResource(Res.string.client_savings_not_available),
245245

246246
)
247247

248248
PerformanceHistoryRows(
249249
stringResource(Res.string.client_performance_history_active_loans_count_label),
250250
performanceHistory.activeLoans?.toString()
251-
?: stringResource(Res.string.client_savings_not_avilable),
251+
?: stringResource(Res.string.client_savings_not_available),
252252
)
253253

254254
PerformanceHistoryRows(
@@ -257,21 +257,21 @@ fun PerformanceHistoryCard(state: ClientProfileGeneralState) {
257257
performanceHistory.lastLoanAmount?.let {
258258
state.currency + " " + it.toString()
259259
}
260-
?: stringResource(Res.string.client_savings_not_avilable),
260+
?: stringResource(Res.string.client_savings_not_available),
261261
)
262262

263263
PerformanceHistoryRows(
264264
stringResource(Res.string.client_performance_history_active_savings_label),
265265
performanceHistory.activeSavingsCount?.toString()
266-
?: stringResource(Res.string.client_savings_not_avilable),
266+
?: stringResource(Res.string.client_savings_not_available),
267267
)
268268

269269
PerformanceHistoryRows(
270270
stringResource(Res.string.client_performance_history_total_savings_label),
271271
performanceHistory.totalSaving?.let {
272272
state.currency + " " + it.toString()
273273
}
274-
?: stringResource(Res.string.client_savings_not_avilable),
274+
?: stringResource(Res.string.client_savings_not_available),
275275
)
276276
}
277277
}

feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientLoanAccounts/ClientLoanAccountsScreen.kt

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ package com.mifos.feature.client.clientLoanAccounts
1111

1212
import androidclient.feature.client.generated.resources.Res
1313
import androidclient.feature.client.generated.resources.cash_bundel
14+
import androidclient.feature.client.generated.resources.client_loan_accounts_not_available
1415
import androidclient.feature.client.generated.resources.client_savings_item
1516
import androidclient.feature.client.generated.resources.feature_client_account_status
1617
import androidclient.feature.client.generated.resources.feature_client_dialog_action_ok
@@ -168,21 +169,40 @@ private fun ClientLoanAccountsScreen(
168169
items(state.loanAccounts) { loan ->
169170
val symbol = loan.currency?.displaySymbol ?: ""
170171
MifosActionsLoanListingComponent(
171-
accountNo = (loan.accountNo ?: "Not Available"),
172-
loanProduct = loan.productName ?: "Not Available",
172+
accountNo = (
173+
loan.accountNo ?: stringResource(
174+
Res.string.client_loan_accounts_not_available,
175+
)
176+
),
177+
loanProduct = loan.productName ?: stringResource(Res.string.client_loan_accounts_not_available),
173178
originalLoan = symbol + (
174-
(loan.originalLoan ?: "Not Available").toString()
179+
(loan.originalLoan ?: stringResource(Res.string.client_loan_accounts_not_available)).toString()
175180
),
176181
amountPaid = symbol + (
177182
(
178-
loan.amountPaid
179-
?: "Not Available"
180-
).toString()
183+
if (loan.status?.pendingApproval == true) {
184+
stringResource(Res.string.client_loan_accounts_not_available)
185+
} else {
186+
(
187+
loan.amountPaid
188+
?: 0.0
189+
).toString()
190+
}
191+
)
181192
),
182193
loanBalance = symbol + (
183-
(loan.amountPaid ?: "Not Available").toString()
194+
(
195+
if (loan.status?.pendingApproval == true) {
196+
stringResource(Res.string.client_loan_accounts_not_available)
197+
} else {
198+
(
199+
loan.loanBalance
200+
?: 0.0
201+
).toString()
202+
}
203+
)
184204
),
185-
type = loan.loanType?.value ?: "Not Available",
205+
type = loan.loanType?.value ?: stringResource(Res.string.client_loan_accounts_not_available),
186206
// TODO check if we need to add other options as well, such as disburse and all
187207
// currently didn't add it cuz its not in the UI design
188208
menuList = when {

feature/client/src/commonMain/kotlin/com/mifos/feature/client/fixedDepositAccount/FixedDepositAccountScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import androidclient.feature.client.generated.resources.client_empty_card_messag
1414
import androidclient.feature.client.generated.resources.client_product_fixed_deposit_account
1515
import androidclient.feature.client.generated.resources.client_profile_fixed_deposit_account_title
1616
import androidclient.feature.client.generated.resources.client_savings_item
17-
import androidclient.feature.client.generated.resources.client_savings_not_avilable
17+
import androidclient.feature.client.generated.resources.client_savings_not_available
1818
import androidclient.feature.client.generated.resources.client_savings_pending_approval
1919
import androidclient.feature.client.generated.resources.feature_client_dialog_action_ok
2020
import androidclient.feature.client.generated.resources.filter
@@ -149,7 +149,7 @@ fun FixedDepositAccountContent(
149149
horizontal = DesignToken.padding.large,
150150
),
151151
) {
152-
val notAvailableText = stringResource(Res.string.client_savings_not_avilable)
152+
val notAvailableText = stringResource(Res.string.client_savings_not_available)
153153

154154
FixedDepositAccountHeader(
155155
state.fixedDepositAccount.size.toString(),

feature/client/src/commonMain/kotlin/com/mifos/feature/client/recurringDepositAccount/RecurringDepositAccountScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import androidclient.feature.client.generated.resources.client_empty_card_messag
1414
import androidclient.feature.client.generated.resources.client_product_recurring_deposit_account
1515
import androidclient.feature.client.generated.resources.client_profile_recurring_deposit_account_title
1616
import androidclient.feature.client.generated.resources.client_savings_item
17-
import androidclient.feature.client.generated.resources.client_savings_not_avilable
17+
import androidclient.feature.client.generated.resources.client_savings_not_available
1818
import androidclient.feature.client.generated.resources.client_savings_pending_approval
1919
import androidclient.feature.client.generated.resources.feature_client_dialog_action_ok
2020
import androidclient.feature.client.generated.resources.filter
@@ -149,7 +149,7 @@ internal fun RecurringDepositAccountContent(
149149
horizontal = DesignToken.padding.large,
150150
),
151151
) {
152-
val notAvailableText = stringResource(Res.string.client_savings_not_avilable)
152+
val notAvailableText = stringResource(Res.string.client_savings_not_available)
153153
RecurringDepositAccountHeader(
154154
state.recurringDepositAccounts.size.toString(),
155155
onToggleSearch = {

feature/client/src/commonMain/kotlin/com/mifos/feature/client/savingsAccounts/SavingsAccountsScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package com.mifos.feature.client.savingsAccounts
1212
import androidclient.feature.client.generated.resources.Res
1313
import androidclient.feature.client.generated.resources.client_product_saving_account
1414
import androidclient.feature.client.generated.resources.client_savings_item
15-
import androidclient.feature.client.generated.resources.client_savings_not_avilable
15+
import androidclient.feature.client.generated.resources.client_savings_not_available
1616
import androidclient.feature.client.generated.resources.client_savings_pending_approval
1717
import androidclient.feature.client.generated.resources.client_savings_savings_accounts
1818
import androidclient.feature.client.generated.resources.feature_client_dialog_action_ok
@@ -153,7 +153,7 @@ fun SavingsAccountsContent(
153153
balance = if (savings.accountBalance != null) {
154154
"${savings.currency?.displaySymbol ?: ""} ${savings.accountBalance}"
155155
} else {
156-
stringResource(Res.string.client_savings_not_avilable)
156+
stringResource(Res.string.client_savings_not_available)
157157
},
158158
menuList = if (savings.status?.submittedAndPendingApproval == true) {
159159
listOf(
@@ -189,7 +189,7 @@ fun SavingsAccountsContent(
189189
} else if (savings.status?.submittedAndPendingApproval == true) {
190190
stringResource(Res.string.client_savings_pending_approval)
191191
} else {
192-
stringResource(Res.string.client_savings_not_avilable)
192+
stringResource(Res.string.client_savings_not_available)
193193
},
194194
isExpanded = expandedIndex == index,
195195
onExpandToggle = {

0 commit comments

Comments
 (0)