@@ -18,6 +18,7 @@ import androidclient.feature.loan.generated.resources.feature_loan_closed_resche
1818import androidclient.feature.loan.generated.resources.feature_loan_closed_written_off
1919import androidclient.feature.loan.generated.resources.feature_loan_pending_approval
2020import androidclient.feature.loan.generated.resources.feature_loan_rejected
21+ import androidclient.feature.loan.generated.resources.feature_loan_unknown
2122import androidclient.feature.loan.generated.resources.feature_loan_withdrawn_by_applicant
2223import androidx.compose.ui.graphics.Color
2324import com.mifos.core.designsystem.theme.AppColors
@@ -64,18 +65,23 @@ enum class LoanStatus(
6465 Res .string.feature_loan_rejected,
6566 AppColors .loanRejectedStatus,
6667 ),
68+ UNKNOWN (
69+ Res .string.feature_loan_unknown,
70+ AppColors .loanUnknownStatus,
71+ ),
6772}
6873
6974fun LoanStatusEntity.getLoanStatus (): LoanStatus {
7075 return when {
7176 this .code == " loanStatusType.withdrawn.by.client" -> LoanStatus .WITHDRAWN_BY_APPLICANT
77+ this .code == " loanStatusType.rejected" -> LoanStatus .REJECTED
7278 this .overpaid == true -> LoanStatus .CLOSED_OVERPAID
7379 this .closedWrittenOff == true -> LoanStatus .CLOSED_WRITTEN_OFF
7480 this .closedRescheduled == true -> LoanStatus .CLOSED_RESCHEDULED
7581 this .closedObligationsMet == true -> LoanStatus .CLOSED_OBLIGATIONS_MET
7682 this .active == true -> LoanStatus .ACTIVE
7783 this .waitingForDisbursal == true -> LoanStatus .APPROVED
7884 this .pendingApproval == true -> LoanStatus .PENDING_APPROVAL
79- else -> LoanStatus .REJECTED
85+ else -> LoanStatus .UNKNOWN
8086 }
8187}
0 commit comments