From cb3975c26297bdd0ce16bdbe4ae545996fb401af Mon Sep 17 00:00:00 2001 From: Hekmatullah Date: Fri, 10 Jan 2025 21:00:53 +0000 Subject: [PATCH] feat(core:model): Migrate model module to KMP (#2732) * feat(core:model): Migrate model module to KMP * Change properties from var to val and remove unnecessary annotations * remove inheritance of Account in ShareAccount, SavingAccount and LoanAccount * replace ArrayList() with emptyList() and improve numeric literal consistency --- core/model/build.gradle.kts | 27 ++- .../mobile/core/model/Parcelize.android.kt | 20 +++ .../org/mifos/mobile/core/model/Parcelize.kt | 19 +++ .../org/mifos/mobile/core/model/UserData.kt | 0 .../mobile/core/model/entity/AboutUsItem.kt | 0 .../entity/AccountOptionAndBeneficiary.kt | 0 .../mifos/mobile/core/model/entity/Charge.kt | 6 +- .../model/entity/ChargeCalculationType.kt | 10 +- .../core/model/entity/ChargeTimeType.kt | 10 +- .../core/model/entity/CheckboxStatus.kt | 8 +- .../mobile/core/model/entity/Currency.kt | 16 +- .../org/mifos/mobile/core/model/entity/FAQ.kt | 12 +- .../core/model/entity/MifosNotification.kt | 10 +- .../mifos/mobile/core/model/entity/Page.kt | 4 +- .../mobile/core/model/entity/Timeline.kt | 28 ++-- .../mobile/core/model/entity/Transaction.kt | 22 +-- .../model/entity/UpdatePasswordPayload.kt | 4 +- .../mifos/mobile/core/model/entity/User.kt | 20 +-- .../accounts/LoanAccountsListResponse.kt | 2 +- .../accounts/SavingAccountsListResponse.kt | 2 +- .../entity/accounts/loan/AmortizationType.kt | 10 +- .../model/entity/accounts/loan/Currency.kt | 18 +- .../entity/accounts/loan/DaysInMonthType.kt | 10 +- .../entity/accounts/loan/DaysInYearType.kt | 10 +- .../loan/InterestCalculationPeriodType.kt | 10 +- .../loan/InterestRateFrequencyType.kt | 10 +- .../InterestRecalculationCompoundingType.kt | 10 +- .../loan/InterestRecalculationData.kt | 40 +++++ .../entity/accounts/loan/InterestType.kt | 10 +- .../model/entity/accounts/loan/LoanAccount.kt | 60 +++++++ .../model/entity/accounts/loan/LoanType.kt | 10 +- .../accounts/loan/LoanWithAssociations.kt | 132 +++++++++++++++ .../entity/accounts/loan/LoanWithdraw.kt | 12 +- .../model/entity/accounts/loan/Periods.kt | 97 +++++++++++ .../RecalculationCompoundingFrequencyType.kt | 10 +- .../loan/RecalculationRestFrequencyType.kt | 10 +- .../accounts/loan/RepaymentFrequencyType.kt | 10 +- .../entity/accounts/loan/RepaymentSchedule.kt | 48 ++++++ .../accounts/loan/RescheduleStrategyType.kt | 10 +- .../core/model/entity/accounts/loan/Status.kt | 26 +-- .../model/entity/accounts/loan/Summary.kt | 49 ++++++ .../accounts/loan/TermPeriodFrequencyType.kt | 10 +- .../model/entity/accounts/loan/Timeline.kt | 50 ++++++ .../loan/calendardata/CalendarData.kt | 62 +++++++ .../accounts/loan/calendardata/EntityType.kt | 10 +- .../accounts/loan/calendardata/Frequency.kt | 10 +- .../calendardata/RepeatsOnNthDayOfMonth.kt | 10 +- .../entity/accounts/loan/calendardata/Type.kt | 10 +- .../entity/accounts/loan/tableview/Cell.kt | 0 .../accounts/loan/tableview/ColumnHeader.kt | 0 .../accounts/loan/tableview/RowHeader.kt | 0 .../model/entity/accounts/savings/Currency.kt | 18 +- .../accounts/savings/PaymentDetailData.kt | 18 +- .../entity/accounts/savings/PaymentType.kt | 8 +- .../entity/accounts/savings/SavingAccount.kt | 56 +++++++ .../SavingsAccountApplicationPayload.kt | 14 +- .../savings/SavingsAccountUpdatePayload.kt | 8 +- .../savings/SavingsAccountWithdrawPayload.kt | 12 +- .../savings/SavingsWithAssociations.kt | 80 +++++++++ .../model/entity/accounts/savings/Status.kt | 42 +++++ .../model/entity/accounts/savings/Summary.kt | 35 ++++ .../model/entity/accounts/savings/TimeLine.kt | 43 +++++ .../accounts/savings/TransactionType.kt | 50 ++++++ .../entity/accounts/savings/Transactions.kt | 41 +++++ .../entity/accounts/share/ShareAccount.kt | 39 +++++ .../model/entity/accounts/share/Status.kt | 34 ++++ .../model/entity/accounts/share/Timeline.kt | 42 +++++ .../model/entity/beneficiary/Beneficiary.kt | 18 +- .../entity/beneficiary/BeneficiaryDetail.kt | 2 +- .../entity/beneficiary/BeneficiaryPayload.kt | 16 +- .../beneficiary/BeneficiaryUpdatePayload.kt | 6 +- .../mobile/core/model/entity/client/Client.kt | 65 +++++++ .../model/entity/client/ClientAccounts.kt | 12 +- .../entity/client/ClientClassification.kt | 12 +- .../core/model/entity/client/ClientType.kt | 12 +- .../core/model/entity/client/Currency.kt | 16 +- .../core/model/entity/client/DepositType.kt | 21 ++- .../mobile/core/model/entity/client/Gender.kt | 12 +- .../mobile/core/model/entity/client/Group.kt | 10 +- .../mobile/core/model/entity/client/Status.kt | 10 +- .../mobile/core/model/entity/client/Type.kt | 10 +- .../guarantor/GuarantorApplicationPayload.kt | 18 +- .../entity/guarantor/GuarantorPayload.kt | 22 +-- .../guarantor/GuarantorTemplatePayload.kt | 4 +- .../model/entity/guarantor/GuarantorType.kt | 10 +- .../core/model/entity/mifoserror/Arg.kt | 6 +- .../core/model/entity/mifoserror/Errors.kt | 12 +- .../model/entity/mifoserror/MifosError.kt | 14 +- .../NotificationRegisterPayload.kt | 4 +- .../notification/NotificationUserDetail.kt | 2 +- .../model/entity/payload/AccountDetail.kt | 4 +- .../core/model/entity/payload/LoansPayload.kt | 69 ++++++++ .../core/model/entity/payload/LoginPayload.kt | 0 .../entity/payload/ReviewTransferPayload.kt | 8 +- .../model/entity/payload/TransferPayload.kt | 54 ++++++ .../model/entity/register/RegisterPayload.kt | 16 +- .../core/model/entity/register/UserVerify.kt | 4 +- .../entity/templates/account/AccountOption.kt | 18 +- .../account/AccountOptionsTemplate.kt | 12 +- .../entity/templates/account/AccountType.kt | 10 +- .../beneficiary/AccountTypeOption.kt | 10 +- .../beneficiary/BeneficiaryTemplate.kt | 6 +- .../templates/loans/AccountLinkingOptions.kt | 20 +-- .../entity/templates/loans/AccountingRule.kt | 10 +- .../loans/AllowAttributeOverrides.kt | 20 +-- .../loans/AmortizationTypeOptions.kt | 10 +- .../entity/templates/loans/ChargeAppliesTo.kt | 10 +- .../entity/templates/loans/ChargeOptions.kt | 26 +-- .../templates/loans/ChargePaymentMode.kt | 10 +- .../model/entity/templates/loans/Currency.kt | 18 +- .../entity/templates/loans/FundOptions.kt | 8 +- .../loans/InterestRateFrequencyTypeOptions.kt | 10 +- .../templates/loans/InterestTypeOptions.kt | 10 +- .../templates/loans/LoanCollateralOptions.kt | 14 +- .../templates/loans/LoanOfficerOptions.kt | 45 +++++ .../templates/loans/LoanPurposeOptions.kt | 18 +- .../entity/templates/loans/LoanTemplate.kt | 158 ++++++++++++++++++ .../model/entity/templates/loans/Product.kt | 130 ++++++++++++++ .../entity/templates/loans/ProductOptions.kt | 47 ++++++ ...RepaymentFrequencyDaysOfWeekTypeOptions.kt | 10 +- .../RepaymentFrequencyNthDayTypeOptions.kt | 10 +- .../loans/RepaymentFrequencyTypeOptions.kt | 10 +- .../model/entity/templates/loans/TaxGroup.kt | 8 +- .../loans/TermFrequencyTypeOptions.kt | 10 +- .../model/entity/templates/loans/Timeline.kt | 6 +- .../TransactionProcessingStrategyOptions.kt | 10 +- .../templates/savings/ChargeAppliesTo.kt | 10 +- .../savings/ChargeCalculationType.kt | 10 +- .../entity/templates/savings/ChargeOptions.kt | 24 +-- .../templates/savings/ChargePaymentMode.kt | 10 +- .../templates/savings/ChargeTimeType.kt | 10 +- .../templates/savings/ProductOptions.kt | 8 +- .../savings/SavingsAccountTemplate.kt | 30 ++++ .../core/model/enums/AboutUsListItemId.kt | 0 .../mobile/core/model/enums/AccountType.kt | 0 .../mifos/mobile/core/model/enums/AppTheme.kt | 0 .../core/model/enums/BeneficiaryState.kt | 0 .../core/model/enums/BiometricCapability.kt | 0 .../mobile/core/model/enums/ChargeType.kt | 0 .../mobile/core/model/enums/GuarantorState.kt | 0 .../mobile/core/model/enums/LoanState.kt | 0 .../core/model/enums/MifosAppLanguage.kt | 0 .../core/model/enums/RequestAccessType.kt | 0 .../core/model/enums/SavingsAccountState.kt | 0 .../mobile/core/model/enums/TransferType.kt | 0 .../mobile/core/model/Parcelize.desktop.kt | 17 ++ .../mifos/mobile/core/model/Parcelize.js.kt | 17 ++ core/model/src/main/AndroidManifest.xml | 13 -- .../core/model/entity/accounts/Account.kt | 19 --- .../loan/InterestRecalculationData.kt | 40 ----- .../model/entity/accounts/loan/LoanAccount.kt | 126 -------------- .../accounts/loan/LoanWithAssociations.kt | 132 --------------- .../model/entity/accounts/loan/Periods.kt | 97 ----------- .../entity/accounts/loan/RepaymentSchedule.kt | 49 ------ .../model/entity/accounts/loan/Summary.kt | 53 ------ .../model/entity/accounts/loan/Timeline.kt | 119 ------------- .../loan/calendardata/CalendarData.kt | 62 ------- .../entity/accounts/savings/SavingAccount.kt | 55 ------ .../savings/SavingsWithAssociations.kt | 82 --------- .../model/entity/accounts/savings/Status.kt | 42 ----- .../model/entity/accounts/savings/Summary.kt | 36 ---- .../model/entity/accounts/savings/TimeLine.kt | 100 ----------- .../accounts/savings/TransactionType.kt | 50 ------ .../entity/accounts/savings/Transactions.kt | 41 ----- .../entity/accounts/share/ShareAccount.kt | 48 ------ .../model/entity/accounts/share/Status.kt | 41 ----- .../model/entity/accounts/share/Timeline.kt | 54 ------ .../mobile/core/model/entity/client/Client.kt | 65 ------- .../core/model/entity/payload/LoansPayload.kt | 69 -------- .../model/entity/payload/TransferPayload.kt | 53 ------ .../templates/loans/LoanOfficerOptions.kt | 45 ----- .../entity/templates/loans/LoanTemplate.kt | 158 ------------------ .../model/entity/templates/loans/Product.kt | 130 -------------- .../entity/templates/loans/ProductOptions.kt | 47 ------ .../savings/SavingsAccountTemplate.kt | 30 ---- .../mobile/core/model/Parcelize.native.kt | 17 ++ .../mobile/core/model/Parcelize.wasmJs.kt | 17 ++ 177 files changed, 2276 insertions(+), 2427 deletions(-) create mode 100644 core/model/src/androidMain/kotlin/org/mifos/mobile/core/model/Parcelize.android.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/Parcelize.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/UserData.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/AboutUsItem.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/AccountOptionAndBeneficiary.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/Charge.kt (88%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/ChargeCalculationType.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/ChargeTimeType.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/CheckboxStatus.kt (75%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/Currency.kt (61%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/FAQ.kt (66%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/MifosNotification.kt (75%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/Page.kt (83%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/Timeline.kt (51%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/Transaction.kt (57%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/UpdatePasswordPayload.kt (85%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/User.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/LoanAccountsListResponse.kt (89%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/SavingAccountsListResponse.kt (89%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/AmortizationType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/Currency.kt (56%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/DaysInMonthType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/DaysInYearType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/InterestCalculationPeriodType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/InterestRateFrequencyType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationCompoundingType.kt (72%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationData.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/InterestType.kt (70%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanAccount.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/LoanType.kt (70%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithAssociations.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithdraw.kt (62%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Periods.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationCompoundingFrequencyType.kt (72%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationRestFrequencyType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentFrequencyType.kt (71%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentSchedule.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/RescheduleStrategyType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/Status.kt (62%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Summary.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/TermPeriodFrequencyType.kt (71%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Timeline.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/CalendarData.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/EntityType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Frequency.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/RepeatsOnNthDayOfMonth.kt (72%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Type.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/tableview/Cell.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/tableview/ColumnHeader.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/loan/tableview/RowHeader.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/savings/Currency.kt (56%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/savings/PaymentDetailData.kt (56%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/savings/PaymentType.kt (74%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingAccount.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountApplicationPayload.kt (62%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountUpdatePayload.kt (75%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountWithdrawPayload.kt (65%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsWithAssociations.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Status.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Summary.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/TimeLine.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/TransactionType.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Transactions.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/ShareAccount.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/Status.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/Timeline.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/beneficiary/Beneficiary.kt (60%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryDetail.kt (86%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryPayload.kt (58%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryUpdatePayload.kt (74%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Client.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/ClientAccounts.kt (79%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/ClientClassification.kt (69%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/ClientType.kt (68%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/Currency.kt (58%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/DepositType.kt (66%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/Gender.kt (68%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/Group.kt (70%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/Status.kt (70%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/client/Type.kt (70%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/guarantor/GuarantorApplicationPayload.kt (61%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/guarantor/GuarantorPayload.kt (53%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/guarantor/GuarantorTemplatePayload.kt (80%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/guarantor/GuarantorType.kt (72%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/mifoserror/Arg.kt (77%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/mifoserror/Errors.kt (60%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/mifoserror/MifosError.kt (57%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/notification/NotificationRegisterPayload.kt (89%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/notification/NotificationUserDetail.kt (95%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/payload/AccountDetail.kt (87%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/LoansPayload.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/payload/LoginPayload.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/payload/ReviewTransferPayload.kt (76%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/TransferPayload.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/register/RegisterPayload.kt (61%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/register/UserVerify.kt (84%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/account/AccountOption.kt (59%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/account/AccountOptionsTemplate.kt (59%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/account/AccountType.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/beneficiary/AccountTypeOption.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt (76%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/AccountLinkingOptions.kt (57%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/AccountingRule.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/AllowAttributeOverrides.kt (51%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/AmortizationTypeOptions.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/ChargeAppliesTo.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/ChargeOptions.kt (53%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/ChargePaymentMode.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/Currency.kt (59%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/FundOptions.kt (76%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/InterestRateFrequencyTypeOptions.kt (74%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/InterestTypeOptions.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/LoanCollateralOptions.kt (66%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanOfficerOptions.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/LoanPurposeOptions.kt (61%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanTemplate.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Product.kt create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ProductOptions.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyDaysOfWeekTypeOptions.kt (72%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyNthDayTypeOptions.kt (74%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyTypeOptions.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/TaxGroup.kt (76%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/TermFrequencyTypeOptions.kt (73%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/Timeline.kt (77%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/loans/TransactionProcessingStrategyOptions.kt (74%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/savings/ChargeAppliesTo.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/savings/ChargeCalculationType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/savings/ChargeOptions.kt (51%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/savings/ChargePaymentMode.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/savings/ChargeTimeType.kt (71%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/entity/templates/savings/ProductOptions.kt (76%) create mode 100644 core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/SavingsAccountTemplate.kt rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/AboutUsListItemId.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/AccountType.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/AppTheme.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/BeneficiaryState.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/BiometricCapability.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/ChargeType.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/GuarantorState.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/LoanState.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/MifosAppLanguage.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/RequestAccessType.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/SavingsAccountState.kt (100%) rename core/model/src/{main/java => commonMain/kotlin}/org/mifos/mobile/core/model/enums/TransferType.kt (100%) create mode 100644 core/model/src/desktopMain/kotlin/org/mifos/mobile/core/model/Parcelize.desktop.kt create mode 100644 core/model/src/jsMain/kotlin/org/mifos/mobile/core/model/Parcelize.js.kt delete mode 100644 core/model/src/main/AndroidManifest.xml delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/Account.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationData.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanAccount.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithAssociations.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Periods.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentSchedule.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Summary.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Timeline.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/CalendarData.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingAccount.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsWithAssociations.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Status.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Summary.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/TimeLine.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/TransactionType.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Transactions.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/ShareAccount.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/Status.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/Timeline.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Client.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/LoansPayload.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/TransferPayload.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanOfficerOptions.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanTemplate.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Product.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ProductOptions.kt delete mode 100644 core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/SavingsAccountTemplate.kt create mode 100644 core/model/src/nativeMain/kotlin/org/mifos/mobile/core/model/Parcelize.native.kt create mode 100644 core/model/src/wasmJsMain/kotlin/org/mifos/mobile/core/model/Parcelize.wasmJs.kt diff --git a/core/model/build.gradle.kts b/core/model/build.gradle.kts index 2a7083558..2d344a31b 100644 --- a/core/model/build.gradle.kts +++ b/core/model/build.gradle.kts @@ -8,8 +8,7 @@ * See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md */ plugins { - alias(libs.plugins.mifos.android.library) - alias(libs.plugins.kotlin.android) + alias(libs.plugins.mifos.kmp.library) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.kotlin.parcelize) } @@ -21,17 +20,15 @@ android { } } -dependencies { - - api(projects.core.common) - - implementation(libs.jetbrains.kotlin.jdk7) - implementation(libs.kotlinx.serialization.json) - - // For Serialized name - implementation(libs.squareup.retrofit.converter.gson) - - testImplementation(libs.junit) - androidTestImplementation(libs.androidx.test.ext.junit) - androidTestImplementation(libs.androidx.test.espresso.core) +kotlin { + androidTarget { + compilerOptions { + freeCompilerArgs.addAll("-P", "plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=org.mifos.mobile.core.model.Parcelize") + } + } + sourceSets { + commonMain.dependencies { + implementation(libs.kotlinx.serialization.json) + } + } } \ No newline at end of file diff --git a/core/model/src/androidMain/kotlin/org/mifos/mobile/core/model/Parcelize.android.kt b/core/model/src/androidMain/kotlin/org/mifos/mobile/core/model/Parcelize.android.kt new file mode 100644 index 000000000..3d224406c --- /dev/null +++ b/core/model/src/androidMain/kotlin/org/mifos/mobile/core/model/Parcelize.android.kt @@ -0,0 +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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model + +import android.os.Parcelable +import kotlinx.parcelize.IgnoredOnParcel +import kotlinx.parcelize.RawValue + +actual typealias Parcelable = Parcelable + +actual typealias IgnoredOnParcel = IgnoredOnParcel + +actual typealias RawValue = RawValue diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/Parcelize.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/Parcelize.kt new file mode 100644 index 000000000..49880d78c --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/Parcelize.kt @@ -0,0 +1,19 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model + +annotation class Parcelize() + +expect interface Parcelable + +expect annotation class IgnoredOnParcel() + +@Target(AnnotationTarget.TYPE) +expect annotation class RawValue() diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/UserData.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/UserData.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/UserData.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/UserData.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/AboutUsItem.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/AboutUsItem.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/AboutUsItem.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/AboutUsItem.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/AccountOptionAndBeneficiary.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/AccountOptionAndBeneficiary.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/AccountOptionAndBeneficiary.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/AccountOptionAndBeneficiary.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Charge.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Charge.kt similarity index 88% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/Charge.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Charge.kt index 3dc04d662..f894f34b4 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Charge.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Charge.kt @@ -9,15 +9,15 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Charge( val clientId: Int? = null, val chargeId: Int? = null, val name: String? = null, - val dueDate: ArrayList = ArrayList(), + val dueDate: ArrayList = arrayListOf(), val chargeTimeType: ChargeTimeType? = null, val chargeCalculationType: ChargeCalculationType? = null, val currency: Currency? = null, diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/ChargeCalculationType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/ChargeCalculationType.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/ChargeCalculationType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/ChargeCalculationType.kt index 07347cc8b..184394b51 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/ChargeCalculationType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/ChargeCalculationType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize import kotlinx.serialization.Serializable +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize @Serializable data class ChargeCalculationType( - var id: Int = 0, - var code: String? = null, - var value: String? = null, + val id: Int = 0, + val code: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/ChargeTimeType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/ChargeTimeType.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/ChargeTimeType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/ChargeTimeType.kt index 6173c05a8..f9619ea59 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/ChargeTimeType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/ChargeTimeType.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by michaelsosnick on 12/11/16. @@ -18,7 +18,7 @@ import kotlinx.parcelize.Parcelize @Parcelize data class ChargeTimeType( - var id: Int = 0, - var code: String? = null, - var value: String? = null, + val id: Int = 0, + val code: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/CheckboxStatus.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/CheckboxStatus.kt similarity index 75% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/CheckboxStatus.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/CheckboxStatus.kt index 055cb0a71..dd919c647 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/CheckboxStatus.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/CheckboxStatus.kt @@ -13,8 +13,8 @@ package org.mifos.mobile.core.model.entity * Created by dilpreet on 3/7/17. */ -data class CheckboxStatus @JvmOverloads constructor( - var status: String?, - var color: Int, - var isChecked: Boolean = false, +data class CheckboxStatus( + val status: String?, + val color: Int, + val isChecked: Boolean = false, ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Currency.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Currency.kt similarity index 61% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/Currency.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Currency.kt index b52f63073..2935c2086 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Currency.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Currency.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by michaelsosnick on 12/11/16. @@ -18,10 +18,10 @@ import kotlinx.parcelize.Parcelize @Parcelize data class Currency( - var code: String? = null, - var name: String? = null, - var decimalPlaces: Int = 0, - var displaySymbol: String? = null, - var nameCode: String? = null, - var displayLabel: String? = null, + val code: String? = null, + val name: String? = null, + val decimalPlaces: Int = 0, + val displaySymbol: String? = null, + val nameCode: String? = null, + val displayLabel: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/FAQ.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/FAQ.kt similarity index 66% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/FAQ.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/FAQ.kt index 87c89b85e..0ae03c916 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/FAQ.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/FAQ.kt @@ -9,16 +9,16 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by dilpreet on 12/8/17. */ @Parcelize -data class FAQ @JvmOverloads constructor( - var question: String? = null, - var answer: String? = null, - var isSelected: Boolean = false, +data class FAQ constructor( + val question: String? = null, + val answer: String? = null, + val isSelected: Boolean = false, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/MifosNotification.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/MifosNotification.kt similarity index 75% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/MifosNotification.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/MifosNotification.kt index 82ebee93b..bbff4e453 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/MifosNotification.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/MifosNotification.kt @@ -9,16 +9,16 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize import kotlinx.serialization.Serializable +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize @Serializable data class MifosNotification( - var timeStamp: Long, - var msg: String? = null, - var read: Boolean? = null, + val timeStamp: Long, + val msg: String? = null, + val read: Boolean? = null, ) : Parcelable { fun isRead(): Boolean { return read == true diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Page.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Page.kt similarity index 83% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/Page.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Page.kt index 0c64f35fa..99494b994 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Page.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Page.kt @@ -14,6 +14,6 @@ package org.mifos.mobile.core.model.entity */ data class Page( - var totalFilteredRecords: Int = 0, - var pageItems: List = ArrayList(), + val totalFilteredRecords: Int = 0, + val pageItems: List = emptyList(), ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Timeline.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Timeline.kt similarity index 51% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/Timeline.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Timeline.kt index bca1999c1..207b12407 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Timeline.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Timeline.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by ishankhanna for mifos android-client on 09/02/14. @@ -24,16 +24,16 @@ import kotlinx.parcelize.Parcelize @Parcelize data class Timeline( - var submittedOnDate: List = ArrayList(), - var submittedByUsername: String? = null, - var submittedByFirstname: String? = null, - var submittedByLastname: String? = null, - var activatedOnDate: List = ArrayList(), - var activatedByUsername: String? = null, - var activatedByFirstname: String? = null, - var activatedByLastname: String? = null, - var closedOnDate: List = ArrayList(), - var closedByUsername: String? = null, - var closedByFirstname: String? = null, - var closedByLastname: String? = null, + val submittedOnDate: List = emptyList(), + val submittedByUsername: String? = null, + val submittedByFirstname: String? = null, + val submittedByLastname: String? = null, + val activatedOnDate: List = emptyList(), + val activatedByUsername: String? = null, + val activatedByFirstname: String? = null, + val activatedByLastname: String? = null, + val closedOnDate: List = emptyList(), + val closedByUsername: String? = null, + val closedByFirstname: String? = null, + val closedByLastname: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Transaction.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Transaction.kt similarity index 57% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/Transaction.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Transaction.kt index ad5b2b2ba..a572a7710 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/Transaction.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/Transaction.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize import org.mifos.mobile.core.model.entity.client.Type /** @@ -21,22 +21,22 @@ import org.mifos.mobile.core.model.entity.client.Type @Parcelize data class Transaction( - var id: Long? = null, + val id: Long? = null, - var officeId: Long? = null, + val officeId: Long? = null, - var officeName: String? = null, + val officeName: String? = null, - var type: Type, + val type: Type, - var date: List = ArrayList(), + val date: List = emptyList(), - var currency: Currency? = null, + val currency: Currency? = null, - var amount: Double? = null, + val amount: Double? = null, - var submittedOnDate: List = ArrayList(), + val submittedOnDate: List = emptyList(), - var reversed: Boolean? = null, + val reversed: Boolean? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/UpdatePasswordPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/UpdatePasswordPayload.kt similarity index 85% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/UpdatePasswordPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/UpdatePasswordPayload.kt index b0fb94910..003a585ec 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/UpdatePasswordPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/UpdatePasswordPayload.kt @@ -14,7 +14,7 @@ package org.mifos.mobile.core.model.entity */ class UpdatePasswordPayload { - var password: String? = null + val password: String? = null - var repeatPassword: String? = null + val repeatPassword: String? = null } diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/User.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/User.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/User.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/User.kt index 9fecadaad..c29a16dea 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/User.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/User.kt @@ -9,9 +9,9 @@ */ package org.mifos.mobile.core.model.entity -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize +import kotlinx.serialization.SerialName +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * @author Vishwajeet @@ -20,26 +20,26 @@ import kotlinx.parcelize.Parcelize @Parcelize data class User( val userId: Long = 0, - @SerializedName("authenticated") + @SerialName("authenticated") val isAuthenticated: Boolean = false, val username: String? = null, val officeId: Long = 0, val officeName: String? = null, - val roles: ArrayList = ArrayList(), + val roles: ArrayList = arrayListOf(), val base64EncodedAuthenticationKey: String? = null, - val permissions: ArrayList = ArrayList(), + val permissions: ArrayList = arrayListOf(), val shouldRenewPassword: Boolean = false, val isTwoFactorAuthenticationRequired: Boolean = false, ) : Parcelable @Parcelize data class Role( - @SerializedName("id") + @SerialName("id") val id: Long = 0, - @SerializedName("name") + @SerialName("name") val name: String? = null, - @SerializedName("description") + @SerialName("description") val description: String? = null, - @SerializedName("disabled") + @SerialName("disabled") val disabled: Boolean = false, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/LoanAccountsListResponse.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/LoanAccountsListResponse.kt similarity index 89% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/LoanAccountsListResponse.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/LoanAccountsListResponse.kt index bc36d7242..68f4f65cf 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/LoanAccountsListResponse.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/LoanAccountsListResponse.kt @@ -12,5 +12,5 @@ package org.mifos.mobile.core.model.entity.accounts import org.mifos.mobile.core.model.entity.accounts.loan.LoanAccount data class LoanAccountsListResponse( - var loanAccounts: List = ArrayList(), + val loanAccounts: List = emptyList(), ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/SavingAccountsListResponse.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/SavingAccountsListResponse.kt similarity index 89% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/SavingAccountsListResponse.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/SavingAccountsListResponse.kt index 8739fa48b..824cdb621 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/SavingAccountsListResponse.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/SavingAccountsListResponse.kt @@ -12,5 +12,5 @@ package org.mifos.mobile.core.model.entity.accounts import org.mifos.mobile.core.model.entity.accounts.savings.SavingAccount data class SavingAccountsListResponse( - var savingsAccounts: List = ArrayList(), + val savingsAccounts: List = emptyList(), ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/AmortizationType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/AmortizationType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/AmortizationType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/AmortizationType.kt index ba640fef3..2139e9b04 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/AmortizationType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/AmortizationType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class AmortizationType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Currency.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Currency.kt similarity index 56% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Currency.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Currency.kt index 78421f136..b75eae4c6 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Currency.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Currency.kt @@ -9,22 +9,22 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Currency( - var code: String? = null, + val code: String? = null, - var name: String? = null, + val name: String? = null, - var decimalPlaces: Double? = null, + val decimalPlaces: Double? = null, - var inMultiplesOf: Double? = null, + val inMultiplesOf: Double? = null, - var displaySymbol: String? = null, + val displaySymbol: String? = null, - var nameCode: String? = null, + val nameCode: String? = null, - var displayLabel: String? = null, + val displayLabel: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/DaysInMonthType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/DaysInMonthType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/DaysInMonthType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/DaysInMonthType.kt index 459dc0d27..139947089 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/DaysInMonthType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/DaysInMonthType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class DaysInMonthType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/DaysInYearType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/DaysInYearType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/DaysInYearType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/DaysInYearType.kt index ce9e6b63c..c68ed2436 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/DaysInYearType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/DaysInYearType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class DaysInYearType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestCalculationPeriodType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestCalculationPeriodType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestCalculationPeriodType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestCalculationPeriodType.kt index 15abed611..ea2f93a10 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestCalculationPeriodType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestCalculationPeriodType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class InterestCalculationPeriodType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRateFrequencyType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRateFrequencyType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRateFrequencyType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRateFrequencyType.kt index 530692b06..1e27b6298 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRateFrequencyType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRateFrequencyType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class InterestRateFrequencyType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationCompoundingType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationCompoundingType.kt similarity index 72% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationCompoundingType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationCompoundingType.kt index b1e6cf981..02a854f2b 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationCompoundingType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationCompoundingType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class InterestRecalculationCompoundingType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationData.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationData.kt new file mode 100644 index 000000000..7780813b7 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationData.kt @@ -0,0 +1,40 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.loan + +import kotlinx.serialization.SerialName +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.entity.accounts.loan.calendardata.CalendarData + +@Parcelize +data class InterestRecalculationData( + val id: Int? = null, + + val loanId: Int? = null, + + val interestRecalculationCompoundingType: InterestRecalculationCompoundingType? = null, + + val rescheduleStrategyType: RescheduleStrategyType? = null, + + val calendarData: CalendarData, + + val recalculationRestFrequencyType: RecalculationRestFrequencyType? = null, + + val recalculationRestFrequencyInterval: Double? = null, + + val recalculationCompoundingFrequencyType: RecalculationCompoundingFrequencyType? = null, + + @SerialName("isCompoundingToBePostedAsTransaction") + val compoundingToBePostedAsTransaction: Boolean? = null, + + val allowCompoundingOnEod: Boolean? = null, + +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestType.kt similarity index 70% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestType.kt index c96ce088f..ac26d3226 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/InterestType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class InterestType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanAccount.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanAccount.kt new file mode 100644 index 000000000..71bb4da73 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanAccount.kt @@ -0,0 +1,60 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.loan + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class LoanAccount( + val id: Long = 0, + + val loanProductId: Long = 0, + + val externalId: String? = null, + + val numberOfRepayments: Long = 0, + + val accountNo: String? = null, + + val productName: String? = null, + + val productId: Int? = null, + + val loanProductName: String? = null, + + val clientName: String? = null, + + val loanProductDescription: String? = null, + + val principal: Double = 0.0, + + val annualInterestRate: Double = 0.0, + + val status: Status? = null, + + val loanType: LoanType? = null, + + val loanCycle: Int? = null, + + val loanBalance: Double = 0.0, + + val amountPaid: Double = 0.0, + + val currency: Currency?, + + val inArrears: Boolean? = null, + + val summary: Summary? = null, + + val loanPurposeName: String? = null, + + val timeline: Timeline?, +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanType.kt similarity index 70% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanType.kt index ea32bfd0c..82f3d8bb4 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class LoanType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithAssociations.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithAssociations.kt new file mode 100644 index 000000000..0095f93af --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithAssociations.kt @@ -0,0 +1,132 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.loan + +import kotlinx.serialization.SerialName +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.entity.Transaction + +@Parcelize +data class LoanWithAssociations( + val id: Int? = null, + + val accountNo: String? = null, + + val externalId: String? = null, + + val status: Status? = null, + + val clientId: Int? = null, + + val clientAccountNo: String? = null, + + val clientName: String? = null, + + val clientOfficeId: Int? = null, + + val loanProductId: Int? = null, + + val loanProductName: String? = null, + + @SerialName("isLoanProductLinkedToFloatingRate") + val loanProductLinkedToFloatingRate: Boolean? = null, + + val loanType: LoanType? = null, + + val currency: Currency? = null, + + val principal: Double? = null, + + val approvedPrincipal: Double? = null, + + val proposedPrincipal: Double? = null, + + val termFrequency: Int? = null, + + val termPeriodFrequencyType: TermPeriodFrequencyType? = null, + + val numberOfRepayments: Int? = null, + + val repaymentEvery: Int? = null, + + val repaymentFrequencyType: RepaymentFrequencyType? = null, + + val interestRatePerPeriod: Int? = null, + + val interestRateFrequencyType: InterestRateFrequencyType? = null, + + @SerialName("isFloatingInterestRate") + val floatingInterestRate: Boolean? = null, + + val amortizationType: AmortizationType? = null, + + val interestType: InterestType? = null, + + val interestCalculationPeriodType: InterestCalculationPeriodType? = null, + + val allowPartialPeriodInterestCalcualtion: Boolean? = null, + + val transactionProcessingStrategyId: Int? = null, + + val transactionProcessingStrategyName: String? = null, + + val syncDisbursementWithMeeting: Boolean? = null, + + val timeline: Timeline? = null, + + val summary: Summary? = null, + + val repaymentSchedule: RepaymentSchedule? = null, + + val feeChargesAtDisbursementCharged: Double? = null, + + val loanProductCounter: Int? = null, + + val multiDisburseLoan: Boolean? = null, + + val canDefineInstallmentAmount: Boolean? = null, + + val canDisburse: Boolean? = null, + + val canUseForTopup: Boolean? = null, + + @SerialName("isTopup") + val topup: Boolean? = null, + + val closureLoanId: Int? = null, + + val inArrears: Boolean? = null, + + @SerialName("isNPA") + val npa: Boolean? = null, + + val daysInMonthType: DaysInMonthType? = null, + + val daysInYearType: DaysInYearType? = null, + + @SerialName("isInterestRecalculationEnabled") + val interestRecalculationEnabled: Boolean? = null, + + val interestRecalculationData: InterestRecalculationData? = null, + + val createStandingInstructionAtDisbursement: Boolean? = null, + + @SerialName("isvaliableInstallmentsAllowed") + val valiableInstallmentsAllowed: Boolean? = null, + + val minimumGap: Int? = null, + + val maximumGap: Int? = null, + + val transactions: MutableList? = arrayListOf(), + + val loanPurposeName: String? = null, +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithdraw.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithdraw.kt similarity index 62% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithdraw.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithdraw.kt index b49dbff71..3cfdbe3dc 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithdraw.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithdraw.kt @@ -9,15 +9,15 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class LoanWithdraw( - var withdrawnOnDate: String? = null, + val withdrawnOnDate: String? = null, - var note: String? = null, + val note: String? = null, - internal var dateFormat: String = "dd MMMM yyyy", - internal var locale: String = "en", + internal val dateFormat: String = "dd MMMM yyyy", + internal val locale: String = "en", ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Periods.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Periods.kt new file mode 100644 index 000000000..2492cb5fc --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Periods.kt @@ -0,0 +1,97 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.loan + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class Periods( + val period: Int? = null, + + val fromDate: List = emptyList(), + + val dueDate: List = emptyList(), + + val obligationsMetOnDate: List = emptyList(), + + val principalDisbursed: Double? = null, + + val complete: Boolean? = null, + + val daysInPeriod: Int? = null, + + val principalOriginalDue: Double? = null, + + val principalDue: Double? = null, + + val principalPaid: Double? = null, + + val principalWrittenOff: Double? = null, + + val principalOutstanding: Double? = null, + + val principalLoanBalanceOutstanding: Double? = null, + + val interestOriginalDue: Double? = null, + + val interestDue: Double? = null, + + val interestPaid: Double? = null, + + val interestWaived: Double? = null, + + val interestWrittenOff: Double? = null, + + val interestOutstanding: Double? = null, + + val feeChargesDue: Double? = null, + + val feeChargesPaid: Double? = null, + + val feeChargesWaived: Double? = null, + + val feeChargesWrittenOff: Double? = null, + + val feeChargesOutstanding: Double? = null, + + val penaltyChargesDue: Double? = null, + + val penaltyChargesPaid: Double? = null, + + val penaltyChargesWaived: Double? = null, + + val penaltyChargesWrittenOff: Double? = null, + + val penaltyChargesOutstanding: Double? = null, + + val totalOriginalDueForPeriod: Double? = null, + + val totalDueForPeriod: Double? = null, + + val totalPaidForPeriod: Double? = null, + + val totalPaidInAdvanceForPeriod: Double? = null, + + val totalPaidLateForPeriod: Double? = null, + + val totalWaivedForPeriod: Double? = null, + + val totalWrittenOffForPeriod: Double? = null, + + val totalOutstandingForPeriod: Double? = null, + + val totalOverdue: Double? = null, + + val totalActualCostOfLoanForPeriod: Double? = null, + + val totalInstallmentAmountForPeriod: Double? = null, + +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationCompoundingFrequencyType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationCompoundingFrequencyType.kt similarity index 72% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationCompoundingFrequencyType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationCompoundingFrequencyType.kt index dc7c34234..f27a4af46 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationCompoundingFrequencyType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationCompoundingFrequencyType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class RecalculationCompoundingFrequencyType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationRestFrequencyType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationRestFrequencyType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationRestFrequencyType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationRestFrequencyType.kt index 4db369d53..8099288a4 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationRestFrequencyType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RecalculationRestFrequencyType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class RecalculationRestFrequencyType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentFrequencyType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentFrequencyType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentFrequencyType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentFrequencyType.kt index 8dde6dbea..6b1c869ad 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentFrequencyType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentFrequencyType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class RepaymentFrequencyType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentSchedule.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentSchedule.kt new file mode 100644 index 000000000..9801e154f --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentSchedule.kt @@ -0,0 +1,48 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.loan + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class RepaymentSchedule( + val currency: Currency? = null, + + val loanTermInDays: Int? = null, + + val totalPrincipalDisbursed: Double? = null, + + val totalPrincipalExpected: Double? = null, + + val totalPrincipalPaid: Double? = null, + + val totalInterestCharged: Double? = null, + + val totalFeeChargesCharged: Double? = null, + + val totalPenaltyChargesCharged: Double? = null, + + val totalWaived: Double? = null, + + val totalWrittenOff: Double? = null, + + val totalRepaymentExpected: Double? = null, + + val totalRepayment: Double? = null, + + val totalPaidInAdvance: Double? = null, + + val totalPaidLate: Double? = null, + + val totalOutstanding: Double? = null, + + val periods: List = emptyList(), +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RescheduleStrategyType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RescheduleStrategyType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RescheduleStrategyType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RescheduleStrategyType.kt index 2f3d930e5..bf2dd5058 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RescheduleStrategyType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/RescheduleStrategyType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class RescheduleStrategyType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Status.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Status.kt similarity index 62% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Status.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Status.kt index f1a705808..ea6bde820 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Status.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Status.kt @@ -9,32 +9,32 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Status( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, - var pendingApproval: Boolean? = null, + val pendingApproval: Boolean? = null, - var waitingForDisbursal: Boolean? = null, + val waitingForDisbursal: Boolean? = null, - var active: Boolean? = null, + val active: Boolean? = null, - var closedObligationsMet: Boolean? = null, + val closedObligationsMet: Boolean? = null, - var closedWrittenOff: Boolean? = null, + val closedWrittenOff: Boolean? = null, - var closedRescheduled: Boolean? = null, + val closedRescheduled: Boolean? = null, - var closed: Boolean? = null, + val closed: Boolean? = null, - var overpaid: Boolean? = null, + val overpaid: Boolean? = null, ) : Parcelable { diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Summary.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Summary.kt new file mode 100644 index 000000000..e3de26c10 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Summary.kt @@ -0,0 +1,49 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.loan + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class Summary( + val principalDisbursed: Double = 0.0, + + val principalPaid: Double = 0.0, + + val interestCharged: Double = 0.0, + + val interestPaid: Double = 0.0, + + val feeChargesCharged: Double = 0.0, + + val penaltyChargesCharged: Double = 0.0, + + val penaltyChargesWaived: Double = 0.0, + + val totalExpectedRepayment: Double = 0.0, + + val interestWaived: Double = 0.0, + + val totalRepayment: Double = 0.0, + + val feeChargesWaived: Double = 0.0, + + val totalOutstanding: Double = 0.0, + + private val overdueSinceDate: List? = null, + + val currency: Currency? = null, +) : Parcelable { + + fun getOverdueSinceDate(): List? { + return overdueSinceDate + } +} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/TermPeriodFrequencyType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/TermPeriodFrequencyType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/TermPeriodFrequencyType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/TermPeriodFrequencyType.kt index fc2c54947..81c96e8c7 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/TermPeriodFrequencyType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/TermPeriodFrequencyType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class TermPeriodFrequencyType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Timeline.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Timeline.kt new file mode 100644 index 000000000..8469bf3fb --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/Timeline.kt @@ -0,0 +1,50 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.loan + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Suppress("ktlint:standard:property-naming") +@Parcelize +data class Timeline( + val submittedOnDate: List? = null, + + val submittedByUsername: String?, + + val submittedByFirstname: String?, + + val submittedByLastname: String?, + + val approvedOnDate: List? = null, + + val approvedByUsername: String?, + + val approvedByFirstname: String?, + + val approvedByLastname: String?, + + val expectedDisbursementDate: List? = null, + + val actualDisbursementDate: List? = null, + + val disbursedByUsername: String?, + + val disbursedByFirstname: String?, + + val disbursedByLastname: String?, + + val closedOnDate: List? = null, + + val expectedMaturityDate: List? = null, + + val withdrawnOnDate: List, + +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/CalendarData.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/CalendarData.kt new file mode 100644 index 000000000..b4b540c28 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/CalendarData.kt @@ -0,0 +1,62 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.loan.calendardata + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class CalendarData( + val id: Int? = null, + + val calendarInstanceId: Int? = null, + + val entityId: Int? = null, + + val entityType: EntityType, + + val title: String? = null, + + val startDate: List = emptyList(), + + val endDate: List = emptyList(), + + val duration: Double? = null, + + val type: Type, + + val repeating: Boolean? = null, + + val recurrence: String? = null, + + val frequency: Frequency, + + val interval: Double? = null, + + val repeatsOnNthDayOfMonth: RepeatsOnNthDayOfMonth, + + val firstReminder: Int? = null, + + val secondReminder: Int? = null, + + val humanReadable: String? = null, + + val createdDate: List = emptyList(), + + val lastUpdatedDate: List = emptyList(), + + val createdByUserId: Int? = null, + + val createdByUsername: String? = null, + + val lastUpdatedByUserId: Int? = null, + + val lastUpdatedByUsername: String? = null, +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/EntityType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/EntityType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/EntityType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/EntityType.kt index 80a2856a1..a4430e4ce 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/EntityType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/EntityType.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan.calendardata -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class EntityType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Frequency.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Frequency.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Frequency.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Frequency.kt index 87f227c59..c03da76ad 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Frequency.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Frequency.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan.calendardata -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Frequency( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/RepeatsOnNthDayOfMonth.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/RepeatsOnNthDayOfMonth.kt similarity index 72% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/RepeatsOnNthDayOfMonth.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/RepeatsOnNthDayOfMonth.kt index ba56b5514..b88ebc22c 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/RepeatsOnNthDayOfMonth.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/RepeatsOnNthDayOfMonth.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan.calendardata -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class RepeatsOnNthDayOfMonth( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Type.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Type.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Type.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Type.kt index 6dd7cb096..a2542ec72 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Type.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/Type.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.loan.calendardata -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Type( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/tableview/Cell.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/tableview/Cell.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/tableview/Cell.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/tableview/Cell.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/tableview/ColumnHeader.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/tableview/ColumnHeader.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/tableview/ColumnHeader.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/tableview/ColumnHeader.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/tableview/RowHeader.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/tableview/RowHeader.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/tableview/RowHeader.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/loan/tableview/RowHeader.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Currency.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Currency.kt similarity index 56% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Currency.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Currency.kt index c2dd41788..25efb6bbd 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Currency.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Currency.kt @@ -9,22 +9,22 @@ */ package org.mifos.mobile.core.model.entity.accounts.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Currency( - var code: String? = null, + val code: String? = null, - var name: String? = null, + val name: String? = null, - var decimalPlaces: Int? = null, + val decimalPlaces: Int? = null, - var inMultiplesOf: Int? = null, + val inMultiplesOf: Int? = null, - var displaySymbol: String? = null, + val displaySymbol: String? = null, - var nameCode: String? = null, + val nameCode: String? = null, - var displayLabel: String? = null, + val displayLabel: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/PaymentDetailData.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/PaymentDetailData.kt similarity index 56% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/PaymentDetailData.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/PaymentDetailData.kt index a5a1e4dc4..e26f6e5c0 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/PaymentDetailData.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/PaymentDetailData.kt @@ -9,22 +9,22 @@ */ package org.mifos.mobile.core.model.entity.accounts.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class PaymentDetailData( - var id: Int? = null, + val id: Int? = null, - var paymentType: PaymentType, + val paymentType: PaymentType, - var accountNumber: String? = null, + val accountNumber: String? = null, - var checkNumber: String? = null, + val checkNumber: String? = null, - var routingCode: String? = null, + val routingCode: String? = null, - var receiptNumber: String? = null, + val receiptNumber: String? = null, - var bankNumber: String? = null, + val bankNumber: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/PaymentType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/PaymentType.kt similarity index 74% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/PaymentType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/PaymentType.kt index c73262f46..3e004c300 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/PaymentType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/PaymentType.kt @@ -9,12 +9,12 @@ */ package org.mifos.mobile.core.model.entity.accounts.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class PaymentType( - var id: Int? = null, + val id: Int? = null, - var name: String? = null, + val name: String? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingAccount.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingAccount.kt new file mode 100644 index 000000000..5a052cdb7 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingAccount.kt @@ -0,0 +1,56 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.savings + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.entity.client.DepositType + +@Parcelize +data class SavingAccount( + + val id: Long = 0, + + val accountNo: String? = null, + + val productName: String? = null, + + val productId: Int? = null, + + val overdraftLimit: Long = 0, + + val minRequiredBalance: Long = 0, + + val accountBalance: Double = 0.0, + + val totalDeposits: Double = 0.0, + + val savingsProductName: String? = null, + + val clientName: String? = null, + + val savingsProductId: String? = null, + + val nominalAnnualInterestRate: Double = 0.0, + + val status: Status? = null, + + val currency: Currency? = null, + + val depositType: DepositType? = null, + + val lastActiveTransactionDate: List? = null, + + val timeLine: TimeLine? = null, +) : Parcelable { + fun isRecurring(): Boolean { + return this.depositType != null && this.depositType.isRecurring() + } +} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountApplicationPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountApplicationPayload.kt similarity index 62% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountApplicationPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountApplicationPayload.kt index 50ad756ba..8cb5e13ad 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountApplicationPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountApplicationPayload.kt @@ -9,20 +9,20 @@ */ package org.mifos.mobile.core.model.entity.accounts.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class SavingsAccountApplicationPayload( - var submittedOnDate: String? = null, + val submittedOnDate: String? = null, - var clientId: Int? = null, + val clientId: Int? = null, - var productId: Int? = null, + val productId: Int? = null, - var locale: String = "en", + val locale: String = "en", - var dateFormat: String = "dd MMMM yyyy", + val dateFormat: String = "dd MMMM yyyy", ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountUpdatePayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountUpdatePayload.kt similarity index 75% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountUpdatePayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountUpdatePayload.kt index 4d73910c8..f4a2418f2 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountUpdatePayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountUpdatePayload.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.accounts.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class SavingsAccountUpdatePayload( - var clientId: Long? = 0, + val clientId: Long? = 0, - var productId: Long? = 0, + val productId: Long? = 0, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountWithdrawPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountWithdrawPayload.kt similarity index 65% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountWithdrawPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountWithdrawPayload.kt index 107f1666c..134438a73 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountWithdrawPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsAccountWithdrawPayload.kt @@ -9,13 +9,13 @@ */ package org.mifos.mobile.core.model.entity.accounts.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class SavingsAccountWithdrawPayload( - var locale: String = "en", - var dateFormat: String = "dd MMMM yyyy", - var withdrawnOnDate: String? = null, - var note: String? = null, + val locale: String = "en", + val dateFormat: String = "dd MMMM yyyy", + val withdrawnOnDate: String? = null, + val note: String? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsWithAssociations.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsWithAssociations.kt new file mode 100644 index 000000000..73db0e2ba --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/SavingsWithAssociations.kt @@ -0,0 +1,80 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.savings + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.entity.client.DepositType + +@Parcelize +data class SavingsWithAssociations( + + val id: Long? = null, + + val accountNo: String? = null, + + val depositType: DepositType? = null, + + val externalId: String? = null, + + val clientId: Int? = null, + + val clientName: String? = null, + + val savingsProductId: Int? = null, + + val savingsProductName: String? = null, + + val fieldOfficerId: Int? = null, + + val status: Status? = null, + + val timeline: TimeLine? = null, + + val currency: Currency? = null, + + internal val nominalAnnualInterestRate: Double? = null, + + val minRequiredOpeningBalance: Double? = null, + + val lockinPeriodFrequency: Double? = null, + + val withdrawalFeeForTransfers: Boolean? = null, + + val allowOverdraft: Boolean? = null, + + val enforceMinRequiredBalance: Boolean? = null, + + val withHoldTax: Boolean? = null, + + val lastActiveTransactionDate: List? = null, + + val dormancyTrackingActive: Boolean? = null, + + val summary: Summary? = null, + + val transactions: List = emptyList(), + +) : Parcelable { + + fun isRecurring(): Boolean { + return this.depositType != null && this.depositType.isRecurring() + } + + fun getNominalAnnualInterestRate(): Double { + return nominalAnnualInterestRate!! + } + + fun setNominalAnnualInterestRate(nominalAnnualInterestRate: Double?): SavingsWithAssociations { + return this.copy( + nominalAnnualInterestRate = nominalAnnualInterestRate, + ) + } +} diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Status.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Status.kt new file mode 100644 index 000000000..733e33c31 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Status.kt @@ -0,0 +1,42 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.savings + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class Status( + val id: Int? = null, + val code: String? = null, + + val value: String? = null, + + val submittedAndPendingApproval: Boolean? = null, + + val approved: Boolean? = null, + + val rejected: Boolean? = null, + + val withdrawnByApplicant: Boolean? = null, + + val active: Boolean? = null, + + val closed: Boolean? = null, + + val prematureClosed: Boolean? = null, + + internal val transferInProgress: Boolean? = null, + + internal val transferOnHold: Boolean? = null, + + val matured: Boolean? = null, + +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Summary.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Summary.kt new file mode 100644 index 000000000..2df5b96fa --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Summary.kt @@ -0,0 +1,35 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.savings + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class Summary( + + val currency: Currency? = null, + + val totalDeposits: Double? = null, + + val totalWithdrawals: Double? = null, + + val totalInterestEarned: Double? = null, + + val totalInterestPosted: Double? = null, + + val accountBalance: Double? = null, + + val totalOverdraftInterestDerived: Double? = null, + + val interestNotPosted: Double? = null, + + val lastInterestCalculationDate: List = emptyList(), +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/TimeLine.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/TimeLine.kt new file mode 100644 index 000000000..a54230d44 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/TimeLine.kt @@ -0,0 +1,43 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.savings + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class TimeLine( + val submittedOnDate: List = emptyList(), + + val submittedByUsername: String?, + + val submittedByFirstname: String?, + + val submittedByLastname: String?, + + val approvedOnDate: List = emptyList(), + + val approvedByUsername: String?, + + val approvedByFirstname: String?, + + val approvedByLastname: String?, + + val activatedOnDate: List? = null, + + val activatedByUsername: String?, + + val activatedByFirstname: String?, + + val activatedByLastname: String?, + + val closedOnDate: List = emptyList(), + +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/TransactionType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/TransactionType.kt new file mode 100644 index 000000000..186db1dac --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/TransactionType.kt @@ -0,0 +1,50 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.savings + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class TransactionType( + val id: Int? = null, + val code: String? = null, + + val value: String? = null, + + val deposit: Boolean? = null, + + val dividendPayout: Boolean? = null, + + val withdrawal: Boolean? = null, + + val interestPosting: Boolean? = null, + + val feeDeduction: Boolean? = null, + + val initiateTransfer: Boolean? = null, + + val approveTransfer: Boolean? = null, + + val withdrawTransfer: Boolean? = null, + + val rejectTransfer: Boolean? = null, + + val overdraftInterest: Boolean? = null, + + val writtenoff: Boolean? = null, + + val overdraftFee: Boolean? = null, + + val withholdTax: Boolean? = null, + + val escheat: Boolean? = null, + +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Transactions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Transactions.kt new file mode 100644 index 000000000..3aef2261f --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/savings/Transactions.kt @@ -0,0 +1,41 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.savings + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class Transactions( + val id: Int? = null, + + val transactionType: TransactionType? = null, + + val accountId: Int? = null, + + val accountNo: String? = null, + + val date: List = emptyList(), + + val currency: Currency? = null, + + val paymentDetailData: PaymentDetailData? = null, + + val amount: Double? = null, + + val runningBalance: Double? = null, + + val reversed: Boolean? = null, + + val submittedOnDate: List? = null, + + val interestedPostedAsOn: Boolean? = null, + +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/ShareAccount.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/ShareAccount.kt new file mode 100644 index 000000000..0cd15bb52 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/ShareAccount.kt @@ -0,0 +1,39 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.share + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.entity.accounts.savings.Currency + +@Parcelize +data class ShareAccount( + + val id: Long = 0, + + val accountNo: String? = null, + + val totalApprovedShares: Int? = null, + + val totalPendingForApprovalShares: Int? = null, + + val productId: Int? = null, + + val productName: String? = null, + + val shortProductName: String? = null, + + val status: Status? = null, + + val currency: Currency? = null, + + val timeline: Timeline? = null, + +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/Status.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/Status.kt new file mode 100644 index 000000000..228345cdc --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/Status.kt @@ -0,0 +1,34 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.share + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class Status( + + val id: Int? = null, + + val code: String? = null, + + val value: String? = null, + + val submittedAndPendingApproval: Boolean? = null, + + val approved: Boolean? = null, + + val rejected: Boolean? = null, + + val active: Boolean? = null, + + val closed: Boolean? = null, + +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/Timeline.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/Timeline.kt new file mode 100644 index 000000000..97a06e478 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/accounts/share/Timeline.kt @@ -0,0 +1,42 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.accounts.share + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class Timeline( + + val submittedOnDate: List? = null, + + val submittedByUsername: String? = null, + + val submittedByFirstname: String? = null, + + val submittedByLastname: String? = null, + + val approvedDate: List? = null, + + val approvedByUsername: String? = null, + + val approvedByFirstname: String? = null, + + val approvedByLastname: String? = null, + + val activatedDate: List? = null, + + val activatedByUsername: String? = null, + + val activatedByFirstname: String? = null, + + val activatedByLastname: String? = null, + +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/Beneficiary.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/Beneficiary.kt similarity index 60% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/Beneficiary.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/Beneficiary.kt index b8b68d61f..40f3f02a4 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/Beneficiary.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/Beneficiary.kt @@ -9,24 +9,24 @@ */ package org.mifos.mobile.core.model.entity.beneficiary -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize import org.mifos.mobile.core.model.entity.templates.account.AccountType @Parcelize data class Beneficiary( - var id: Int? = null, + val id: Int? = null, - var name: String? = null, + val name: String? = null, - var officeName: String? = null, + val officeName: String? = null, - var clientName: String? = null, + val clientName: String? = null, - var accountType: AccountType? = null, + val accountType: AccountType? = null, - var accountNumber: String? = null, + val accountNumber: String? = null, - var transferLimit: Double? = null, + val transferLimit: Double? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryDetail.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryDetail.kt similarity index 86% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryDetail.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryDetail.kt index 3d04973cc..abdff5707 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryDetail.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryDetail.kt @@ -9,4 +9,4 @@ */ package org.mifos.mobile.core.model.entity.beneficiary -class BeneficiaryDetail(var accountNumber: String?, var beneficiaryName: String?) +class BeneficiaryDetail(val accountNumber: String?, val beneficiaryName: String?) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryPayload.kt similarity index 58% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryPayload.kt index 2ac17ad23..e51e1e971 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryPayload.kt @@ -9,20 +9,20 @@ */ package org.mifos.mobile.core.model.entity.beneficiary -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class BeneficiaryPayload( - internal var locale: String = "en_GB", + internal val locale: String = "en_GB", - var name: String? = null, + val name: String? = null, - var accountNumber: String? = null, + val accountNumber: String? = null, - var accountType: Int? = 0, + val accountType: Int? = 0, - var transferLimit: Float? = 0f, + val transferLimit: Float? = 0f, - var officeName: String? = null, + val officeName: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryUpdatePayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryUpdatePayload.kt similarity index 74% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryUpdatePayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryUpdatePayload.kt index f18f92f73..ef929f8e0 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryUpdatePayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/beneficiary/BeneficiaryUpdatePayload.kt @@ -9,7 +9,7 @@ */ package org.mifos.mobile.core.model.entity.beneficiary -data class BeneficiaryUpdatePayload @JvmOverloads constructor( - var name: String? = null, - var transferLimit: Float = 0f, +data class BeneficiaryUpdatePayload constructor( + val name: String? = null, + val transferLimit: Float = 0f, ) diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Client.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Client.kt new file mode 100644 index 000000000..8ede768e8 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Client.kt @@ -0,0 +1,65 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.client + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.entity.Timeline + +@Parcelize +data class Client( + val id: Int = 0, + + val accountNo: String? = null, + + private val status: Status? = null, + + private val active: Boolean? = null, + + val activationDate: List = emptyList(), + + val dobDate: List = emptyList(), + + val firstname: String? = null, + + val middlename: String? = null, + + val lastname: String? = null, + + val displayName: String? = null, + + val fullname: String? = null, + + private val officeId: Int? = null, + + val officeName: String? = null, + + private val staffId: Int? = null, + + private val staffName: String? = null, + + private val timeline: Timeline? = null, + + val imageId: Int = 0, + + val isImagePresent: Boolean = false, + + private val externalId: String? = null, + + val mobileNo: String? = null, + + val clientClassification: ClientClassification? = null, + + val clientType: ClientType? = null, + + val gender: Gender? = null, + + val groups: List = emptyList(), +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientAccounts.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientAccounts.kt similarity index 79% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientAccounts.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientAccounts.kt index 176510f81..abf3cf5e0 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientAccounts.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientAccounts.kt @@ -9,18 +9,18 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize import org.mifos.mobile.core.model.entity.accounts.loan.LoanAccount import org.mifos.mobile.core.model.entity.accounts.savings.SavingAccount import org.mifos.mobile.core.model.entity.accounts.share.ShareAccount @Parcelize data class ClientAccounts( - var loanAccounts: List = ArrayList(), - var savingsAccounts: List? = ArrayList(), + val loanAccounts: List = emptyList(), + val savingsAccounts: List? = emptyList(), - var shareAccounts: List = ArrayList(), + val shareAccounts: List = emptyList(), ) : Parcelable { @@ -33,7 +33,7 @@ data class ClientAccounts( } private fun getSavingsAccounts(wantRecurring: Boolean): List { - val result = ArrayList() + val result = arrayListOf() if (this.savingsAccounts != null) { for (account in savingsAccounts!!) { if (account.isRecurring() == wantRecurring) { diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientClassification.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientClassification.kt similarity index 69% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientClassification.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientClassification.kt index a93631ef9..338371f12 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientClassification.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientClassification.kt @@ -9,13 +9,13 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class ClientClassification( - var id: Int, - var name: String? = null, - var active: Boolean, - var mandatory: Boolean, + val id: Int, + val name: String? = null, + val active: Boolean, + val mandatory: Boolean, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientType.kt similarity index 68% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientType.kt index e9c39547b..de1f86759 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/ClientType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/ClientType.kt @@ -9,13 +9,13 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class ClientType( - var id: Int, - var name: String? = null, - var active: Boolean, - var mandatory: Boolean, + val id: Int, + val name: String? = null, + val active: Boolean, + val mandatory: Boolean, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Currency.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Currency.kt similarity index 58% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Currency.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Currency.kt index 5b526f29b..fa794b7d9 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Currency.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Currency.kt @@ -9,20 +9,20 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Currency( - var code: String? = null, + val code: String? = null, - var name: String? = null, + val name: String? = null, - var decimalPlaces: Int? = null, + val decimalPlaces: Int? = null, - var displaySymbol: String? = null, + val displaySymbol: String? = null, - var nameCode: String? = null, + val nameCode: String? = null, - var displayLabel: String? = null, + val displayLabel: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/DepositType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/DepositType.kt similarity index 66% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/DepositType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/DepositType.kt index f6bdc79f9..cccc66fa9 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/DepositType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/DepositType.kt @@ -9,16 +9,19 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.common.ApiEndPoints +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +// TODO: Create a constant for Endpoints enums +private const val SAVINGS_ACCOUNTS = "savingsaccounts" +private const val RECURRING_ACCOUNTS = "recurringdepositaccounts" @Parcelize data class DepositType( - var id: Int? = null, - var code: String? = null, + val id: Int? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable { fun isRecurring(): Boolean { @@ -38,9 +41,9 @@ data class DepositType( val code: String? = null, val endpoint: String, ) { - SAVINGS(100, "depositAccountType.savingsDeposit", ApiEndPoints.SAVINGS_ACCOUNTS), - FIXED(200, "depositAccountType.fixedDeposit", ApiEndPoints.SAVINGS_ACCOUNTS), - RECURRING(300, "depositAccountType.recurringDeposit", ApiEndPoints.RECURRING_ACCOUNTS), + SAVINGS(100, "depositAccountType.savingsDeposit", SAVINGS_ACCOUNTS), + FIXED(200, "depositAccountType.fixedDeposit", SAVINGS_ACCOUNTS), + RECURRING(300, "depositAccountType.recurringDeposit", RECURRING_ACCOUNTS), ; companion object { diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Gender.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Gender.kt similarity index 68% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Gender.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Gender.kt index 5b3411089..1dccf090e 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Gender.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Gender.kt @@ -9,13 +9,13 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Gender( - var id: Int, - var name: String? = null, - var active: Boolean, - var mandatory: Boolean, + val id: Int, + val name: String? = null, + val active: Boolean, + val mandatory: Boolean, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Group.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Group.kt similarity index 70% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Group.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Group.kt index 87ca0ce21..b1fc0a5c4 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Group.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Group.kt @@ -9,12 +9,12 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Group( - var id: Int, - var accountNo: String? = null, - var name: String? = null, + val id: Int, + val accountNo: String? = null, + val name: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Status.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Status.kt similarity index 70% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Status.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Status.kt index 1af4e8a88..dea2e2822 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Status.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Status.kt @@ -9,13 +9,13 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Status( - var id: Int? = null, - var code: String? = null, + val id: Int? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Type.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Type.kt similarity index 70% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Type.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Type.kt index 8c07f846b..0ce9c2b60 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Type.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/client/Type.kt @@ -9,13 +9,13 @@ */ package org.mifos.mobile.core.model.entity.client -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Type( - var id: Int? = null, - var code: String? = null, + val id: Int? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorApplicationPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorApplicationPayload.kt similarity index 61% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorApplicationPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorApplicationPayload.kt index 86d091516..7323d3f08 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorApplicationPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorApplicationPayload.kt @@ -9,7 +9,7 @@ */ package org.mifos.mobile.core.model.entity.guarantor -import com.google.gson.annotations.SerializedName +import kotlinx.serialization.SerialName /* * Created by saksham on 23/July/2018 @@ -17,15 +17,15 @@ import com.google.gson.annotations.SerializedName data class GuarantorApplicationPayload( - @SerializedName("guarantorTypeId") - var guarantorTypeId: Long?, + @SerialName("guarantorTypeId") + val guarantorTypeId: Long? = null, - @SerializedName("firstname") - var firstName: String?, + @SerialName("firstname") + val firstName: String? = null, - @SerializedName("lastname") - var lastName: String?, + @SerialName("lastname") + val lastName: String? = null, - @SerializedName("city") - var city: String? = "", + @SerialName("city") + val city: String? = "", ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorPayload.kt similarity index 53% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorPayload.kt index 9cf9ebd3b..ec5976cb6 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorPayload.kt @@ -13,26 +13,26 @@ package org.mifos.mobile.core.model.entity.guarantor * Created by saksham on 24/July/2018 */ -import android.os.Parcelable -import kotlinx.android.parcel.RawValue -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.RawValue @Parcelize data class GuarantorPayload( - var id: Long? = 0, + val id: Long? = 0, - var city: String? = null, + val city: String? = null, - var lastname: String? = null, + val lastname: String? = null, - var guarantorType: @RawValue GuarantorType? = null, + val guarantorType: @RawValue GuarantorType? = null, - var firstname: String? = null, + val firstname: String? = null, - var joinedDate: List? = null, + val joinedDate: List? = null, - var loanId: Long? = null, + val loanId: Long? = null, - var status: Boolean? = true, + val status: Boolean? = true, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorTemplatePayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorTemplatePayload.kt similarity index 80% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorTemplatePayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorTemplatePayload.kt index e469998e3..b62c9ce78 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorTemplatePayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorTemplatePayload.kt @@ -15,6 +15,6 @@ package org.mifos.mobile.core.model.entity.guarantor data class GuarantorTemplatePayload( - var guarantorType: GuarantorType? = null, - var guarantorTypeOptions: ArrayList? = null, + val guarantorType: GuarantorType? = null, + val guarantorTypeOptions: ArrayList? = null, ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorType.kt similarity index 72% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorType.kt index 4c4d11f13..e2932426d 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/guarantor/GuarantorType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/guarantor/GuarantorType.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.guarantor -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /* * Created by saksham on 23/July/2018 @@ -18,7 +18,7 @@ import kotlinx.parcelize.Parcelize @Parcelize class GuarantorType( - var id: Long? = null, - var value: String? = null, - var code: String? = null, + val id: Long? = null, + val value: String? = null, + val code: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/Arg.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/Arg.kt similarity index 77% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/Arg.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/Arg.kt index 0ae6ad61a..22d592afc 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/Arg.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/Arg.kt @@ -9,10 +9,10 @@ */ package org.mifos.mobile.core.model.entity.mifoserror -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Arg( - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/Errors.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/Errors.kt similarity index 60% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/Errors.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/Errors.kt index 5d7d10c27..f909aa633 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/Errors.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/Errors.kt @@ -9,13 +9,13 @@ */ package org.mifos.mobile.core.model.entity.mifoserror -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class Errors( - var developerMessage: String? = null, - var defaultUserMessage: String? = null, - var userMessageGlobalisationCode: String? = null, - var parameterName: String? = null, + val developerMessage: String? = null, + val defaultUserMessage: String? = null, + val userMessageGlobalisationCode: String? = null, + val parameterName: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/MifosError.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/MifosError.kt similarity index 57% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/MifosError.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/MifosError.kt index 196d3620b..3b24376ca 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/mifoserror/MifosError.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/mifoserror/MifosError.kt @@ -9,14 +9,14 @@ */ package org.mifos.mobile.core.model.entity.mifoserror -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class MifosError( - var developerMessage: String? = null, - var httpStatusCode: String? = null, - var defaultUserMessage: String? = null, - var userMessageGlobalisationCode: String? = null, - var errors: List = ArrayList(), + val developerMessage: String? = null, + val httpStatusCode: String? = null, + val defaultUserMessage: String? = null, + val userMessageGlobalisationCode: String? = null, + val errors: List = emptyList(), ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/notification/NotificationRegisterPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/notification/NotificationRegisterPayload.kt similarity index 89% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/notification/NotificationRegisterPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/notification/NotificationRegisterPayload.kt index e6c59f19b..b87d0b5b7 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/notification/NotificationRegisterPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/notification/NotificationRegisterPayload.kt @@ -14,6 +14,6 @@ package org.mifos.mobile.core.model.entity.notification */ data class NotificationRegisterPayload( - var clientId: Long, - var registrationId: String, + val clientId: Long, + val registrationId: String, ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/notification/NotificationUserDetail.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/notification/NotificationUserDetail.kt similarity index 95% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/notification/NotificationUserDetail.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/notification/NotificationUserDetail.kt index 63d9bf540..6c3cf5791 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/notification/NotificationUserDetail.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/notification/NotificationUserDetail.kt @@ -15,5 +15,5 @@ package org.mifos.mobile.core.model.entity.notification data class NotificationUserDetail( - var id: Int = 0, + val id: Int = 0, ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/AccountDetail.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/AccountDetail.kt similarity index 87% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/AccountDetail.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/AccountDetail.kt index aab08639b..9e8d225be 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/AccountDetail.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/AccountDetail.kt @@ -14,6 +14,6 @@ package org.mifos.mobile.core.model.entity.payload */ data class AccountDetail( - var accountNumber: String?, - var accountType: String?, + val accountNumber: String?, + val accountType: String?, ) diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/LoansPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/LoansPayload.kt new file mode 100644 index 000000000..ca8f4b68f --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/LoansPayload.kt @@ -0,0 +1,69 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.payload + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +/** + * Created by nellyk on 2/20/2016. + */ + +@Parcelize +data class LoansPayload( + + val clientId: Int? = null, + + val productId: Int? = null, + + val productName: String? = null, + + val principal: Double? = null, + + val loanTermFrequency: Int? = null, + + val loanTermFrequencyType: Int? = null, + + val loanType: String? = null, + + val numberOfRepayments: Int? = null, + + val repaymentEvery: Int? = null, + + val repaymentFrequencyType: Int? = null, + + val interestRatePerPeriod: Double? = null, + + val amortizationType: Int? = null, + + val interestType: Int? = null, + + val interestCalculationPeriodType: Int? = null, + + val transactionProcessingStrategyId: Int? = null, + + val expectedDisbursementDate: String? = null, + + val submittedOnDate: String? = null, + + val linkAccountId: Int? = null, + + val loanPurposeId: Int? = null, + + val loanPurpose: String? = null, + + val maxOutstandingLoanBalance: Double? = null, + + val currency: String? = null, + + val dateFormat: String = "dd MMMM yyyy", + + val locale: String = "en", +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/LoginPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/LoginPayload.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/LoginPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/LoginPayload.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/ReviewTransferPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/ReviewTransferPayload.kt similarity index 76% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/ReviewTransferPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/ReviewTransferPayload.kt index eef3040a9..5cf0eb812 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/ReviewTransferPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/ReviewTransferPayload.kt @@ -12,8 +12,8 @@ package org.mifos.mobile.core.model.entity.payload import org.mifos.mobile.core.model.entity.templates.account.AccountOption data class ReviewTransferPayload( - var payToAccount: AccountOption? = null, - var payFromAccount: AccountOption? = null, - var amount: String = "", - var review: String = "", + val payToAccount: AccountOption? = null, + val payFromAccount: AccountOption? = null, + val amount: String = "", + val review: String = "", ) diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/TransferPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/TransferPayload.kt new file mode 100644 index 000000000..7cff372f6 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/payload/TransferPayload.kt @@ -0,0 +1,54 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.payload + +import kotlinx.serialization.Transient +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +/** + * Created by Rajan Maurya on 10/03/17. + */ + +@Parcelize +data class TransferPayload( + val fromOfficeId: Int? = null, + + val fromClientId: Long? = null, + + val fromAccountType: Int? = null, + + val fromAccountId: Int? = null, + + val toOfficeId: Int? = null, + + val toClientId: Long? = null, + + val toAccountType: Int? = null, + + val toAccountId: Int? = null, + + val transferDate: String? = null, + + val transferAmount: Double? = null, + + val transferDescription: String? = null, + + val dateFormat: String = "dd MMMM yyyy", + + val locale: String = "en", + + @Transient + val fromAccountNumber: String? = null, + + @Transient + val toAccountNumber: String? = null, + +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/register/RegisterPayload.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/register/RegisterPayload.kt similarity index 61% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/register/RegisterPayload.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/register/RegisterPayload.kt index 3bc767a5d..718979cf0 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/register/RegisterPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/register/RegisterPayload.kt @@ -15,19 +15,19 @@ package org.mifos.mobile.core.model.entity.register data class RegisterPayload( - var username: String? = null, + val username: String? = null, - var firstName: String? = null, + val firstName: String? = null, - var lastName: String? = null, + val lastName: String? = null, - var email: String? = null, + val email: String? = null, - var mobileNumber: String? = null, + val mobileNumber: String? = null, - var accountNumber: String? = null, + val accountNumber: String? = null, - var password: String? = null, + val password: String? = null, - var authenticationMode: String? = null, + val authenticationMode: String? = null, ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/register/UserVerify.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/register/UserVerify.kt similarity index 84% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/register/UserVerify.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/register/UserVerify.kt index 8bdd6002a..687bd79cf 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/register/UserVerify.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/register/UserVerify.kt @@ -14,6 +14,6 @@ package org.mifos.mobile.core.model.entity.register */ data class UserVerify( - var requestId: String? = null, - var authenticationToken: String? = null, + val requestId: String? = null, + val authenticationToken: String? = null, ) diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountOption.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountOption.kt similarity index 59% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountOption.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountOption.kt index 777d2f768..d232c02ff 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountOption.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountOption.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.account -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 10/03/17. @@ -18,18 +18,18 @@ import kotlinx.parcelize.Parcelize @Parcelize data class AccountOption( - var accountId: Int? = null, + val accountId: Int? = null, - var accountNo: String? = null, + val accountNo: String? = null, - var accountType: AccountType? = null, + val accountType: AccountType? = null, - var clientId: Long? = null, + val clientId: Long? = null, - var clientName: String? = null, + val clientName: String? = null, - var officeId: Int? = null, + val officeId: Int? = null, - var officeName: String? = null, + val officeName: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountOptionsTemplate.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountOptionsTemplate.kt similarity index 59% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountOptionsTemplate.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountOptionsTemplate.kt index 463ab71c9..ef23ad27e 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountOptionsTemplate.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountOptionsTemplate.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.account -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 10/03/17. @@ -19,11 +19,11 @@ import kotlinx.parcelize.Parcelize @Parcelize data class AccountOptionsTemplate( - var fromAccountOptions: List = ArrayList(), + val fromAccountOptions: List = emptyList(), - var toAccountOptions: List = ArrayList(), + val toAccountOptions: List = emptyList(), - var fromAccountTypeOptions: List = ArrayList(), + val fromAccountTypeOptions: List = emptyList(), - var toAccountTypeOptions: List = ArrayList(), + val toAccountTypeOptions: List = emptyList(), ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountType.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountType.kt index df804ef2a..92042ff8e 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/account/AccountType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/account/AccountType.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.account -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 10/03/17. @@ -19,9 +19,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class AccountType( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/beneficiary/AccountTypeOption.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/beneficiary/AccountTypeOption.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/beneficiary/AccountTypeOption.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/beneficiary/AccountTypeOption.kt index d4b78be7d..6788da35a 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/beneficiary/AccountTypeOption.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/beneficiary/AccountTypeOption.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.beneficiary -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by dilpreet on 14/6/17. @@ -19,9 +19,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class AccountTypeOption( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt similarity index 76% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt index 5df1acae7..cca21f805 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.beneficiary -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by dilpreet on 14/6/17. @@ -18,5 +18,5 @@ import kotlinx.parcelize.Parcelize @Parcelize data class BeneficiaryTemplate( - var accountTypeOptions: List? = null, + val accountTypeOptions: List? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AccountLinkingOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AccountLinkingOptions.kt similarity index 57% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AccountLinkingOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AccountLinkingOptions.kt index 13fbc4f9f..7ccc16be8 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AccountLinkingOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AccountLinkingOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Tarun on 12/16/2016. @@ -19,19 +19,19 @@ import kotlinx.parcelize.Parcelize @Parcelize data class AccountLinkingOptions( - var accountNo: String? = null, + val accountNo: String? = null, - var clientId: Int? = null, + val clientId: Int? = null, - var clientName: String? = null, + val clientName: String? = null, - var currency: Currency? = null, + val currency: Currency? = null, - var fieldOfficerId: Int? = null, + val fieldOfficerId: Int? = null, - var id: Int? = null, + val id: Int? = null, - var productId: Int? = null, + val productId: Int? = null, - var productName: String? = null, + val productName: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AccountingRule.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AccountingRule.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AccountingRule.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AccountingRule.kt index 675ce0a8a..0086f37a8 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AccountingRule.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AccountingRule.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -18,9 +18,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class AccountingRule( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AllowAttributeOverrides.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AllowAttributeOverrides.kt similarity index 51% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AllowAttributeOverrides.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AllowAttributeOverrides.kt index 813dc78ef..1db244367 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AllowAttributeOverrides.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AllowAttributeOverrides.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,20 +19,20 @@ import kotlinx.parcelize.Parcelize @Parcelize data class AllowAttributeOverrides( - var amortizationType: Boolean? = null, + val amortizationType: Boolean? = null, - var interestType: Boolean? = null, + val interestType: Boolean? = null, - var transactionProcessingStrategyId: Boolean? = null, + val transactionProcessingStrategyId: Boolean? = null, - var interestCalculationPeriodType: Boolean? = null, + val interestCalculationPeriodType: Boolean? = null, - var inArrearsTolerance: Boolean? = null, + val inArrearsTolerance: Boolean? = null, - var repaymentEvery: Boolean? = null, + val repaymentEvery: Boolean? = null, - var graceOnPrincipalAndInterestPayment: Boolean? = null, + val graceOnPrincipalAndInterestPayment: Boolean? = null, - var graceOnArrearsAgeing: Boolean? = null, + val graceOnArrearsAgeing: Boolean? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AmortizationTypeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AmortizationTypeOptions.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AmortizationTypeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AmortizationTypeOptions.kt index e6f8566b5..25252130c 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/AmortizationTypeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/AmortizationTypeOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,9 +19,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class AmortizationTypeOptions( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargeAppliesTo.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargeAppliesTo.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargeAppliesTo.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargeAppliesTo.kt index 44e2c6c1c..b78f36e16 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargeAppliesTo.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargeAppliesTo.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,9 +19,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class ChargeAppliesTo( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargeOptions.kt similarity index 53% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargeOptions.kt index 5ca7351df..9d10dcd75 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargeOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize import org.mifos.mobile.core.model.entity.ChargeCalculationType import org.mifos.mobile.core.model.entity.ChargeTimeType @@ -21,26 +21,26 @@ import org.mifos.mobile.core.model.entity.ChargeTimeType @Parcelize data class ChargeOptions( - var id: Int? = null, + val id: Int? = null, - var name: String? = null, + val name: String? = null, - var active: Boolean? = null, + val active: Boolean? = null, - var penalty: Boolean? = null, + val penalty: Boolean? = null, - var currency: Currency? = null, + val currency: Currency? = null, - var amount: Double? = null, + val amount: Double? = null, - var chargeTimeType: ChargeTimeType? = null, + val chargeTimeType: ChargeTimeType? = null, - var chargeAppliesTo: ChargeAppliesTo? = null, + val chargeAppliesTo: ChargeAppliesTo? = null, - var chargeCalculationType: ChargeCalculationType? = null, + val chargeCalculationType: ChargeCalculationType? = null, - var chargePaymentMode: ChargePaymentMode? = null, + val chargePaymentMode: ChargePaymentMode? = null, - var taxGroup: TaxGroup? = null, + val taxGroup: TaxGroup? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargePaymentMode.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargePaymentMode.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargePaymentMode.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargePaymentMode.kt index 04a1ffc44..6645ce488 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ChargePaymentMode.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ChargePaymentMode.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,9 +19,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class ChargePaymentMode( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Currency.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Currency.kt similarity index 59% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Currency.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Currency.kt index a73969ed1..179c0c95f 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Currency.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Currency.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,17 +19,17 @@ import kotlinx.parcelize.Parcelize @Parcelize data class Currency( - var code: String? = null, + val code: String? = null, - var name: String? = null, + val name: String? = null, - var decimalPlaces: Double? = null, + val decimalPlaces: Double? = null, - var inMultiplesOf: Int? = null, + val inMultiplesOf: Int? = null, - var displaySymbol: String? = null, + val displaySymbol: String? = null, - var nameCode: String? = null, + val nameCode: String? = null, - var displayLabel: String? = null, + val displayLabel: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/FundOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/FundOptions.kt similarity index 76% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/FundOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/FundOptions.kt index a2063b881..0fa27ffe6 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/FundOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/FundOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,7 +19,7 @@ import kotlinx.parcelize.Parcelize @Parcelize data class FundOptions( - var id: Int? = null, + val id: Int? = null, - var name: String? = null, + val name: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/InterestRateFrequencyTypeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/InterestRateFrequencyTypeOptions.kt similarity index 74% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/InterestRateFrequencyTypeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/InterestRateFrequencyTypeOptions.kt index 2c325386c..138f39e30 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/InterestRateFrequencyTypeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/InterestRateFrequencyTypeOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,9 +19,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class InterestRateFrequencyTypeOptions( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/InterestTypeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/InterestTypeOptions.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/InterestTypeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/InterestTypeOptions.kt index d9c07b690..49c1ad882 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/InterestTypeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/InterestTypeOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,9 +19,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class InterestTypeOptions( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanCollateralOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanCollateralOptions.kt similarity index 66% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanCollateralOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanCollateralOptions.kt index 3164fd0e4..7a596dc22 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanCollateralOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanCollateralOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -19,13 +19,13 @@ import kotlinx.parcelize.Parcelize @Parcelize data class LoanCollateralOptions( - var id: Int? = null, + val id: Int? = null, - var name: String? = null, + val name: String? = null, - var position: Int? = null, + val position: Int? = null, - var description: String? = null, + val description: String? = null, - var active: Boolean? = null, + val active: Boolean? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanOfficerOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanOfficerOptions.kt new file mode 100644 index 000000000..4488029f3 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanOfficerOptions.kt @@ -0,0 +1,45 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.templates.loans + +import kotlinx.serialization.SerialName +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +/** + * Created by Rajan Maurya on 16/07/16. + */ + +@Parcelize +data class LoanOfficerOptions( + + val id: Int? = null, + + val firstname: String? = null, + + val lastname: String? = null, + + val displayName: String? = null, + + val mobileNo: String? = null, + + val officeId: Int? = null, + + val officeName: String? = null, + + @SerialName("isLoanOfficer") + val loanOfficer: Boolean? = null, + + @SerialName("isActive") + val active: Boolean? = null, + + val joiningDate: List? = null, + +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanPurposeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanPurposeOptions.kt similarity index 61% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanPurposeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanPurposeOptions.kt index f1c9f9239..b66a5c0eb 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanPurposeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanPurposeOptions.kt @@ -9,9 +9,9 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize +import kotlinx.serialization.SerialName +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -20,15 +20,15 @@ import kotlinx.parcelize.Parcelize @Parcelize data class LoanPurposeOptions( - var id: Int? = null, + val id: Int? = null, - var name: String? = null, + val name: String? = null, - var position: Int? = null, + val position: Int? = null, - var description: String? = null, + val description: String? = null, - @SerializedName("isActive") - var active: Boolean? = null, + @SerialName("isActive") + val active: Boolean? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanTemplate.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanTemplate.kt new file mode 100644 index 000000000..10f63d326 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/LoanTemplate.kt @@ -0,0 +1,158 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.templates.loans + +import kotlinx.serialization.SerialName +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.entity.accounts.loan.AmortizationType +import org.mifos.mobile.core.model.entity.accounts.loan.DaysInMonthType +import org.mifos.mobile.core.model.entity.accounts.loan.DaysInYearType +import org.mifos.mobile.core.model.entity.accounts.loan.InterestCalculationPeriodType +import org.mifos.mobile.core.model.entity.accounts.loan.InterestRateFrequencyType +import org.mifos.mobile.core.model.entity.accounts.loan.InterestType +import org.mifos.mobile.core.model.entity.accounts.loan.RepaymentFrequencyType +import org.mifos.mobile.core.model.entity.accounts.loan.TermPeriodFrequencyType + +/** + * Created by Rajan Maurya on 15/07/16. + */ + +@Parcelize +data class LoanTemplate( + + val clientId: Int? = null, + + val clientAccountNo: String? = null, + + val clientName: String? = null, + + val clientOfficeId: Int? = null, + + val loanProductName: String? = null, + + @SerialName("isLoanProductLinkedToFloatingRate") + val loanProductLinkedToFloatingRate: Boolean? = null, + + val fundId: Int? = null, + + val fundName: String? = null, + + val currency: Currency? = null, + + val principal: Double? = null, + + val approvedPrincipal: Double? = null, + + val proposedPrincipal: Double? = null, + + val termFrequency: Int? = null, + + val termPeriodFrequencyType: TermPeriodFrequencyType? = null, + + val numberOfRepayments: Int? = null, + + val repaymentEvery: Int? = null, + + val repaymentFrequencyType: RepaymentFrequencyType? = null, + + val interestRatePerPeriod: Double? = null, + + val interestRateFrequencyType: InterestRateFrequencyType? = null, + + val annualInterestRate: Double? = null, + + @SerialName("isFloatingInterestRate") + val floatingInterestRate: Boolean? = null, + + val amortizationType: AmortizationType? = null, + + val interestType: InterestType? = null, + + val interestCalculationPeriodType: InterestCalculationPeriodType? = null, + + val allowPartialPeriodInterestCalcualtion: Boolean? = null, + + val transactionProcessingStrategyId: Int? = null, + + val graceOnArrearsAgeing: Int? = null, + + val timeline: Timeline? = null, + + val productOptions: List = emptyList(), + + val loanOfficerOptions: List = emptyList(), + + val loanPurposeOptions: List = emptyList(), + + val fundOptions: List = emptyList(), + + val termFrequencyTypeOptions: List = emptyList(), + + val repaymentFrequencyTypeOptions: List = emptyList(), + + val repaymentFrequencyNthDayTypeOptions: List = emptyList(), + + val repaymentFrequencyDaysOfWeekTypeOptions: List = emptyList(), + + val interestRateFrequencyTypeOptions: List = emptyList(), + + val amortizationTypeOptions: List = emptyList(), + + val interestTypeOptions: List = emptyList(), + + val interestCalculationPeriodTypeOptions: List = emptyList(), + + val transactionProcessingStrategyOptions: List = emptyList(), + + val chargeOptions: List = emptyList(), + + val loanCollateralOptions: List = emptyList(), + + val multiDisburseLoan: Boolean? = null, + + val canDefineInstallmentAmount: Boolean? = null, + + val canDisburse: Boolean? = null, + + val product: Product? = null, + + val daysInMonthType: DaysInMonthType? = null, + + val daysInYearType: DaysInYearType? = null, + + @SerialName("isInterestRecalculationEnabled") + val interestRecalculationEnabled: Boolean? = null, + + @SerialName("isvaliableInstallmentsAllowed") + val valiableInstallmentsAllowed: Boolean? = null, + + val minimumGap: Int? = null, + + val maximumGap: Int? = null, + + val accountLinkingOptions: List = emptyList(), + +) : Parcelable { + /** + * Required to set default value to the Fund spinner + * + * @param fundId The value received from the Template for that particular loanProduct + * @return Returns the index of the fundOption list where the specified fundId is located + */ + fun getFundNameFromId(fundId: Int): Int { + for (i in fundOptions.indices) { + if (fundOptions[i].id == fundId) { + return i + } + } + return 0 + } +} diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Product.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Product.kt new file mode 100644 index 000000000..142de75ef --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Product.kt @@ -0,0 +1,130 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.templates.loans + +import kotlinx.serialization.SerialName +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize +import org.mifos.mobile.core.model.entity.accounts.loan.AmortizationType +import org.mifos.mobile.core.model.entity.accounts.loan.DaysInMonthType +import org.mifos.mobile.core.model.entity.accounts.loan.DaysInYearType +import org.mifos.mobile.core.model.entity.accounts.loan.InterestCalculationPeriodType +import org.mifos.mobile.core.model.entity.accounts.loan.InterestRateFrequencyType +import org.mifos.mobile.core.model.entity.accounts.loan.InterestRecalculationData +import org.mifos.mobile.core.model.entity.accounts.loan.InterestType +import org.mifos.mobile.core.model.entity.accounts.loan.RepaymentFrequencyType + +/** + * Created by Rajan Maurya on 16/07/16. + */ + +@Parcelize +data class Product( + + val id: Int? = null, + + val name: String? = null, + + val shortName: String? = null, + + val fundId: Int? = null, + + val fundName: String? = null, + + val includeInBorrowerCycle: Boolean? = null, + + val useBorrowerCycle: Boolean? = null, + + val startDate: List? = null, + + val status: String? = null, + + val currency: Currency? = null, + + val principal: Double? = null, + + val minPrincipal: Double? = null, + + val maxPrincipal: Double? = null, + + val numberOfRepayments: Int? = null, + + val minNumberOfRepayments: Int? = null, + + val maxNumberOfRepayments: Int? = null, + + val repaymentEvery: Int? = null, + + val repaymentFrequencyType: RepaymentFrequencyType? = null, + + val interestRatePerPeriod: Double? = null, + + val minInterestRatePerPeriod: Double? = null, + + val maxInterestRatePerPeriod: Double? = null, + + val interestRateFrequencyType: InterestRateFrequencyType? = null, + + val annualInterestRate: Double? = null, + + @SerialName("isLinkedToFloatingInterestRates") + val linkedToFloatingInterestRates: Boolean? = null, + + @SerialName("isFloatingInterestRateCalculationAllowed") + val floatingInterestRateCalculationAllowed: Boolean? = null, + + val allowvaliableInstallments: Boolean? = null, + + val minimumGap: Double? = null, + + val maximumGap: Double? = null, + + val amortizationType: AmortizationType, + + val interestType: InterestType, + + val interestCalculationPeriodType: InterestCalculationPeriodType? = null, + + val allowPartialPeriodInterestCalcualtion: Boolean? = null, + + val transactionProcessingStrategyId: Int? = null, + + val transactionProcessingStrategyName: String? = null, + + val graceOnArrearsAgeing: Int? = null, + + val overdueDaysForNPA: Int? = null, + + val daysInMonthType: DaysInMonthType? = null, + + val daysInYearType: DaysInYearType, + + @SerialName("isInterestRecalculationEnabled") + val interestRecalculationEnabled: Boolean? = null, + + val interestRecalculationData: InterestRecalculationData? = null, + + val canDefineInstallmentAmount: Boolean? = null, + + val accountingRule: AccountingRule? = null, + + val multiDisburseLoan: Boolean? = null, + + val maxTrancheCount: Int? = null, + + val principalThresholdForLastInstallment: Int? = null, + + val holdGuaranteeFunds: Boolean? = null, + + val accountMovesOutOfNPAOnlyOnArrearsCompletion: Boolean? = null, + + val allowAttributeOverrides: AllowAttributeOverrides? = null, + +) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ProductOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ProductOptions.kt new file mode 100644 index 000000000..41af18eba --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/ProductOptions.kt @@ -0,0 +1,47 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.templates.loans + +import kotlinx.serialization.SerialName +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +/** + * Created by Rajan Maurya on 16/07/16. + */ + +@Parcelize +data class ProductOptions( + + val id: Int? = null, + + val name: String? = null, + + val includeInBorrowerCycle: Boolean? = null, + + val useBorrowerCycle: Boolean? = null, + + @SerialName("isLinkedToFloatingInterestRates") + val linkedToFloatingInterestRates: Boolean? = null, + + @SerialName("isFloatingInterestRateCalculationAllowed") + val floatingInterestRateCalculationAllowed: Boolean? = null, + + val allowvaliableInstallments: Boolean? = null, + + @SerialName("isInterestRecalculationEnabled") + val interestRecalculationEnabled: Boolean? = null, + + val canDefineInstallmentAmount: Boolean? = null, + + val holdGuaranteeFunds: Boolean? = null, + + val accountMovesOutOfNPAOnlyOnArrearsCompletion: Boolean? = null, +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyDaysOfWeekTypeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyDaysOfWeekTypeOptions.kt similarity index 72% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyDaysOfWeekTypeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyDaysOfWeekTypeOptions.kt index 608fcdd01..4dd4aa0c1 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyDaysOfWeekTypeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyDaysOfWeekTypeOptions.kt @@ -9,15 +9,15 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class RepaymentFrequencyDaysOfWeekTypeOptions( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyNthDayTypeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyNthDayTypeOptions.kt similarity index 74% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyNthDayTypeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyNthDayTypeOptions.kt index bae54ff1e..2d25d392a 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyNthDayTypeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyNthDayTypeOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -18,9 +18,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class RepaymentFrequencyNthDayTypeOptions( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyTypeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyTypeOptions.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyTypeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyTypeOptions.kt index 753470d1b..b012b1e15 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyTypeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/RepaymentFrequencyTypeOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -18,9 +18,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class RepaymentFrequencyTypeOptions( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TaxGroup.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TaxGroup.kt similarity index 76% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TaxGroup.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TaxGroup.kt index 9cc691860..46dafa863 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TaxGroup.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TaxGroup.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -18,7 +18,7 @@ import kotlinx.parcelize.Parcelize @Parcelize data class TaxGroup( - var id: Int? = null, + val id: Int? = null, - var name: String? = null, + val name: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TermFrequencyTypeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TermFrequencyTypeOptions.kt similarity index 73% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TermFrequencyTypeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TermFrequencyTypeOptions.kt index 4da109917..99c835dbb 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TermFrequencyTypeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TermFrequencyTypeOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -18,9 +18,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class TermFrequencyTypeOptions( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var value: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Timeline.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Timeline.kt similarity index 77% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Timeline.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Timeline.kt index 85c618a50..e875d9417 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Timeline.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/Timeline.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -18,5 +18,5 @@ import kotlinx.parcelize.Parcelize @Parcelize data class Timeline( - var expectedDisbursementDate: List, + val expectedDisbursementDate: List, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TransactionProcessingStrategyOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TransactionProcessingStrategyOptions.kt similarity index 74% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TransactionProcessingStrategyOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TransactionProcessingStrategyOptions.kt index 2f6b81abd..31ea0d1b8 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/TransactionProcessingStrategyOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/loans/TransactionProcessingStrategyOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.loans -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /** * Created by Rajan Maurya on 16/07/16. @@ -18,9 +18,9 @@ import kotlinx.parcelize.Parcelize @Parcelize data class TransactionProcessingStrategyOptions( - var id: Int? = null, + val id: Int? = null, - var code: String? = null, + val code: String? = null, - var name: String? = null, + val name: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeAppliesTo.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeAppliesTo.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeAppliesTo.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeAppliesTo.kt index ea68571bf..8875e8706 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeAppliesTo.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeAppliesTo.kt @@ -9,12 +9,12 @@ */ package org.mifos.mobile.core.model.entity.templates.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class ChargeAppliesTo( - var id: Float = 0.toFloat(), - var code: String? = null, - var value: String? = null, + val id: Float = 0f, + val code: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeCalculationType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeCalculationType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeCalculationType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeCalculationType.kt index 96cd8d6bf..29d733816 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeCalculationType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeCalculationType.kt @@ -9,12 +9,12 @@ */ package org.mifos.mobile.core.model.entity.templates.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class ChargeCalculationType( - var id: Float = 0.toFloat(), - var code: String? = null, - var value: String? = null, + val id: Float = 0f, + val code: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeOptions.kt similarity index 51% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeOptions.kt index b293b6165..86636e928 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeOptions.kt @@ -9,20 +9,20 @@ */ package org.mifos.mobile.core.model.entity.templates.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize import org.mifos.mobile.core.model.entity.Currency @Parcelize data class ChargeOptions( - var id: Int? = null, - var name: String? = null, - var active: Boolean? = null, - var penalty: Boolean? = null, - var currency: Currency? = null, - var amount: Float = 0.toFloat(), - var chargeTimeType: ChargeTimeType, - var chargeAppliesTo: ChargeAppliesTo, - var chargeCalculationType: ChargeCalculationType, - var chargePaymentMode: ChargePaymentMode, + val id: Int? = null, + val name: String? = null, + val active: Boolean? = null, + val penalty: Boolean? = null, + val currency: Currency? = null, + val amount: Float = 0f, + val chargeTimeType: ChargeTimeType, + val chargeAppliesTo: ChargeAppliesTo, + val chargeCalculationType: ChargeCalculationType, + val chargePaymentMode: ChargePaymentMode, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargePaymentMode.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargePaymentMode.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargePaymentMode.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargePaymentMode.kt index 82d09f441..7482f19d4 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargePaymentMode.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargePaymentMode.kt @@ -9,12 +9,12 @@ */ package org.mifos.mobile.core.model.entity.templates.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class ChargePaymentMode( - var id: Float = 0.toFloat(), - var code: String? = null, - var value: String? = null, + val id: Float = 0f, + val code: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeTimeType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeTimeType.kt similarity index 71% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeTimeType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeTimeType.kt index 121600af0..d269850c2 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ChargeTimeType.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ChargeTimeType.kt @@ -9,12 +9,12 @@ */ package org.mifos.mobile.core.model.entity.templates.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize @Parcelize data class ChargeTimeType( - var id: Float = 0.toFloat(), - var code: String? = null, - var value: String? = null, + val id: Float = 0f, + val code: String? = null, + val value: String? = null, ) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ProductOptions.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ProductOptions.kt similarity index 76% rename from core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ProductOptions.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ProductOptions.kt index 426398fe7..e4024bcd7 100644 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/ProductOptions.kt +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/ProductOptions.kt @@ -9,8 +9,8 @@ */ package org.mifos.mobile.core.model.entity.templates.savings -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize /* * Created by saksham on 01/July/2018 @@ -18,6 +18,6 @@ import kotlinx.parcelize.Parcelize @Parcelize data class ProductOptions( - var id: Int? = null, - var name: String? = null, + val id: Int? = null, + val name: String? = null, ) : Parcelable diff --git a/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/SavingsAccountTemplate.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/SavingsAccountTemplate.kt new file mode 100644 index 000000000..1c2e0ff0b --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/templates/savings/SavingsAccountTemplate.kt @@ -0,0 +1,30 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model.entity.templates.savings + +/* + * Created by saksham on 01/July/2018 + */ + +import org.mifos.mobile.core.model.Parcelable +import org.mifos.mobile.core.model.Parcelize + +@Parcelize +data class SavingsAccountTemplate( + val clientId: Int = 0, + val clientName: String? = null, + val withdrawalFeeForTransfers: Boolean? = null, + val allowOverdraft: Boolean? = null, + val enforceMinRequiredBalance: Boolean? = null, + val withHoldTax: Boolean? = null, + val isDormancyTrackingActive: Boolean? = null, + val productOptions: ArrayList = arrayListOf(), + val chargeOptions: ArrayList = arrayListOf(), +) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/AboutUsListItemId.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/AboutUsListItemId.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/AboutUsListItemId.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/AboutUsListItemId.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/AccountType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/AccountType.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/AccountType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/AccountType.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/AppTheme.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/AppTheme.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/AppTheme.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/AppTheme.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/BeneficiaryState.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/BeneficiaryState.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/BeneficiaryState.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/BeneficiaryState.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/BiometricCapability.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/BiometricCapability.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/BiometricCapability.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/BiometricCapability.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/ChargeType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/ChargeType.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/ChargeType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/ChargeType.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/GuarantorState.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/GuarantorState.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/GuarantorState.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/GuarantorState.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/LoanState.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/LoanState.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/LoanState.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/LoanState.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/MifosAppLanguage.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/MifosAppLanguage.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/MifosAppLanguage.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/MifosAppLanguage.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/RequestAccessType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/RequestAccessType.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/RequestAccessType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/RequestAccessType.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/SavingsAccountState.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/SavingsAccountState.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/SavingsAccountState.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/SavingsAccountState.kt diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/enums/TransferType.kt b/core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/TransferType.kt similarity index 100% rename from core/model/src/main/java/org/mifos/mobile/core/model/enums/TransferType.kt rename to core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/enums/TransferType.kt diff --git a/core/model/src/desktopMain/kotlin/org/mifos/mobile/core/model/Parcelize.desktop.kt b/core/model/src/desktopMain/kotlin/org/mifos/mobile/core/model/Parcelize.desktop.kt new file mode 100644 index 000000000..b5dd3dad5 --- /dev/null +++ b/core/model/src/desktopMain/kotlin/org/mifos/mobile/core/model/Parcelize.desktop.kt @@ -0,0 +1,17 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model + +actual interface Parcelable + +actual annotation class IgnoredOnParcel + +@Target(AnnotationTarget.TYPE) +actual annotation class RawValue actual constructor() diff --git a/core/model/src/jsMain/kotlin/org/mifos/mobile/core/model/Parcelize.js.kt b/core/model/src/jsMain/kotlin/org/mifos/mobile/core/model/Parcelize.js.kt new file mode 100644 index 000000000..b5dd3dad5 --- /dev/null +++ b/core/model/src/jsMain/kotlin/org/mifos/mobile/core/model/Parcelize.js.kt @@ -0,0 +1,17 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model + +actual interface Parcelable + +actual annotation class IgnoredOnParcel + +@Target(AnnotationTarget.TYPE) +actual annotation class RawValue actual constructor() diff --git a/core/model/src/main/AndroidManifest.xml b/core/model/src/main/AndroidManifest.xml deleted file mode 100644 index 4ee22a4fb..000000000 --- a/core/model/src/main/AndroidManifest.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/Account.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/Account.kt deleted file mode 100644 index 5512b8887..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/Account.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts - -/** - * This class contains variables which are used for implementing Comparator and are common to loan, - * savings and share account. - * Created by dilpreet on 14/6/17. - */ -abstract class Account { - var id: Long = 0 -} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationData.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationData.kt deleted file mode 100644 index 79ca2d93f..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/InterestRecalculationData.kt +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.loan - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.model.entity.accounts.loan.calendardata.CalendarData - -@Parcelize -data class InterestRecalculationData( - var id: Int? = null, - - var loanId: Int? = null, - - var interestRecalculationCompoundingType: InterestRecalculationCompoundingType? = null, - - var rescheduleStrategyType: RescheduleStrategyType? = null, - - var calendarData: CalendarData, - - var recalculationRestFrequencyType: RecalculationRestFrequencyType? = null, - - var recalculationRestFrequencyInterval: Double? = null, - - var recalculationCompoundingFrequencyType: RecalculationCompoundingFrequencyType? = null, - - @SerializedName("isCompoundingToBePostedAsTransaction") - var compoundingToBePostedAsTransaction: Boolean? = null, - - var allowCompoundingOnEod: Boolean? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanAccount.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanAccount.kt deleted file mode 100644 index 432c21cfa..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanAccount.kt +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.loan - -import android.os.Parcel -import android.os.Parcelable -import org.mifos.mobile.core.model.entity.accounts.Account - -data class LoanAccount( - var loanProductId: Long = 0, - - var externalId: String? = null, - - var numberOfRepayments: Long = 0, - - var accountNo: String? = null, - - var productName: String? = null, - - var productId: Int? = null, - - var loanProductName: String? = null, - - var clientName: String? = null, - - var loanProductDescription: String? = null, - - var principal: Double = 0.toDouble(), - - var annualInterestRate: Double = 0.toDouble(), - - var status: Status? = null, - - var loanType: LoanType? = null, - - var loanCycle: Int? = null, - - var loanBalance: Double = 0.toDouble(), - - var amountPaid: Double = 0.toDouble(), - - var currency: Currency?, - - var inArrears: Boolean? = null, - - var summary: Summary? = null, - - var loanPurposeName: String? = null, - - var timeline: Timeline?, - -) : Account(), Parcelable { - constructor(parcel: Parcel) : this( - parcel.readLong(), - parcel.readString(), - parcel.readLong(), - parcel.readString(), - parcel.readString(), - parcel.readValue(Int::class.java.classLoader) as? Int, - parcel.readString(), - parcel.readString(), - parcel.readString(), - parcel.readDouble(), - parcel.readDouble(), - parcel.readParcelable(Status::class.java.classLoader), - parcel.readParcelable(LoanType::class.java.classLoader), - parcel.readValue(Int::class.java.classLoader) as? Int, - parcel.readDouble(), - parcel.readDouble(), - parcel.readParcelable(Currency::class.java.classLoader), - parcel.readValue(Boolean::class.java.classLoader) as? Boolean, - parcel.readParcelable(Summary::class.java.classLoader), - parcel.readString(), - parcel.readParcelable(Timeline::class.java.classLoader), - ) - - override fun writeToParcel(parcel: Parcel, flags: Int) { - parcel.writeLong(loanProductId) - parcel.writeString(externalId) - parcel.writeLong(numberOfRepayments) - parcel.writeString(accountNo) - parcel.writeString(productName) - parcel.writeValue(productId) - parcel.writeString(loanProductName) - parcel.writeString(clientName) - parcel.writeString(loanProductDescription) - parcel.writeDouble(principal) - parcel.writeDouble(annualInterestRate) - parcel.writeParcelable(status, flags) - parcel.writeParcelable(loanType, flags) - parcel.writeValue(loanCycle) - parcel.writeDouble(loanBalance) - parcel.writeDouble(amountPaid) - parcel.writeParcelable(currency, flags) - parcel.writeValue(inArrears) - parcel.writeParcelable(summary, flags) - parcel.writeString(loanPurposeName) - parcel.writeParcelable(timeline, flags) - } - - override fun describeContents(): Int { - return 0 - } - - companion object { - - @JvmField - val CREATOR: Parcelable.Creator = object : Parcelable.Creator { - - override fun createFromParcel(parcel: Parcel): LoanAccount { - return LoanAccount(parcel) - } - - override fun newArray(size: Int): Array { - return arrayOfNulls(size) - } - } - } -} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithAssociations.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithAssociations.kt deleted file mode 100644 index feb8f1d45..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/LoanWithAssociations.kt +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.loan - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.model.entity.Transaction - -@Parcelize -data class LoanWithAssociations( - var id: Int? = null, - - var accountNo: String? = null, - - var externalId: String? = null, - - var status: Status? = null, - - var clientId: Int? = null, - - var clientAccountNo: String? = null, - - var clientName: String? = null, - - var clientOfficeId: Int? = null, - - var loanProductId: Int? = null, - - var loanProductName: String? = null, - - @SerializedName("isLoanProductLinkedToFloatingRate") - var loanProductLinkedToFloatingRate: Boolean? = null, - - var loanType: LoanType? = null, - - var currency: Currency? = null, - - var principal: Double? = null, - - var approvedPrincipal: Double? = null, - - var proposedPrincipal: Double? = null, - - var termFrequency: Int? = null, - - var termPeriodFrequencyType: TermPeriodFrequencyType? = null, - - var numberOfRepayments: Int? = null, - - var repaymentEvery: Int? = null, - - var repaymentFrequencyType: RepaymentFrequencyType? = null, - - var interestRatePerPeriod: Int? = null, - - var interestRateFrequencyType: InterestRateFrequencyType? = null, - - @SerializedName("isFloatingInterestRate") - var floatingInterestRate: Boolean? = null, - - var amortizationType: AmortizationType? = null, - - var interestType: InterestType? = null, - - var interestCalculationPeriodType: InterestCalculationPeriodType? = null, - - var allowPartialPeriodInterestCalcualtion: Boolean? = null, - - var transactionProcessingStrategyId: Int? = null, - - var transactionProcessingStrategyName: String? = null, - - var syncDisbursementWithMeeting: Boolean? = null, - - var timeline: Timeline? = null, - - var summary: Summary? = null, - - var repaymentSchedule: RepaymentSchedule? = null, - - var feeChargesAtDisbursementCharged: Double? = null, - - var loanProductCounter: Int? = null, - - var multiDisburseLoan: Boolean? = null, - - var canDefineInstallmentAmount: Boolean? = null, - - var canDisburse: Boolean? = null, - - var canUseForTopup: Boolean? = null, - - @SerializedName("isTopup") - var topup: Boolean? = null, - - var closureLoanId: Int? = null, - - var inArrears: Boolean? = null, - - @SerializedName("isNPA") - var npa: Boolean? = null, - - var daysInMonthType: DaysInMonthType? = null, - - var daysInYearType: DaysInYearType? = null, - - @SerializedName("isInterestRecalculationEnabled") - var interestRecalculationEnabled: Boolean? = null, - - var interestRecalculationData: InterestRecalculationData? = null, - - var createStandingInstructionAtDisbursement: Boolean? = null, - - @SerializedName("isVariableInstallmentsAllowed") - var variableInstallmentsAllowed: Boolean? = null, - - var minimumGap: Int? = null, - - var maximumGap: Int? = null, - - var transactions: MutableList? = ArrayList(), - - var loanPurposeName: String? = null, -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Periods.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Periods.kt deleted file mode 100644 index b964c3214..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Periods.kt +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.loan - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Periods( - var period: Int? = null, - - var fromDate: List = ArrayList(), - - var dueDate: List = ArrayList(), - - var obligationsMetOnDate: List = ArrayList(), - - var principalDisbursed: Double? = null, - - var complete: Boolean? = null, - - var daysInPeriod: Int? = null, - - var principalOriginalDue: Double? = null, - - var principalDue: Double? = null, - - var principalPaid: Double? = null, - - var principalWrittenOff: Double? = null, - - var principalOutstanding: Double? = null, - - var principalLoanBalanceOutstanding: Double? = null, - - var interestOriginalDue: Double? = null, - - var interestDue: Double? = null, - - var interestPaid: Double? = null, - - var interestWaived: Double? = null, - - var interestWrittenOff: Double? = null, - - var interestOutstanding: Double? = null, - - var feeChargesDue: Double? = null, - - var feeChargesPaid: Double? = null, - - var feeChargesWaived: Double? = null, - - var feeChargesWrittenOff: Double? = null, - - var feeChargesOutstanding: Double? = null, - - var penaltyChargesDue: Double? = null, - - var penaltyChargesPaid: Double? = null, - - var penaltyChargesWaived: Double? = null, - - var penaltyChargesWrittenOff: Double? = null, - - var penaltyChargesOutstanding: Double? = null, - - var totalOriginalDueForPeriod: Double? = null, - - var totalDueForPeriod: Double? = null, - - var totalPaidForPeriod: Double? = null, - - var totalPaidInAdvanceForPeriod: Double? = null, - - var totalPaidLateForPeriod: Double? = null, - - var totalWaivedForPeriod: Double? = null, - - var totalWrittenOffForPeriod: Double? = null, - - var totalOutstandingForPeriod: Double? = null, - - var totalOverdue: Double? = null, - - var totalActualCostOfLoanForPeriod: Double? = null, - - var totalInstallmentAmountForPeriod: Double? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentSchedule.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentSchedule.kt deleted file mode 100644 index 0781d95a8..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/RepaymentSchedule.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.loan - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class RepaymentSchedule( - var currency: Currency? = null, - - var loanTermInDays: Int? = null, - - var totalPrincipalDisbursed: Double? = null, - - var totalPrincipalExpected: Double? = null, - - var totalPrincipalPaid: Double? = null, - - var totalInterestCharged: Double? = null, - - var totalFeeChargesCharged: Double? = null, - - var totalPenaltyChargesCharged: Double? = null, - - var totalWaived: Double? = null, - - var totalWrittenOff: Double? = null, - - var totalRepaymentExpected: Double? = null, - - var totalRepayment: Double? = null, - - var totalPaidInAdvance: Double? = null, - - var totalPaidLate: Double? = null, - - var totalOutstanding: Double? = null, - - var periods: List = ArrayList(), - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Summary.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Summary.kt deleted file mode 100644 index c2abf8fbc..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Summary.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.loan - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Summary( - var principalDisbursed: Double = 0.toDouble(), - - var principalPaid: Double = 0.toDouble(), - - var interestCharged: Double = 0.toDouble(), - - var interestPaid: Double = 0.toDouble(), - - var feeChargesCharged: Double = 0.toDouble(), - - var penaltyChargesCharged: Double = 0.toDouble(), - - var penaltyChargesWaived: Double = 0.toDouble(), - - var totalExpectedRepayment: Double = 0.toDouble(), - - var interestWaived: Double = 0.toDouble(), - - var totalRepayment: Double = 0.toDouble(), - - var feeChargesWaived: Double = 0.toDouble(), - - var totalOutstanding: Double = 0.toDouble(), - - private var overdueSinceDate: List? = null, - - var currency: Currency? = null, -) : Parcelable { - - fun getOverdueSinceDate(): List? { - return if (overdueSinceDate == null) { - null - } else { - overdueSinceDate - } - } -} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Timeline.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Timeline.kt deleted file mode 100644 index 49d780426..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/Timeline.kt +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.loan - -import android.os.Parcel -import android.os.Parcelable - -@Suppress("ktlint:standard:property-naming") -data class Timeline( - var submittedOnDate: List? = null, - - var submittedByUsername: String?, - - var submittedByFirstname: String?, - - var submittedByLastname: String?, - - var approvedOnDate: List? = null, - - var approvedByUsername: String?, - - var approvedByFirstname: String?, - - var approvedByLastname: String?, - - var expectedDisbursementDate: List? = null, - - var actualDisbursementDate: List? = null, - - var disbursedByUsername: String?, - - var disbursedByFirstname: String?, - - var disbursedByLastname: String?, - - var closedOnDate: List? = null, - - var expectedMaturityDate: List? = null, - - var withdrawnOnDate: List, - -) : Parcelable { - constructor(parcel: Parcel) : this( - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - parcel.readString(), - parcel.readString(), - parcel.readString(), - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - parcel.readString(), - parcel.readString(), - parcel.readString(), - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - parcel.readString(), - parcel.readString(), - parcel.readString(), - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - ) - - override fun writeToParcel(parcel: Parcel, flags: Int) { - parcel.writeList(submittedOnDate) - parcel.writeString(submittedByUsername) - parcel.writeString(submittedByFirstname) - parcel.writeString(submittedByLastname) - parcel.writeList(approvedOnDate) - parcel.writeString(approvedByUsername) - parcel.writeString(approvedByFirstname) - parcel.writeString(approvedByLastname) - parcel.writeList(expectedDisbursementDate) - parcel.writeList(actualDisbursementDate) - parcel.writeString(disbursedByUsername) - parcel.writeString(disbursedByFirstname) - parcel.writeString(disbursedByLastname) - parcel.writeList(closedOnDate) - parcel.writeList(expectedMaturityDate) - parcel.writeList(withdrawnOnDate) - } - - override fun describeContents(): Int { - return 0 - } - - companion object { - - @JvmField - var CREATOR: Parcelable.Creator = object : Parcelable.Creator { - override fun createFromParcel(parcel: Parcel): Timeline { - return Timeline(parcel) - } - - override fun newArray(size: Int): Array { - return arrayOfNulls(size) - } - } - } -} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/CalendarData.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/CalendarData.kt deleted file mode 100644 index e6bfc806f..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/loan/calendardata/CalendarData.kt +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.loan.calendardata - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class CalendarData( - var id: Int? = null, - - var calendarInstanceId: Int? = null, - - var entityId: Int? = null, - - var entityType: EntityType, - - var title: String? = null, - - var startDate: List = ArrayList(), - - var endDate: List = ArrayList(), - - var duration: Double? = null, - - var type: Type, - - var repeating: Boolean? = null, - - var recurrence: String? = null, - - var frequency: Frequency, - - var interval: Double? = null, - - var repeatsOnNthDayOfMonth: RepeatsOnNthDayOfMonth, - - var firstReminder: Int? = null, - - var secondReminder: Int? = null, - - var humanReadable: String? = null, - - var createdDate: List = ArrayList(), - - var lastUpdatedDate: List = ArrayList(), - - var createdByUserId: Int? = null, - - var createdByUsername: String? = null, - - var lastUpdatedByUserId: Int? = null, - - var lastUpdatedByUsername: String? = null, -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingAccount.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingAccount.kt deleted file mode 100644 index 407e32a18..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingAccount.kt +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.savings - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.model.entity.accounts.Account -import org.mifos.mobile.core.model.entity.client.DepositType - -@Parcelize -data class SavingAccount( - - var accountNo: String? = null, - - var productName: String? = null, - - var productId: Int? = null, - - var overdraftLimit: Long = 0, - - var minRequiredBalance: Long = 0, - - var accountBalance: Double = 0.toDouble(), - - var totalDeposits: Double = 0.toDouble(), - - var savingsProductName: String? = null, - - var clientName: String? = null, - - var savingsProductId: String? = null, - - var nominalAnnualInterestRate: Double = 0.toDouble(), - - var status: Status? = null, - - var currency: Currency? = null, - - var depositType: DepositType? = null, - - var lastActiveTransactionDate: List? = null, - - var timeLine: TimeLine? = null, -) : Parcelable, Account() { - fun isRecurring(): Boolean { - return this.depositType != null && (this.depositType?.isRecurring() == true) - } -} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsWithAssociations.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsWithAssociations.kt deleted file mode 100644 index 7f5f0cc1c..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/SavingsWithAssociations.kt +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.savings - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.model.entity.client.DepositType - -@Parcelize -data class SavingsWithAssociations( - - var id: Long? = null, - - var accountNo: String? = null, - - var depositType: DepositType? = null, - - var externalId: String? = null, - - var clientId: Int? = null, - - var clientName: String? = null, - - var savingsProductId: Int? = null, - - var savingsProductName: String? = null, - - var fieldOfficerId: Int? = null, - - var status: Status? = null, - - var timeline: TimeLine? = null, - - var currency: Currency? = null, - - internal var nominalAnnualInterestRate: Double? = null, - - var minRequiredOpeningBalance: Double? = null, - - var lockinPeriodFrequency: Double? = null, - - var withdrawalFeeForTransfers: Boolean? = null, - - var allowOverdraft: Boolean? = null, - - var enforceMinRequiredBalance: Boolean? = null, - - var withHoldTax: Boolean? = null, - - var lastActiveTransactionDate: List? = null, - - var dormancyTrackingActive: Boolean? = null, - - var summary: Summary? = null, - - var transactions: List = ArrayList(), - -) : Parcelable { - - fun isRecurring(): Boolean { - return this.depositType != null && (this.depositType?.isRecurring() == true) - } - - fun setNominalAnnualInterestRate(nominalAnnualInterestRate: Double?) { - this.nominalAnnualInterestRate = nominalAnnualInterestRate - } - - fun getNominalAnnualInterestRate(): Double { - return nominalAnnualInterestRate!! - } - - fun setNominalAnnualInterestRate(nominalAnnualInterestRate: Double) { - this.nominalAnnualInterestRate = nominalAnnualInterestRate - } -} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Status.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Status.kt deleted file mode 100644 index 46db557de..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Status.kt +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.savings - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Status( - var id: Int? = null, - var code: String? = null, - - var value: String? = null, - - var submittedAndPendingApproval: Boolean? = null, - - var approved: Boolean? = null, - - var rejected: Boolean? = null, - - var withdrawnByApplicant: Boolean? = null, - - var active: Boolean? = null, - - var closed: Boolean? = null, - - var prematureClosed: Boolean? = null, - - internal var transferInProgress: Boolean? = null, - - internal var transferOnHold: Boolean? = null, - - var matured: Boolean? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Summary.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Summary.kt deleted file mode 100644 index 738d7d563..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Summary.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.savings - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Summary( - - var currency: Currency? = null, - - var totalDeposits: Double? = null, - - var totalWithdrawals: Double? = null, - - var totalInterestEarned: Double? = null, - - var totalInterestPosted: Double? = null, - - var accountBalance: Double? = null, - - var totalOverdraftInterestDerived: Double? = null, - - var interestNotPosted: Double? = null, - - var lastInterestCalculationDate: List = ArrayList(), - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/TimeLine.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/TimeLine.kt deleted file mode 100644 index 12d87fd29..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/TimeLine.kt +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.savings - -import android.os.Parcel -import android.os.Parcelable - -data class TimeLine( - var submittedOnDate: List = ArrayList(), - - var submittedByUsername: String?, - - var submittedByFirstname: String?, - - var submittedByLastname: String?, - - var approvedOnDate: List = ArrayList(), - - var approvedByUsername: String?, - - var approvedByFirstname: String?, - - var approvedByLastname: String?, - - var activatedOnDate: List? = null, - - var activatedByUsername: String?, - - var activatedByFirstname: String?, - - var activatedByLastname: String?, - - var closedOnDate: List, - -) : Parcelable { - constructor(parcel: Parcel) : this( - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - parcel.readString(), - parcel.readString(), - parcel.readString(), - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - parcel.readString(), - parcel.readString(), - parcel.readString(), - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - parcel.readString(), - parcel.readString(), - parcel.readString(), - arrayListOf().apply { - parcel.readArrayList(Int::class.java.classLoader) - }, - ) - - override fun writeToParcel(parcel: Parcel, flags: Int) { - parcel.writeList(submittedOnDate) - parcel.writeString(submittedByUsername) - parcel.writeString(submittedByFirstname) - parcel.writeString(submittedByLastname) - parcel.writeList(approvedOnDate) - parcel.writeString(approvedByUsername) - parcel.writeString(approvedByFirstname) - parcel.writeString(approvedByLastname) - parcel.writeList(activatedOnDate) - parcel.writeString(activatedByUsername) - parcel.writeString(activatedByFirstname) - parcel.writeString(activatedByLastname) - parcel.writeList(closedOnDate) - } - - override fun describeContents(): Int { - return 0 - } - - companion object { - - @JvmField - val CREATOR: Parcelable.Creator = object : Parcelable.Creator { - override fun createFromParcel(parcel: Parcel): TimeLine { - return TimeLine(parcel) - } - - override fun newArray(size: Int): Array { - return arrayOfNulls(size) - } - } - } -} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/TransactionType.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/TransactionType.kt deleted file mode 100644 index cdecc297e..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/TransactionType.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.savings - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class TransactionType( - var id: Int? = null, - var code: String? = null, - - var value: String? = null, - - var deposit: Boolean? = null, - - var dividendPayout: Boolean? = null, - - var withdrawal: Boolean? = null, - - var interestPosting: Boolean? = null, - - var feeDeduction: Boolean? = null, - - var initiateTransfer: Boolean? = null, - - var approveTransfer: Boolean? = null, - - var withdrawTransfer: Boolean? = null, - - var rejectTransfer: Boolean? = null, - - var overdraftInterest: Boolean? = null, - - var writtenoff: Boolean? = null, - - var overdraftFee: Boolean? = null, - - var withholdTax: Boolean? = null, - - var escheat: Boolean? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Transactions.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Transactions.kt deleted file mode 100644 index a554faa51..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/savings/Transactions.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.savings - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Transactions( - var id: Int? = null, - - var transactionType: TransactionType? = null, - - var accountId: Int? = null, - - var accountNo: String? = null, - - var date: List = ArrayList(), - - var currency: Currency? = null, - - var paymentDetailData: PaymentDetailData? = null, - - var amount: Double? = null, - - var runningBalance: Double? = null, - - var reversed: Boolean? = null, - - var submittedOnDate: List? = null, - - var interestedPostedAsOn: Boolean? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/ShareAccount.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/ShareAccount.kt deleted file mode 100644 index a8de034e8..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/ShareAccount.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.share - -import android.os.Parcelable -import com.google.gson.annotations.Expose -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.model.entity.accounts.Account -import org.mifos.mobile.core.model.entity.accounts.savings.Currency - -@Parcelize -data class ShareAccount( - - @Expose - var accountNo: String? = null, - - @Expose - var totalApprovedShares: Int? = null, - - @Expose - var totalPendingForApprovalShares: Int? = null, - - @Expose - var productId: Int? = null, - - @Expose - var productName: String? = null, - - @Expose - var shortProductName: String? = null, - - @Expose - var status: Status? = null, - - @Expose - var currency: Currency? = null, - - @Expose - var timeline: Timeline? = null, - -) : Account(), Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/Status.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/Status.kt deleted file mode 100644 index b17c13391..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/Status.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.share - -import android.os.Parcelable -import com.google.gson.annotations.Expose -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Status( - @Expose - var id: Int? = null, - @Expose - var code: String? = null, - - @Expose - var value: String? = null, - - @Expose - var submittedAndPendingApproval: Boolean? = null, - - @Expose - var approved: Boolean? = null, - - @Expose - var rejected: Boolean? = null, - - @Expose - var active: Boolean? = null, - - @Expose - var closed: Boolean? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/Timeline.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/Timeline.kt deleted file mode 100644 index 187fa90b0..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/accounts/share/Timeline.kt +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.accounts.share - -import android.os.Parcelable -import com.google.gson.annotations.Expose -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Timeline( - @Expose - var submittedOnDate: List? = null, - - @Expose - var submittedByUsername: String? = null, - - @Expose - var submittedByFirstname: String? = null, - - @Expose - var submittedByLastname: String? = null, - - @Expose - var approvedDate: List? = null, - - @Expose - var approvedByUsername: String? = null, - - @Expose - var approvedByFirstname: String? = null, - - @Expose - var approvedByLastname: String? = null, - - @Expose - var activatedDate: List? = null, - - @Expose - var activatedByUsername: String? = null, - - @Expose - var activatedByFirstname: String? = null, - - @Expose - var activatedByLastname: String? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Client.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Client.kt deleted file mode 100644 index e6bcae81c..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/client/Client.kt +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.client - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.model.entity.Timeline - -@Parcelize -data class Client( - var id: Int = 0, - - var accountNo: String? = null, - - private var status: Status? = null, - - private var active: Boolean? = null, - - var activationDate: List = ArrayList(), - - var dobDate: List = ArrayList(), - - var firstname: String? = null, - - var middlename: String? = null, - - var lastname: String? = null, - - var displayName: String? = null, - - var fullname: String? = null, - - private var officeId: Int? = null, - - var officeName: String? = null, - - private var staffId: Int? = null, - - private var staffName: String? = null, - - private var timeline: Timeline? = null, - - var imageId: Int = 0, - - var isImagePresent: Boolean = false, - - private var externalId: String? = null, - - var mobileNo: String? = null, - - var clientClassification: ClientClassification? = null, - - var clientType: ClientType? = null, - - var gender: Gender? = null, - - var groups: List = ArrayList(), -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/LoansPayload.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/LoansPayload.kt deleted file mode 100644 index 696c7a4d5..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/LoansPayload.kt +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.payload - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -/** - * Created by nellyk on 2/20/2016. - */ - -@Parcelize -data class LoansPayload( - - var clientId: Int? = null, - - var productId: Int? = null, - - var productName: String? = null, - - var principal: Double? = null, - - var loanTermFrequency: Int? = null, - - var loanTermFrequencyType: Int? = null, - - var loanType: String? = null, - - var numberOfRepayments: Int? = null, - - var repaymentEvery: Int? = null, - - var repaymentFrequencyType: Int? = null, - - var interestRatePerPeriod: Double? = null, - - var amortizationType: Int? = null, - - var interestType: Int? = null, - - var interestCalculationPeriodType: Int? = null, - - var transactionProcessingStrategyId: Int? = null, - - var expectedDisbursementDate: String? = null, - - var submittedOnDate: String? = null, - - var linkAccountId: Int? = null, - - var loanPurposeId: Int? = null, - - var loanPurpose: String? = null, - - var maxOutstandingLoanBalance: Double? = null, - - var currency: String? = null, - - var dateFormat: String = "dd MMMM yyyy", - - var locale: String = "en", -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/TransferPayload.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/TransferPayload.kt deleted file mode 100644 index 2144c423c..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/payload/TransferPayload.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.payload - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -/** - * Created by Rajan Maurya on 10/03/17. - */ - -@Parcelize -data class TransferPayload( - var fromOfficeId: Int? = null, - - var fromClientId: Long? = null, - - var fromAccountType: Int? = null, - - var fromAccountId: Int? = null, - - var toOfficeId: Int? = null, - - var toClientId: Long? = null, - - var toAccountType: Int? = null, - - var toAccountId: Int? = null, - - var transferDate: String? = null, - - var transferAmount: Double? = null, - - var transferDescription: String? = null, - - var dateFormat: String = "dd MMMM yyyy", - - var locale: String = "en", - - @Transient - var fromAccountNumber: String? = null, - - @Transient - var toAccountNumber: String? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanOfficerOptions.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanOfficerOptions.kt deleted file mode 100644 index 70ced22ad..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanOfficerOptions.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.templates.loans - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -/** - * Created by Rajan Maurya on 16/07/16. - */ - -@Parcelize -data class LoanOfficerOptions( - - var id: Int? = null, - - var firstname: String? = null, - - var lastname: String? = null, - - var displayName: String? = null, - - var mobileNo: String? = null, - - var officeId: Int? = null, - - var officeName: String? = null, - - @SerializedName("isLoanOfficer") - var loanOfficer: Boolean? = null, - - @SerializedName("isActive") - var active: Boolean? = null, - - var joiningDate: List? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanTemplate.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanTemplate.kt deleted file mode 100644 index 9e824d657..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/LoanTemplate.kt +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.templates.loans - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.model.entity.accounts.loan.AmortizationType -import org.mifos.mobile.core.model.entity.accounts.loan.DaysInMonthType -import org.mifos.mobile.core.model.entity.accounts.loan.DaysInYearType -import org.mifos.mobile.core.model.entity.accounts.loan.InterestCalculationPeriodType -import org.mifos.mobile.core.model.entity.accounts.loan.InterestRateFrequencyType -import org.mifos.mobile.core.model.entity.accounts.loan.InterestType -import org.mifos.mobile.core.model.entity.accounts.loan.RepaymentFrequencyType -import org.mifos.mobile.core.model.entity.accounts.loan.TermPeriodFrequencyType - -/** - * Created by Rajan Maurya on 15/07/16. - */ - -@Parcelize -data class LoanTemplate( - - var clientId: Int? = null, - - var clientAccountNo: String? = null, - - var clientName: String? = null, - - var clientOfficeId: Int? = null, - - var loanProductName: String? = null, - - @SerializedName("isLoanProductLinkedToFloatingRate") - var loanProductLinkedToFloatingRate: Boolean? = null, - - var fundId: Int? = null, - - var fundName: String? = null, - - var currency: Currency? = null, - - var principal: Double? = null, - - var approvedPrincipal: Double? = null, - - var proposedPrincipal: Double? = null, - - var termFrequency: Int? = null, - - var termPeriodFrequencyType: TermPeriodFrequencyType? = null, - - var numberOfRepayments: Int? = null, - - var repaymentEvery: Int? = null, - - var repaymentFrequencyType: RepaymentFrequencyType? = null, - - var interestRatePerPeriod: Double? = null, - - var interestRateFrequencyType: InterestRateFrequencyType? = null, - - var annualInterestRate: Double? = null, - - @SerializedName("isFloatingInterestRate") - var floatingInterestRate: Boolean? = null, - - var amortizationType: AmortizationType? = null, - - var interestType: InterestType? = null, - - var interestCalculationPeriodType: InterestCalculationPeriodType? = null, - - var allowPartialPeriodInterestCalcualtion: Boolean? = null, - - var transactionProcessingStrategyId: Int? = null, - - var graceOnArrearsAgeing: Int? = null, - - var timeline: Timeline? = null, - - var productOptions: List = ArrayList(), - - var loanOfficerOptions: List = ArrayList(), - - var loanPurposeOptions: List = ArrayList(), - - var fundOptions: List = ArrayList(), - - var termFrequencyTypeOptions: List = ArrayList(), - - var repaymentFrequencyTypeOptions: List = ArrayList(), - - var repaymentFrequencyNthDayTypeOptions: List = ArrayList(), - - var repaymentFrequencyDaysOfWeekTypeOptions: List = ArrayList(), - - var interestRateFrequencyTypeOptions: List = ArrayList(), - - var amortizationTypeOptions: List = ArrayList(), - - var interestTypeOptions: List = ArrayList(), - - var interestCalculationPeriodTypeOptions: List = ArrayList(), - - var transactionProcessingStrategyOptions: List = ArrayList(), - - var chargeOptions: List = ArrayList(), - - var loanCollateralOptions: List = ArrayList(), - - var multiDisburseLoan: Boolean? = null, - - var canDefineInstallmentAmount: Boolean? = null, - - var canDisburse: Boolean? = null, - - var product: Product? = null, - - var daysInMonthType: DaysInMonthType? = null, - - var daysInYearType: DaysInYearType? = null, - - @SerializedName("isInterestRecalculationEnabled") - var interestRecalculationEnabled: Boolean? = null, - - @SerializedName("isVariableInstallmentsAllowed") - var variableInstallmentsAllowed: Boolean? = null, - - var minimumGap: Int? = null, - - var maximumGap: Int? = null, - - var accountLinkingOptions: List = ArrayList(), - -) : Parcelable { - /** - * Required to set default value to the Fund spinner - * - * @param fundId The value received from the Template for that particular loanProduct - * @return Returns the index of the fundOption list where the specified fundId is located - */ - fun getFundNameFromId(fundId: Int): Int { - for (i in fundOptions.indices) { - if (fundOptions[i].id == fundId) { - return i - } - } - return 0 - } -} diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Product.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Product.kt deleted file mode 100644 index 9b3b40a62..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/Product.kt +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.templates.loans - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize -import org.mifos.mobile.core.model.entity.accounts.loan.AmortizationType -import org.mifos.mobile.core.model.entity.accounts.loan.DaysInMonthType -import org.mifos.mobile.core.model.entity.accounts.loan.DaysInYearType -import org.mifos.mobile.core.model.entity.accounts.loan.InterestCalculationPeriodType -import org.mifos.mobile.core.model.entity.accounts.loan.InterestRateFrequencyType -import org.mifos.mobile.core.model.entity.accounts.loan.InterestRecalculationData -import org.mifos.mobile.core.model.entity.accounts.loan.InterestType -import org.mifos.mobile.core.model.entity.accounts.loan.RepaymentFrequencyType - -/** - * Created by Rajan Maurya on 16/07/16. - */ - -@Parcelize -data class Product( - - var id: Int? = null, - - var name: String? = null, - - var shortName: String? = null, - - var fundId: Int? = null, - - var fundName: String? = null, - - var includeInBorrowerCycle: Boolean? = null, - - var useBorrowerCycle: Boolean? = null, - - var startDate: List? = null, - - var status: String? = null, - - var currency: Currency? = null, - - var principal: Double? = null, - - var minPrincipal: Double? = null, - - var maxPrincipal: Double? = null, - - var numberOfRepayments: Int? = null, - - var minNumberOfRepayments: Int? = null, - - var maxNumberOfRepayments: Int? = null, - - var repaymentEvery: Int? = null, - - var repaymentFrequencyType: RepaymentFrequencyType? = null, - - var interestRatePerPeriod: Double? = null, - - var minInterestRatePerPeriod: Double? = null, - - var maxInterestRatePerPeriod: Double? = null, - - var interestRateFrequencyType: InterestRateFrequencyType? = null, - - var annualInterestRate: Double? = null, - - @SerializedName("isLinkedToFloatingInterestRates") - var linkedToFloatingInterestRates: Boolean? = null, - - @SerializedName("isFloatingInterestRateCalculationAllowed") - var floatingInterestRateCalculationAllowed: Boolean? = null, - - var allowVariableInstallments: Boolean? = null, - - var minimumGap: Double? = null, - - var maximumGap: Double? = null, - - var amortizationType: AmortizationType, - - var interestType: InterestType, - - var interestCalculationPeriodType: InterestCalculationPeriodType? = null, - - var allowPartialPeriodInterestCalcualtion: Boolean? = null, - - var transactionProcessingStrategyId: Int? = null, - - var transactionProcessingStrategyName: String? = null, - - var graceOnArrearsAgeing: Int? = null, - - var overdueDaysForNPA: Int? = null, - - var daysInMonthType: DaysInMonthType? = null, - - var daysInYearType: DaysInYearType, - - @SerializedName("isInterestRecalculationEnabled") - var interestRecalculationEnabled: Boolean? = null, - - var interestRecalculationData: InterestRecalculationData? = null, - - var canDefineInstallmentAmount: Boolean? = null, - - var accountingRule: AccountingRule? = null, - - var multiDisburseLoan: Boolean? = null, - - var maxTrancheCount: Int? = null, - - var principalThresholdForLastInstallment: Int? = null, - - var holdGuaranteeFunds: Boolean? = null, - - var accountMovesOutOfNPAOnlyOnArrearsCompletion: Boolean? = null, - - var allowAttributeOverrides: AllowAttributeOverrides? = null, - -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ProductOptions.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ProductOptions.kt deleted file mode 100644 index 64684b943..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/loans/ProductOptions.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.templates.loans - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -/** - * Created by Rajan Maurya on 16/07/16. - */ - -@Parcelize -data class ProductOptions( - - var id: Int? = null, - - var name: String? = null, - - var includeInBorrowerCycle: Boolean? = null, - - var useBorrowerCycle: Boolean? = null, - - @SerializedName("isLinkedToFloatingInterestRates") - var linkedToFloatingInterestRates: Boolean? = null, - - @SerializedName("isFloatingInterestRateCalculationAllowed") - var floatingInterestRateCalculationAllowed: Boolean? = null, - - var allowVariableInstallments: Boolean? = null, - - @SerializedName("isInterestRecalculationEnabled") - var interestRecalculationEnabled: Boolean? = null, - - var canDefineInstallmentAmount: Boolean? = null, - - var holdGuaranteeFunds: Boolean? = null, - - var accountMovesOutOfNPAOnlyOnArrearsCompletion: Boolean? = null, -) : Parcelable diff --git a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/SavingsAccountTemplate.kt b/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/SavingsAccountTemplate.kt deleted file mode 100644 index 398b2e1de..000000000 --- a/core/model/src/main/java/org/mifos/mobile/core/model/entity/templates/savings/SavingsAccountTemplate.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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/mobile-mobile/blob/master/LICENSE.md - */ -package org.mifos.mobile.core.model.entity.templates.savings - -/* - * Created by saksham on 01/July/2018 - */ - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class SavingsAccountTemplate( - var clientId: Int = 0, - var clientName: String? = null, - var withdrawalFeeForTransfers: Boolean? = null, - var allowOverdraft: Boolean? = null, - var enforceMinRequiredBalance: Boolean? = null, - var withHoldTax: Boolean? = null, - var isDormancyTrackingActive: Boolean? = null, - var productOptions: ArrayList = ArrayList(), - var chargeOptions: ArrayList = ArrayList(), -) : Parcelable diff --git a/core/model/src/nativeMain/kotlin/org/mifos/mobile/core/model/Parcelize.native.kt b/core/model/src/nativeMain/kotlin/org/mifos/mobile/core/model/Parcelize.native.kt new file mode 100644 index 000000000..b5dd3dad5 --- /dev/null +++ b/core/model/src/nativeMain/kotlin/org/mifos/mobile/core/model/Parcelize.native.kt @@ -0,0 +1,17 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model + +actual interface Parcelable + +actual annotation class IgnoredOnParcel + +@Target(AnnotationTarget.TYPE) +actual annotation class RawValue actual constructor() diff --git a/core/model/src/wasmJsMain/kotlin/org/mifos/mobile/core/model/Parcelize.wasmJs.kt b/core/model/src/wasmJsMain/kotlin/org/mifos/mobile/core/model/Parcelize.wasmJs.kt new file mode 100644 index 000000000..b5dd3dad5 --- /dev/null +++ b/core/model/src/wasmJsMain/kotlin/org/mifos/mobile/core/model/Parcelize.wasmJs.kt @@ -0,0 +1,17 @@ +/* + * 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/mobile-mobile/blob/master/LICENSE.md + */ +package org.mifos.mobile.core.model + +actual interface Parcelable + +actual annotation class IgnoredOnParcel + +@Target(AnnotationTarget.TYPE) +actual annotation class RawValue actual constructor()