diff --git a/core/model/build.gradle.kts b/core/model/build.gradle.kts index 8cadff653..8862c945a 100644 --- a/core/model/build.gradle.kts +++ b/core/model/build.gradle.kts @@ -23,8 +23,5 @@ kotlin { api(libs.kotlinx.datetime) implementation(libs.kotlinx.serialization.json) } - androidMain.dependencies { - implementation(libs.squareup.retrofit.converter.gson) - } } } \ No newline at end of file diff --git a/core/model/consumer-rules.pro b/core/model/consumer-rules.pro deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/model/proguard-rules.pro b/core/model/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/core/model/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/model/src/main/java/com/mifospay/core/model/City.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/City.kt similarity index 94% rename from core/model/src/main/java/com/mifospay/core/model/City.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/City.kt index ab02c68cb..8d3d0cb96 100644 --- a/core/model/src/main/java/com/mifospay/core/model/City.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/City.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model +package org.mifospay.core.model import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/model/src/main/java/com/mifospay/core/model/Country.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/Country.kt similarity index 93% rename from core/model/src/main/java/com/mifospay/core/model/Country.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/Country.kt index 8bf05c28d..c1e079fba 100644 --- a/core/model/src/main/java/com/mifospay/core/model/Country.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/Country.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model +package org.mifospay.core.model import kotlinx.serialization.Serializable diff --git a/core/model/src/main/java/com/mifospay/core/model/State.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/State.kt similarity index 94% rename from core/model/src/main/java/com/mifospay/core/model/State.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/State.kt index de96c402b..24b8a4c70 100644 --- a/core/model/src/main/java/com/mifospay/core/model/State.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/State.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model +package org.mifospay.core.model import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/model/src/main/java/com/mifospay/core/model/UserData.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/UserData.kt similarity index 93% rename from core/model/src/main/java/com/mifospay/core/model/UserData.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/UserData.kt index dfd447b72..180afee4a 100644 --- a/core/model/src/main/java/com/mifospay/core/model/UserData.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/UserData.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model +package org.mifospay.core.model data class UserData( val isAuthenticated: Boolean, diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/Account.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Account.kt similarity index 64% rename from core/model/src/main/java/com/mifospay/core/model/domain/Account.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Account.kt index 111a68214..a60910d53 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/Account.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Account.kt @@ -7,17 +7,17 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain +package org.mifospay.core.model.domain import kotlinx.serialization.Serializable @Serializable data class Account( - var image: String = "", - var name: String, - var number: String, - var balance: Double = 0.0, - var id: Long = 0L, - var productId: Long = 0L, - var currency: Currency, + val image: String = "", + val name: String, + val number: String, + val balance: Double = 0.0, + val id: Long = 0L, + val productId: Long = 0L, + val currency: Currency, ) diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/Bank.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Bank.kt similarity index 89% rename from core/model/src/main/java/com/mifospay/core/model/domain/Bank.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Bank.kt index 1c2c9a868..90778f5f9 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/Bank.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Bank.kt @@ -7,9 +7,9 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain +package org.mifospay.core.model.domain -class Bank( +data class Bank( val name: String, val image: Int, val bankType: BankType = BankType.OTHER, diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/BankAccountDetails.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/BankAccountDetails.kt similarity index 66% rename from core/model/src/main/java/com/mifospay/core/model/domain/BankAccountDetails.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/BankAccountDetails.kt index 7cfb9064e..9ae668614 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/BankAccountDetails.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/BankAccountDetails.kt @@ -7,12 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain +package org.mifospay.core.model.domain -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable -@Parcelize +@Serializable data class BankAccountDetails( var bankName: String? = null, var accountholderName: String? = null, @@ -21,6 +20,14 @@ data class BankAccountDetails( var type: String? = null, var isUpiEnabled: Boolean = false, var upiPin: String? = null, -) : Parcelable { - constructor() : this("", "", "", "", "", false, "") +) { + constructor() : this( + bankName = "", + accountholderName = "", + branch = "", + ifsc = "", + type = "", + isUpiEnabled = false, + upiPin = "", + ) } diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Currency.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Currency.kt new file mode 100644 index 000000000..d29ae7244 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Currency.kt @@ -0,0 +1,25 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.domain + +import kotlinx.serialization.Serializable + +@Serializable +data class Currency( + val code: String, + val displaySymbol: String, + val displayLabel: String, +) { + constructor() : this( + code = "", + displaySymbol = "", + displayLabel = "", + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/NewAccount.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/NewAccount.kt similarity index 56% rename from core/model/src/main/java/com/mifospay/core/model/domain/NewAccount.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/NewAccount.kt index a276663aa..54ce3f3ab 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/NewAccount.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/NewAccount.kt @@ -7,14 +7,15 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain +package org.mifospay.core.model.domain + +import kotlinx.datetime.LocalDate -import java.util.Date data class NewAccount( - var clientId: Int, - var productId: String? = null, - var submittedOnDate: Date? = null, - var accountNo: String, - var locale: String? = null, - var dateFormat: String? = null, + val clientId: Int, + val productId: String? = null, + val submittedOnDate: LocalDate? = null, + val accountNo: String, + val locale: String? = null, + val dateFormat: String? = null, ) diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/Currency.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/NotificationPayload.kt similarity index 67% rename from core/model/src/main/java/com/mifospay/core/model/domain/Currency.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/NotificationPayload.kt index b17050b84..1520e7413 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/Currency.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/NotificationPayload.kt @@ -7,15 +7,13 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain +package org.mifospay.core.model.domain import kotlinx.serialization.Serializable @Serializable -data class Currency( - var code: String, - var displaySymbol: String, - var displayLabel: String, -) { - constructor() : this("", "", "") -} +data class NotificationPayload( + val title: String? = null, + val body: String? = null, + val timestamp: String? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/SearchResult.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/SearchResult.kt new file mode 100644 index 000000000..889084dbc --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/SearchResult.kt @@ -0,0 +1,25 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.domain + +import kotlinx.serialization.Serializable + +@Serializable +data class SearchResult( + val resultId: Int = 0, + val resultName: String, + val resultType: String, +) { + constructor() : this( + resultId = 0, + resultName = "", + resultType = "", + ) +} diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Transaction.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Transaction.kt new file mode 100644 index 000000000..9ed8063ae --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/Transaction.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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.domain + +import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.accounts.savings.TransferDetail + +@Serializable +data class Transaction( + val transactionId: String? = null, + val clientId: Long = 0, + val accountId: Long = 0, + val amount: Double = 0.0, + val date: String? = null, + val currency: Currency = Currency(), + val transactionType: TransactionType = TransactionType.OTHER, + val transferId: Long = 0, + val transferDetail: TransferDetail = TransferDetail(), + val receiptId: String? = null, +) { + constructor() : this( + transactionId = "", + clientId = 0, + accountId = 0, + amount = 0.0, + date = "", + currency = Currency(), + transactionType = TransactionType.OTHER, + transferId = 0, + transferDetail = TransferDetail(), + receiptId = "", + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/TransactionType.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/TransactionType.kt similarity index 90% rename from core/model/src/main/java/com/mifospay/core/model/domain/TransactionType.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/TransactionType.kt index ad57f69fb..314983835 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/TransactionType.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/TransactionType.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain +package org.mifospay.core.model.domain enum class TransactionType { DEBIT, diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/client/Client.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/Client.kt similarity index 51% rename from core/model/src/main/java/com/mifospay/core/model/domain/client/Client.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/Client.kt index 9f8626325..01e0c5e2e 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/client/Client.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/Client.kt @@ -7,18 +7,25 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.client +package org.mifospay.core.model.domain.client import kotlinx.serialization.Serializable @Serializable data class Client( - var name: String? = null, - var image: String, - var externalId: String? = null, - var clientId: Long = 0L, - var displayName: String, - var mobileNo: String, + val name: String? = null, + val image: String, + val externalId: String? = null, + val clientId: Long = 0L, + val displayName: String, + val mobileNo: String, ) { - constructor() : this("", "", "", 0L, "", "") + constructor() : this( + name = "", + image = "", + externalId = "", + clientId = 0L, + displayName = "", + mobileNo = "", + ) } diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/client/NewClient.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/NewClient.kt similarity index 68% rename from core/model/src/main/java/com/mifospay/core/model/domain/client/NewClient.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/NewClient.kt index 2fdb25e29..bf59ce9e5 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/client/NewClient.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/NewClient.kt @@ -7,9 +7,9 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.client +package org.mifospay.core.model.domain.client -import com.mifospay.core.model.utils.DateHelper +import org.mifospay.core.model.utils.DateHelper data class NewClient( val fullname: String?, @@ -23,21 +23,21 @@ data class NewClient( val mobileNo: String?, val mifosSavingsProductId: Int?, ) { - val address: MutableList = mutableListOf() - val activationDate: String = DateHelper.getDateAsStringFromLong(System.currentTimeMillis()) + private val address: MutableList
= mutableListOf() + private val activationDate: String = DateHelper.formattedDate val submittedOnDate: String = activationDate val savingsProductId: Int = mifosSavingsProductId ?: 0 - val externalId: String = userName + "@mifos" + val externalId: String = "$userName@mifos" init { address.add( - com.mifospay.core.model.domain.client.NewClient.Address( - addressLine1, - addressLine2, - city, - postalCode, - stateProvinceId, - countryId, + Address( + addressLine1 = addressLine1, + addressLine2 = addressLine2, + street = city, + postalCode = postalCode, + stateProvinceId = stateProvinceId, + countryId = countryId, ), ) } diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/client/UpdateClientEntityMobile.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/UpdateClientEntityMobile.kt similarity index 89% rename from core/model/src/main/java/com/mifospay/core/model/domain/client/UpdateClientEntityMobile.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/UpdateClientEntityMobile.kt index 9ca0bc770..f7087edd4 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/client/UpdateClientEntityMobile.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/client/UpdateClientEntityMobile.kt @@ -7,6 +7,6 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.client +package org.mifospay.core.model.domain.client data class UpdateClientEntityMobile(val mobileNo: String) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/twofactor/AccessToken.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/twofactor/AccessToken.kt new file mode 100644 index 000000000..0d24b0b22 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/twofactor/AccessToken.kt @@ -0,0 +1,19 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.domain.twofactor + +import kotlinx.serialization.Serializable + +@Serializable +data class AccessToken( + val token: String? = null, + val validFrom: Long? = null, + val validTo: Long? = null, +) diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/twofactor/DeliveryMethod.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/twofactor/DeliveryMethod.kt similarity index 65% rename from core/model/src/main/java/com/mifospay/core/model/domain/twofactor/DeliveryMethod.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/twofactor/DeliveryMethod.kt index a7381e6f7..320fffdae 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/twofactor/DeliveryMethod.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/twofactor/DeliveryMethod.kt @@ -7,13 +7,12 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.twofactor +package org.mifospay.core.model.domain.twofactor -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable -@Parcelize +@Serializable data class DeliveryMethod( - var name: String?, - var target: String?, -) : Parcelable + val name: String?, + val target: String?, +) diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/user/NewUser.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/NewUser.kt similarity index 79% rename from core/model/src/main/java/com/mifospay/core/model/domain/user/NewUser.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/NewUser.kt index 12c8de930..72a2aee2a 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/user/NewUser.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/NewUser.kt @@ -7,9 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.user - -import java.util.Collections +package org.mifospay.core.model.domain.user class NewUser( val username: String?, @@ -28,6 +26,4 @@ class NewUser( private const val MOBILE_WALLET_ROLE_ID = 471 private const val SUPER_USER_ROLE_ID = 1 -val NEW_USER_ROLE_IDS: Collection = Collections.unmodifiableList( - listOf(MOBILE_WALLET_ROLE_ID, SUPER_USER_ROLE_ID), -) +val NEW_USER_ROLE_IDS: Collection = listOf(MOBILE_WALLET_ROLE_ID, SUPER_USER_ROLE_ID) diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityClients.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityClients.kt similarity index 72% rename from core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityClients.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityClients.kt index e21861e51..0748b9978 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityClients.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityClients.kt @@ -7,8 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.user +package org.mifospay.core.model.domain.user +import kotlinx.serialization.Serializable + +@Serializable data class UpdateUserEntityClients( - var clients: ArrayList, + val clients: ArrayList, ) diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityEmail.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityEmail.kt similarity index 74% rename from core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityEmail.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityEmail.kt index b45dfc156..2231efd18 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityEmail.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityEmail.kt @@ -7,8 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.user +package org.mifospay.core.model.domain.user +import kotlinx.serialization.Serializable + +@Serializable data class UpdateUserEntityEmail( - var email: String?, + val email: String?, ) diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityPassword.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityPassword.kt similarity index 80% rename from core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityPassword.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityPassword.kt index b1fa56521..8a4b3d42f 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/user/UpdateUserEntityPassword.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/UpdateUserEntityPassword.kt @@ -7,8 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.user +package org.mifospay.core.model.domain.user +import kotlinx.serialization.Serializable + +@Serializable data class UpdateUserEntityPassword(val password: String) { val repeatPassword: String = password } diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/user/User.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/User.kt similarity index 90% rename from core/model/src/main/java/com/mifospay/core/model/domain/user/User.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/User.kt index dcab74ab4..c1de67fe0 100644 --- a/core/model/src/main/java/com/mifospay/core/model/domain/user/User.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/domain/user/User.kt @@ -7,10 +7,10 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.domain.user +package org.mifospay.core.model.domain.user -import com.mifospay.core.model.entity.Role import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.Role @Serializable data class User( diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Invoice.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Invoice.kt new file mode 100644 index 000000000..cf0093f03 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Invoice.kt @@ -0,0 +1,38 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity + +import kotlinx.serialization.Serializable + +@Serializable +data class Invoice( + val consumerId: String? = null, + val consumerName: String? = null, + val amount: Double = 0.0, + val itemsBought: String? = null, + val status: Long = 0L, + val transactionId: String? = null, + val id: Long = 0L, + val title: String? = null, + val date: List = ArrayList(), + + ) { + constructor() : this( + consumerId = null, + consumerName = null, + amount = 0.0, + itemsBought = null, + status = 0L, + transactionId = null, + id = 0L, + title = null, + date = ArrayList(), + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/Page.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Page.kt similarity index 65% rename from core/model/src/main/java/com/mifospay/core/model/entity/Page.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Page.kt index 2cd34f259..4e24e6354 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/Page.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Page.kt @@ -7,9 +7,12 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity +package org.mifospay.core.model.entity +import kotlinx.serialization.Serializable + +@Serializable data class Page( - var totalFilteredRecords: Int = 0, - var pageItems: MutableList = ArrayList(), + val totalFilteredRecords: Int = 0, + val pageItems: MutableList = ArrayList(), ) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/Role.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Role.kt similarity index 76% rename from core/model/src/main/java/com/mifospay/core/model/entity/Role.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Role.kt index e4678e918..bd22ef392 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/Role.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Role.kt @@ -7,14 +7,14 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity +package org.mifospay.core.model.entity import kotlinx.serialization.Serializable @Serializable data class Role( - var id: String? = null, - var name: String? = null, - var description: String? = null, + val id: String? = null, + val name: String? = null, + val description: String? = null, val disabled: Boolean, ) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/SearchedEntity.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/SearchedEntity.kt new file mode 100644 index 000000000..d69b2019f --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/SearchedEntity.kt @@ -0,0 +1,22 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity + +import kotlinx.serialization.Serializable + +@Serializable +data class SearchedEntity( + val entityId: Int = 0, + val entityAccountNo: String = " ", + val entityName: String = " ", + val entityType: String = " ", + val parentId: Int = 0, + val parentName: String = " ", +) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/TPTResponse.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/TPTResponse.kt similarity index 63% rename from core/model/src/main/java/com/mifospay/core/model/entity/TPTResponse.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/TPTResponse.kt index 2adb9aaaa..621b95a86 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/TPTResponse.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/TPTResponse.kt @@ -7,13 +7,12 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity +package org.mifospay.core.model.entity -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable -@Parcelize +@Serializable data class TPTResponse( - var savingsId: String? = null, - var resourceId: String? = null, -) : Parcelable + val savingsId: String? = null, + val resourceId: String? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Timeline.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/Timeline.kt new file mode 100644 index 000000000..968d2a3e0 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity + +import kotlinx.serialization.Serializable + +@Serializable +data class Timeline( + val submittedOnDate: List = ArrayList(), + val submittedByUsername: String? = null, + val submittedByFirstname: String? = null, + val submittedByLastname: String? = null, + val activatedOnDate: List = ArrayList(), + val activatedByUsername: String? = null, + val activatedByFirstname: String? = null, + val activatedByLastname: String? = null, + val closedOnDate: List = ArrayList(), + val closedByUsername: String? = null, + val closedByFirstname: String? = null, + val closedByLastname: String? = null, +) { + constructor() : this( + submittedOnDate = ArrayList(), + submittedByUsername = "", + submittedByFirstname = "", + submittedByLastname = "", + activatedOnDate = ArrayList(), + activatedByUsername = "", + activatedByFirstname = "", + activatedByLastname = "", + closedOnDate = ArrayList(), + closedByUsername = "", + closedByFirstname = "", + closedByLastname = "", + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/UserEntity.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/UserEntity.kt similarity index 88% rename from core/model/src/main/java/com/mifospay/core/model/entity/UserEntity.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/UserEntity.kt index 63c6277cd..65ab8bfd6 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/UserEntity.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/UserEntity.kt @@ -7,8 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity +package org.mifospay.core.model.entity +import kotlinx.serialization.Serializable + +@Serializable data class UserEntity( val username: String, val userId: Long = 0, diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/UserWithRole.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/UserWithRole.kt similarity index 61% rename from core/model/src/main/java/com/mifospay/core/model/entity/UserWithRole.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/UserWithRole.kt index e54eb80a8..c5b3404f0 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/UserWithRole.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/UserWithRole.kt @@ -7,16 +7,16 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity +package org.mifospay.core.model.entity import kotlinx.serialization.Serializable @Serializable data class UserWithRole( - var id: String? = null, - var username: String? = null, - var firstname: String? = null, - var lastname: String? = null, - var email: String? = null, - var selectedRoles: List? = ArrayList(), + val id: String? = null, + val username: String? = null, + val firstname: String? = null, + val lastname: String? = null, + val email: String? = null, + val selectedRoles: List? = ArrayList(), ) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/SavingAccountsListResponse.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/SavingAccountsListResponse.kt similarity index 71% rename from core/model/src/main/java/com/mifospay/core/model/entity/accounts/SavingAccountsListResponse.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/SavingAccountsListResponse.kt index ea86805fe..4887472a2 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/SavingAccountsListResponse.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/SavingAccountsListResponse.kt @@ -7,10 +7,12 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.accounts +package org.mifospay.core.model.entity.accounts -import com.mifospay.core.model.entity.accounts.savings.SavingAccount +import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.accounts.savings.SavingAccount +@Serializable data class SavingAccountsListResponse( var savingsAccounts: List = ArrayList(), ) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Currency.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Currency.kt new file mode 100644 index 000000000..1d9824bc7 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Currency.kt @@ -0,0 +1,33 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable + +@Serializable +data class Currency( + val code: String = "", + val name: String = "", + val decimalPlaces: Int? = null, + val inMultiplesOf: Int? = null, + val displaySymbol: String = "", + val nameCode: String = "", + val displayLabel: String = "" +) { + constructor() : this( + code = "", + name = "", + decimalPlaces = 0, + inMultiplesOf = 0, + displaySymbol = "", + nameCode = "", + displayLabel = "", + ) +} diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/PaymentDetailData.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/PaymentDetailData.kt new file mode 100644 index 000000000..f8f175073 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/PaymentDetailData.kt @@ -0,0 +1,33 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable + +@Serializable +data class PaymentDetailData( + val id: Int? = null, + val paymentType: PaymentType? = null, + val accountNumber: String? = null, + val checkNumber: String? = null, + val routingCode: String? = null, + val receiptNumber: String? = null, + val bankNumber: String? = null, +) { + constructor() : this( + id = null, + paymentType = null, + accountNumber = null, + checkNumber = null, + routingCode = null, + receiptNumber = null, + bankNumber = null, + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/PaymentType.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/PaymentType.kt similarity index 65% rename from core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/PaymentType.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/PaymentType.kt index 57e449a09..cd19f5e89 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/PaymentType.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/PaymentType.kt @@ -7,17 +7,12 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.accounts.savings +package org.mifospay.core.model.entity.accounts.savings -import com.google.gson.annotations.SerializedName import kotlinx.serialization.Serializable @Serializable data class PaymentType( - @SerializedName("id") - var id: Int? = null, - - @SerializedName("name") - var name: String? = null, - + val id: Int? = null, + val name: String? = null, ) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/SavingAccount.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/SavingAccount.kt new file mode 100644 index 000000000..903579230 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/SavingAccount.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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.client.DepositType + +@Serializable +data class SavingAccount( + val id: Long = 0L, + val accountNo: String = "", + val productName: String = "", + val productId: Int = 0, + val overdraftLimit: Long = 0L, + val minRequiredBalance: Long = 0L, + 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 = Currency(), + val depositType: DepositType? = null, +) { + fun isRecurring(): Boolean { + return this.depositType != null && this.depositType.isRecurring + } + + constructor() : this( + id = 0L, + accountNo = "", + productName = "", + productId = 0, + overdraftLimit = 0L, + minRequiredBalance = 0L, + accountBalance = 0.0, + totalDeposits = 0.0, + savingsProductName = "", + clientName = "", + savingsProductId = "", + nominalAnnualInterestRate = 0.0, + status = Status(), + currency = Currency(), + depositType = DepositType(), + ) +} diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/SavingsWithAssociations.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/SavingsWithAssociations.kt new file mode 100644 index 000000000..ae8e2b0fc --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/SavingsWithAssociations.kt @@ -0,0 +1,67 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.client.DepositType + +@Serializable +data class SavingsWithAssociations( + val id: Long = 0L, + val accountNo: String? = null, + val depositType: DepositType? = null, + val externalId: String = "", + val clientId: Int = 0, + val clientName: String = "", + val savingsProductId: Int? = null, + val savingsProductName: String? = null, + val fieldOfficerId: Int? = null, + val status: Status? = null, + val timeline: TimeLine? = null, + val currency: Currency? = null, + 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, + @SerialName("isDormancyTrackingActive") + val dormancyTrackingActive: Boolean? = null, + val summary: Summary? = null, + val transactions: List = ArrayList(), +) { + constructor() : this( + id = 0L, + accountNo = null, + depositType = null, + externalId = "", + clientId = 0, + clientName = "", + savingsProductId = null, + savingsProductName = null, + fieldOfficerId = 0, + status = null, + timeline = null, + currency = null, + nominalAnnualInterestRate = null, + minRequiredOpeningBalance = null, + lockinPeriodFrequency = 0.0, + withdrawalFeeForTransfers = false, + allowOverdraft = false, + enforceMinRequiredBalance = false, + withHoldTax = null, + lastActiveTransactionDate = listOf(), + dormancyTrackingActive = null, + summary = null, + ) +} diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Status.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Status.kt new file mode 100644 index 000000000..cb2fdf8ca --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Status.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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable + +@Serializable +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, + val transferInProgress: Boolean? = null, + val transferOnHold: Boolean? = null, + val matured: Boolean? = null, +) { + constructor() : this( + id = null, + code = null, + value = null, + submittedAndPendingApproval = null, + approved = null, + rejected = null, + withdrawnByApplicant = null, + active = null, + closed = null, + prematureClosed = null, + transferInProgress = null, + transferOnHold = null, + matured = null, + ) +} diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Summary.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Summary.kt new file mode 100644 index 000000000..96852b986 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Summary.kt @@ -0,0 +1,25 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable + +@Serializable +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? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TimeLine.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TimeLine.kt new file mode 100644 index 000000000..3aff25db6 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable + +@Serializable +data class TimeLine( + val submittedOnDate: List = ArrayList(), + val submittedByUsername: String? = null, + val submittedByFirstname: String? = null, + val submittedByLastname: String? = null, + val approvedOnDate: List = ArrayList(), + val approvedByUsername: String? = null, + val approvedByFirstname: String? = null, + val approvedByLastname: String? = null, + val activatedOnDate: List? = null, + val activatedByUsername: String? = null, + val activatedByFirstname: String? = null, + val activatedByLastname: String? = null, +) { + constructor() : this( + submittedOnDate = ArrayList(), + submittedByUsername = null, + submittedByFirstname = null, + submittedByLastname = null, + approvedOnDate = ArrayList(), + approvedByUsername = null, + approvedByFirstname = null, + approvedByLastname = null, + activatedOnDate = null, + activatedByUsername = null, + activatedByFirstname = null, + activatedByLastname = null, + ) +} diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionType.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionType.kt new file mode 100644 index 000000000..532a91c42 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransactionType.kt @@ -0,0 +1,33 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable + +@Serializable +data class TransactionType( + val id: Int? = null, + val code: String? = null, + val value: String? = null, + val deposit: Boolean = false, + val dividendPayout: Boolean = false, + val withdrawal: Boolean = false, + val interestPosting: Boolean = false, + val feeDeduction: Boolean = false, + val initiateTransfer: Boolean = false, + val approveTransfer: Boolean = false, + val withdrawTransfer: Boolean = false, + val rejectTransfer: Boolean = false, + val overdraftInterest: Boolean = false, + val writtenoff: Boolean = false, + val overdraftFee: Boolean = false, + val withholdTax: Boolean = false, + val escheat: Boolean? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Transactions.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Transactions.kt new file mode 100644 index 000000000..00db6abea --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Transactions.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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable + +@Serializable +data class Transactions( + val id: Int? = null, + val transactionType: TransactionType = TransactionType(), + val accountId: Int? = null, + val accountNo: String? = null, + val date: List = ArrayList(), + val currency: Currency = Currency(), + val paymentDetailData: PaymentDetailData? = null, + val amount: Double = 0.0, + val transfer: Transfer = Transfer(), + val runningBalance: Double? = null, + val reversed: Boolean? = null, + val submittedOnDate: List = ArrayList(), + val interestedPostedAsOn: Boolean? = null, +) { + constructor() : this( + id = 0, + transactionType = TransactionType(), + accountId = 0, + accountNo = "", + date = ArrayList(), + currency = Currency(), + paymentDetailData = PaymentDetailData(), + amount = 0.0, + transfer = Transfer(), + runningBalance = 0.0, + reversed = false, + submittedOnDate = ArrayList(), + interestedPostedAsOn = false, + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Transfer.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Transfer.kt similarity index 68% rename from core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Transfer.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Transfer.kt index 5dce2a848..e5c5a878e 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Transfer.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/Transfer.kt @@ -7,15 +7,13 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.accounts.savings +package org.mifospay.core.model.entity.accounts.savings -import com.google.gson.annotations.SerializedName import kotlinx.serialization.Serializable @Serializable data class Transfer( - @SerializedName("id") - var id: Long = 0L, + val id: Long = 0L, ) { - constructor() : this(0L) + constructor() : this(id = 0L) } diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransferDetail.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransferDetail.kt new file mode 100644 index 000000000..b236e99cc --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/accounts/savings/TransferDetail.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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.accounts.savings + +import kotlinx.serialization.Serializable +import org.mifospay.core.model.domain.client.Client + +@Serializable +data class TransferDetail( + val id: Long = 0L, + val fromClient: Client = Client(), + val fromAccount: SavingAccount = SavingAccount(), + val toClient: Client = Client(), + val toAccount: SavingAccount = SavingAccount(), +) { + constructor() : this( + id = 0L, + fromClient = Client(), + fromAccount = SavingAccount(), + toClient = Client(), + toAccount = SavingAccount(), + ) +} diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/authentication/AuthenticationPayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/authentication/AuthenticationPayload.kt new file mode 100644 index 000000000..c96c77306 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/authentication/AuthenticationPayload.kt @@ -0,0 +1,18 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.authentication + +import kotlinx.serialization.Serializable + +@Serializable +data class AuthenticationPayload( + val username: String, + val password: String, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/Beneficiary.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/Beneficiary.kt new file mode 100644 index 000000000..50a4b3466 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/Beneficiary.kt @@ -0,0 +1,24 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.beneficary + +import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.templates.account.AccountType + +@Serializable +data class Beneficiary( + val id: Int? = null, + val name: String? = null, + val officeName: String? = null, + val clientName: String? = null, + val accountType: AccountType? = null, + val accountNumber: String? = null, + val transferLimit: Int = 0, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/BeneficiaryPayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/BeneficiaryPayload.kt new file mode 100644 index 000000000..ca8c3ebd7 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/BeneficiaryPayload.kt @@ -0,0 +1,31 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.beneficary + +import kotlinx.serialization.Serializable + +@Serializable +data class BeneficiaryPayload( + val locale: String? = "en_GB", + val name: String? = null, + val accountNumber: String? = null, + val accountType: Int = 0, + val transferLimit: Int = 0, + val officeName: String? = null, +) { + constructor() : this( + locale = null, + name = null, + accountNumber = null, + accountType = 0, + transferLimit = 0, + officeName = null, + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/beneficary/BeneficiaryUpdatePayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/BeneficiaryUpdatePayload.kt similarity index 61% rename from core/model/src/main/java/com/mifospay/core/model/entity/beneficary/BeneficiaryUpdatePayload.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/BeneficiaryUpdatePayload.kt index 36e334e75..35c2e6e1e 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/beneficary/BeneficiaryUpdatePayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/beneficary/BeneficiaryUpdatePayload.kt @@ -7,14 +7,12 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.beneficary +package org.mifospay.core.model.entity.beneficary -import com.google.gson.annotations.SerializedName +import kotlinx.serialization.Serializable +@Serializable data class BeneficiaryUpdatePayload( - @SerializedName("name") - var name: String? = null, - - @SerializedName("transferLimit") - var transferLimit: Int = 0, + val name: String? = null, + val transferLimit: Int = 0, ) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Client.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Client.kt new file mode 100644 index 000000000..5d5cd3922 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Client.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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.client + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.Timeline + +@Serializable +data class Client( + val id: Int = 0, + val accountNo: String? = null, + val status: Status? = null, + val active: Boolean? = null, + val activationDate: List = ArrayList(), + val dobDate: List = ArrayList(), + val firstname: String? = null, + val middlename: String? = null, + val lastname: String? = null, + val displayName: String? = null, + val fullname: String? = null, + val officeId: Int = 0, + val officeName: String? = null, + val staffId: Int? = null, + val staffName: String? = null, + val timeline: Timeline? = null, + val imageId: Int = 0, + @SerialName("imagePresent") + val isImagePresent: Boolean = false, + val externalId: String = "", + val mobileNo: String = "", +) { + constructor() : this( + id = 0, + accountNo = "", + status = Status(), + active = false, + activationDate = ArrayList(), + dobDate = ArrayList(), + firstname = "", + middlename = "", + lastname = "", + displayName = "", + fullname = "", + officeId = 0, + officeName = "", + staffId = 0, + staffName = "", + timeline = Timeline(), + imageId = 0, + isImagePresent = false, + externalId = "", + mobileNo = "", + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/client/ClientAccounts.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/ClientAccounts.kt similarity index 91% rename from core/model/src/main/java/com/mifospay/core/model/entity/client/ClientAccounts.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/ClientAccounts.kt index 79c8787b1..355155ab5 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/client/ClientAccounts.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/ClientAccounts.kt @@ -7,10 +7,10 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.client +package org.mifospay.core.model.entity.client -import com.mifospay.core.model.entity.accounts.savings.SavingAccount import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.accounts.savings.SavingAccount @Serializable data class ClientAccounts( diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Currency.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Currency.kt new file mode 100644 index 000000000..d1293d618 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Currency.kt @@ -0,0 +1,31 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.client + +import kotlinx.serialization.Serializable + +@Serializable +data class Currency( + val code: String? = null, + val name: String? = null, + val decimalPlaces: Int? = null, + val displaySymbol: String? = null, + val nameCode: String? = null, + val displayLabel: String? = null, +) { + constructor() : this( + code = null, + name = null, + decimalPlaces = null, + displaySymbol = null, + nameCode = null, + displayLabel = null, + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/client/DepositType.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/DepositType.kt similarity index 66% rename from core/model/src/main/java/com/mifospay/core/model/entity/client/DepositType.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/DepositType.kt index b82c3886a..ed8887621 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/client/DepositType.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/DepositType.kt @@ -7,22 +7,15 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.client +package org.mifospay.core.model.entity.client -import com.google.gson.annotations.SerializedName import kotlinx.serialization.Serializable @Serializable data class DepositType( - @SerializedName("id") - var id: Int? = null, - - @SerializedName("code") - var code: String? = null, - - @SerializedName("value") - var value: String? = null, - + val id: Int? = null, + val code: String? = null, + val value: String? = null, ) { val isRecurring: Boolean get() = ServerTypes.RECURRING.id == id @@ -32,9 +25,13 @@ data class DepositType( get() = ServerTypes.fromId(id!!) enum class ServerTypes(val id: Int, val code: String, val endpoint: String) { - SAVINGS(100, "depositAccountType.savingsDeposit", "savingsaccounts"), - FIXED(200, "depositAccountType.fixedDeposit", "savingsaccounts"), - RECURRING(300, "depositAccountType.recurringDeposit", "recurringdepositaccounts"), + SAVINGS(id = 100, code = "depositAccountType.savingsDeposit", endpoint = "savingsaccounts"), + FIXED(id = 200, code = "depositAccountType.fixedDeposit", endpoint = "savingsaccounts"), + RECURRING( + id = 300, + code = "depositAccountType.recurringDeposit", + endpoint = "recurringdepositaccounts" + ), ; companion object { diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Status.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Status.kt new file mode 100644 index 000000000..ae033b9ff --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Status.kt @@ -0,0 +1,21 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.client + +import kotlinx.serialization.Serializable + +@Serializable +data class Status( + val id: Int? = null, + val code: String? = null, + val value: String? = null, +) { + constructor() : this(id = null, code = null, value = null) +} diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Type.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Type.kt new file mode 100644 index 000000000..18243c23d --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/client/Type.kt @@ -0,0 +1,19 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.client + +import kotlinx.serialization.Serializable + +@Serializable +data class Type( + val id: Int? = null, + val code: String? = null, + val value: String? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/kyc/KYCLevel1Details.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/kyc/KYCLevel1Details.kt new file mode 100644 index 000000000..4327b2389 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/kyc/KYCLevel1Details.kt @@ -0,0 +1,23 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.kyc + +import kotlinx.serialization.Serializable + +@Serializable +data class KYCLevel1Details( + val firstName: String? = null, + val lastName: String? = null, + val addressLine1: String? = null, + val addressLine2: String? = null, + val mobileNo: String? = null, + val dob: String? = null, + val currentLevel: String = "", +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/noncore/Document.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/noncore/Document.kt new file mode 100644 index 000000000..1f2d63b78 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/noncore/Document.kt @@ -0,0 +1,24 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.noncore + +import kotlinx.serialization.Serializable + +@Serializable +data class Document( + val id: Int = 0, + val parentEntityType: String? = null, + val parentEntityId: Int = 0, + val name: String? = null, + val fileName: String? = null, + val size: Long = 0, + val type: String? = null, + val description: String? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/ClientPayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/ClientPayload.kt new file mode 100644 index 000000000..5fbc50c73 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/ClientPayload.kt @@ -0,0 +1,33 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.payload + +import kotlinx.serialization.Serializable + +@Serializable +data class ClientPayload( + val firstname: String? = null, + val lastname: String? = null, + val middlename: String? = null, + val officeId: Int? = null, + val staffId: Int? = null, + val genderId: Int? = null, + val active: Boolean? = null, + val activationDate: String? = null, + val submittedOnDate: String? = null, + val dateOfBirth: String? = null, + val mobileNo: String? = null, + val externalId: String? = null, + val clientTypeId: Int? = null, + val clientClassificationId: Int? = null, + val dateFormat: String? = "DD_MMMM_YYYY", + val locale: String? = "en", + val datatables: List = ArrayList(), +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/DataTablePayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/DataTablePayload.kt new file mode 100644 index 000000000..427258782 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/DataTablePayload.kt @@ -0,0 +1,27 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.payload + +import kotlinx.serialization.Serializable +import kotlinx.serialization.Transient +import kotlinx.serialization.json.JsonElement + +@Serializable +data class DataTablePayload( + @Transient + val id: Int? = null, + @Transient + val clientCreationTime: Long? = null, + @Transient + val dataTableString: String? = null, + val registeredTableName: String? = null, + val applicationTableName: String? = null, + val data: HashMap? = null, +) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/payload/PayPayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/PayPayload.kt similarity index 79% rename from core/model/src/main/java/com/mifospay/core/model/entity/payload/PayPayload.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/PayPayload.kt index 93abfca12..6bd61d55c 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/payload/PayPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/PayPayload.kt @@ -7,12 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.payload +package org.mifospay.core.model.entity.payload -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable -@Parcelize +@Serializable data class PayPayload( val transactionDate: String, val transactionAmount: Int, @@ -20,4 +19,4 @@ data class PayPayload( val dateFormat: String, val paymentTypeId: Int = 1, val locale: String = "en", -) : Parcelable +) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/payload/PayResponse.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/PayResponse.kt similarity index 81% rename from core/model/src/main/java/com/mifospay/core/model/entity/payload/PayResponse.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/PayResponse.kt index d1998737e..11ce8f688 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/payload/PayResponse.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/PayResponse.kt @@ -7,8 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.payload +package org.mifospay.core.model.entity.payload +import kotlinx.serialization.Serializable + +@Serializable data class PayResponse( val officeId: Int, val clientId: Int, @@ -17,6 +20,7 @@ data class PayResponse( val changes: Change, ) +@Serializable data class Change( val paymentTypeId: Int, ) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/payload/StandingInstructionPayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/StandingInstructionPayload.kt similarity index 58% rename from core/model/src/main/java/com/mifospay/core/model/entity/payload/StandingInstructionPayload.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/StandingInstructionPayload.kt index aab5fe44c..cf568f61f 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/payload/StandingInstructionPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/StandingInstructionPayload.kt @@ -7,34 +7,33 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.payload +package org.mifospay.core.model.entity.payload -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable -@Parcelize +@Serializable data class StandingInstructionPayload( - var fromOfficeId: Int, - var fromClientId: Int, - var fromAccountType: Int, + val fromOfficeId: Int, + val fromClientId: Int, + val fromAccountType: Int, val name: String?, val transferType: Int, val priority: Int, val status: Int, - var fromAccountId: Long, - var toOfficeId: Int, - var toClientId: Int, - var toAccountType: Int, - var toAccountId: Long, + val fromAccountId: Long, + val toOfficeId: Int, + val toClientId: Int, + val toAccountType: Int, + val toAccountId: Long, val instructionType: Int, - var amount: Double, - var validFrom: String?, + val amount: Double, + val validFrom: String?, val recurrenceType: Int, val recurrenceInterval: Int, val recurrenceFrequency: Int, val locale: String?, val dateFormat: String?, - var validTill: String?, - var recurrenceOnMonthDay: String?, + val validTill: String?, + val recurrenceOnMonthDay: String?, val monthDayFormat: String?, -) : Parcelable +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/TransferPayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/TransferPayload.kt new file mode 100644 index 000000000..f10e40638 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/TransferPayload.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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.payload + +import kotlinx.serialization.Serializable + +@Serializable +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", +) { + constructor() : this( + fromOfficeId = null, + fromClientId = null, + fromAccountType = null, + fromAccountId = null, + toOfficeId = null, + toClientId = null, + toAccountType = null, + toAccountId = null, + transferDate = null, + transferAmount = null, + transferDescription = null, + ) +} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/payload/UpdateVpaPayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/UpdateVpaPayload.kt similarity index 71% rename from core/model/src/main/java/com/mifospay/core/model/entity/payload/UpdateVpaPayload.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/UpdateVpaPayload.kt index 10fc54e41..1bb8e906f 100644 --- a/core/model/src/main/java/com/mifospay/core/model/entity/payload/UpdateVpaPayload.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/payload/UpdateVpaPayload.kt @@ -7,8 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.entity.payload +package org.mifospay.core.model.entity.payload +import kotlinx.serialization.Serializable + +@Serializable data class UpdateVpaPayload( - var externalId: String? = null, + val externalId: String? = null, ) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/register/RegisterPayload.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/register/RegisterPayload.kt new file mode 100644 index 000000000..11c8ad663 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/register/RegisterPayload.kt @@ -0,0 +1,24 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.register + +import kotlinx.serialization.Serializable + +@Serializable +data class RegisterPayload( + val username: String? = null, + val firstName: String? = null, + val lastName: String? = null, + val email: String? = null, + val mobileNumber: String? = null, + val accountNumber: String? = null, + val password: String? = null, + val authenticationMode: String? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/register/UserVerify.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/register/UserVerify.kt new file mode 100644 index 000000000..8e97fffe0 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/register/UserVerify.kt @@ -0,0 +1,18 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.register + +import kotlinx.serialization.Serializable + +@Serializable +data class UserVerify( + val requestId: String? = null, + val authenticationToken: String? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/savedcards/Card.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/savedcards/Card.kt new file mode 100644 index 000000000..094749765 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/savedcards/Card.kt @@ -0,0 +1,22 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.savedcards + +import kotlinx.serialization.Serializable + +@Serializable +data class Card( + val cardNumber: String = "", + val cvv: String = "", + val expiryDate: String = "", + val firstName: String = "", + val lastName: String = "", + val id: Int = 0, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/standinginstruction/SDIResponse.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/standinginstruction/SDIResponse.kt new file mode 100644 index 000000000..a10d64f2f --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/standinginstruction/SDIResponse.kt @@ -0,0 +1,18 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.standinginstruction + +import kotlinx.serialization.Serializable + +@Serializable +data class SDIResponse( + val clientId: Int, + val resourceId: String?, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/standinginstruction/StandingInstruction.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/standinginstruction/StandingInstruction.kt new file mode 100644 index 000000000..6d9edad60 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/standinginstruction/StandingInstruction.kt @@ -0,0 +1,31 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.standinginstruction + +import kotlinx.serialization.Serializable +import org.mifospay.core.model.entity.accounts.savings.SavingAccount +import org.mifospay.core.model.entity.client.Client +import org.mifospay.core.model.entity.client.Status + +@Serializable +data class StandingInstruction( + val id: Long, + val name: String, + val fromClient: Client, + val fromAccount: SavingAccount, + val toClient: Client, + val toAccount: SavingAccount, + val status: Status, + val amount: Double, + val validFrom: List, + val validTill: List?, + val recurrenceInterval: Int, + val recurrenceOnMonthDay: List, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountOption.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountOption.kt new file mode 100644 index 000000000..1bbf350ed --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountOption.kt @@ -0,0 +1,23 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.templates.account + +import kotlinx.serialization.Serializable + +@Serializable +data class AccountOption( + val accountId: Int? = null, + val accountNo: String? = null, + val accountType: AccountType? = null, + val clientId: Long? = null, + val clientName: String? = null, + val officeId: Int? = null, + val officeName: String? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountOptionsTemplate.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountOptionsTemplate.kt new file mode 100644 index 000000000..17afff35c --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountOptionsTemplate.kt @@ -0,0 +1,18 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.templates.account + +import kotlinx.serialization.Serializable + +@Serializable +data class AccountOptionsTemplate( + val fromAccountOptions: List? = listOf(), + val toAccountOptions: List? = listOf(), +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountType.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountType.kt new file mode 100644 index 000000000..5eaaa3da7 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/account/AccountType.kt @@ -0,0 +1,19 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.templates.account + +import kotlinx.serialization.Serializable + +@Serializable +data class AccountType( + val id: Int? = null, + val code: String? = null, + val value: String? = null, +) \ No newline at end of file diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/beneficiary/AccountTypeOption.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/beneficiary/AccountTypeOption.kt new file mode 100644 index 000000000..bd537a5a0 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/beneficiary/AccountTypeOption.kt @@ -0,0 +1,19 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.templates.beneficiary + +import kotlinx.serialization.Serializable + +@Serializable +data class AccountTypeOption( + val id: Int? = null, + val code: String? = null, + val value: String? = null, +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt new file mode 100644 index 000000000..962bebc05 --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt @@ -0,0 +1,17 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.entity.templates.beneficiary + +import kotlinx.serialization.Serializable + +@Serializable +data class BeneficiaryTemplate( + val accountTypeOptions: List? = null, +) diff --git a/core/model/src/main/java/com/mifospay/core/model/signup/PasswordStrength.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/signup/PasswordStrength.kt similarity index 91% rename from core/model/src/main/java/com/mifospay/core/model/signup/PasswordStrength.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/signup/PasswordStrength.kt index c14ecab3e..b8c6ebd33 100644 --- a/core/model/src/main/java/com/mifospay/core/model/signup/PasswordStrength.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/signup/PasswordStrength.kt @@ -7,7 +7,7 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.signup +package org.mifospay.core.model.signup enum class PasswordStrength { WEAK, diff --git a/core/model/src/main/java/com/mifospay/core/model/signup/SignupData.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/signup/SignupData.kt similarity index 87% rename from core/model/src/main/java/com/mifospay/core/model/signup/SignupData.kt rename to core/model/src/commonMain/kotlin/org/mifospay/core/model/signup/SignupData.kt index 6ccc012d6..9307c399a 100644 --- a/core/model/src/main/java/com/mifospay/core/model/signup/SignupData.kt +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/signup/SignupData.kt @@ -7,12 +7,11 @@ * * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md */ -package com.mifospay.core.model.signup +package org.mifospay.core.model.signup -import android.os.Parcelable -import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable -@Parcelize +@Serializable data class SignupData( val firstName: String? = null, val lastName: String? = null, @@ -29,4 +28,4 @@ data class SignupData( val countryName: String? = null, val countryId: String? = null, val mifosSavingsProductId: Int = 0, -) : Parcelable +) diff --git a/core/model/src/commonMain/kotlin/org/mifospay/core/model/utils/DateHelper.kt b/core/model/src/commonMain/kotlin/org/mifospay/core/model/utils/DateHelper.kt new file mode 100644 index 000000000..a5d0b223b --- /dev/null +++ b/core/model/src/commonMain/kotlin/org/mifospay/core/model/utils/DateHelper.kt @@ -0,0 +1,149 @@ +/* + * 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-wallet/blob/master/LICENSE.md + */ +package org.mifospay.core.model.utils + +import kotlinx.datetime.Clock +import kotlinx.datetime.DateTimeUnit +import kotlinx.datetime.LocalDateTime +import kotlinx.datetime.TimeZone +import kotlinx.datetime.atStartOfDayIn +import kotlinx.datetime.format +import kotlinx.datetime.format.FormatStringsInDatetimeFormats +import kotlinx.datetime.format.byUnicodePattern +import kotlinx.datetime.minus +import kotlinx.datetime.toInstant +import kotlinx.datetime.toLocalDateTime +import kotlin.time.Duration.Companion.days + +@OptIn(FormatStringsInDatetimeFormats::class) +object DateHelper { + private const val LOG_TAG = "DateHelper" + private const val FULL_MONTH = "dd MMM yyyy" + private const val SHORT_MONTH = "dd-MM-yyyy" + + private val fullMonthFormat = LocalDateTime.Format { + byUnicodePattern(FULL_MONTH) + } + + private val shortMonthFormat = LocalDateTime.Format { + byUnicodePattern(SHORT_MONTH) + } + + /** + * the result string uses the list given in a reverse order ([x, y, z] results in "z y x") + * + * @param integersOfDate [year-month-day] (ex [2016, 4, 14]) + * @return date in the format day month year (ex 14 Apr 2016) + */ + fun getDateAsString(integersOfDate: List): String { + val stringBuilder = StringBuilder() + stringBuilder.append(integersOfDate[2]) + .append(' ') + .append(getMonthName(integersOfDate[1])) + .append(' ') + .append(integersOfDate[0]) + return stringBuilder.toString() + } + + fun getDateAsString(integersOfDate: List, pattern: String): String { + return getFormatConverter(FULL_MONTH, pattern, getDateAsString(integersOfDate)) + } + + /** + * This Method converting the dd-MM-yyyy format type date string into dd MMMM yyyy + * + * @param format Final Format of date string + * @param dateString date string + * @return dd MMMM yyyy format date string. + */ + fun getSpecificFormat(format: String, dateString: String): String { + val pickerFormat = shortMonthFormat + val finalFormat = LocalDateTime.Format { byUnicodePattern(format) } + + return finalFormat.format(pickerFormat.parse(dateString)) + } + + fun getFormatConverter( + currentFormat: String, + requiredFormat: String, + dateString: String, + ): String { + val pickerFormat = LocalDateTime.Format { byUnicodePattern(currentFormat) } + val finalFormat = LocalDateTime.Format { byUnicodePattern(requiredFormat) } + + return pickerFormat.parse(dateString).format(finalFormat) + } + + /** + * @param month an integer from 1 to 12 + * @return string representation of the month like Jan or Feb..etc + */ + private fun getMonthName(month: Int): String { + var monthName = "" + when (month) { + 1 -> monthName = "Jan" + 2 -> monthName = "Feb" + 3 -> monthName = "Mar" + 4 -> monthName = "Apr" + 5 -> monthName = "May" + 6 -> monthName = "Jun" + 7 -> monthName = "Jul" + 8 -> monthName = "Aug" + 9 -> monthName = "Sep" + 10 -> monthName = "Oct" + 11 -> monthName = "Nov" + 12 -> monthName = "Dec" + } + return monthName + } + + private fun getDateAsLongFromString(dateStr: String, pattern: String): Long { + return try { + // Create a DateTimeFormatter with the given pattern + val formatter = LocalDateTime.Format { byUnicodePattern(pattern) } + + // Parse the string to a LocalDateTime + val localDateTime = LocalDateTime.parse(dateStr, formatter) + + // Convert LocalDateTime to Instant (assuming the date is in the system's time zone) + val instant = localDateTime.toInstant(TimeZone.currentSystemDefault()) + + // Convert Instant to milliseconds since epoch + instant.toEpochMilliseconds() + } catch (e: Exception) { + 0L + } + } + + fun getDateAsLongFromList(integersOfDate: List): Long { + val dateStr = getDateAsString(integersOfDate) + return getDateAsLongFromString(dateStr, FULL_MONTH) + } + + fun subtractWeeks(number: Int): Long { + val now = Clock.System.now() + val subtracted = now.minus(number.times(7).days) + return subtracted.toEpochMilliseconds() + } + + fun subtractMonths(number: Int): Long { + val now = Clock.System.now() + val currentDate = now.toLocalDateTime(TimeZone.currentSystemDefault()).date + val subtractedDate = currentDate.minus(number, DateTimeUnit.MONTH) + return subtractedDate.atStartOfDayIn(TimeZone.currentSystemDefault()).toEpochMilliseconds() + } + + fun getDateAsStringFromLong(timeInMillis: Long): String { + return fullMonthFormat.parse(timeInMillis.toString()).toString() + } + + val currentDate = Clock.System.now().toEpochMilliseconds().toString() + val formattedDate = fullMonthFormat.parse(currentDate).toString() +} \ No newline at end of file diff --git a/core/model/src/main/AndroidManifest.xml b/core/model/src/main/AndroidManifest.xml deleted file mode 100644 index 961389810..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/com/mifospay/core/model/domain/NotificationPayload.kt b/core/model/src/main/java/com/mifospay/core/model/domain/NotificationPayload.kt deleted file mode 100644 index f89982818..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/domain/NotificationPayload.kt +++ /dev/null @@ -1,20 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.domain - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class NotificationPayload( - var title: String? = null, - var body: String? = null, - var timestamp: String? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/SearchResult.kt b/core/model/src/main/java/com/mifospay/core/model/domain/SearchResult.kt deleted file mode 100644 index 94d31b09b..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/domain/SearchResult.kt +++ /dev/null @@ -1,22 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.domain - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class SearchResult( - var resultId: Int = 0, - var resultName: String, - var resultType: String, -) : Parcelable { - constructor() : this(0, "", "") -} diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/Transaction.kt b/core/model/src/main/java/com/mifospay/core/model/domain/Transaction.kt deleted file mode 100644 index 48a73f7f5..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/domain/Transaction.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.domain - -import com.mifospay.core.model.entity.accounts.savings.TransferDetail -import kotlinx.serialization.Serializable - -@Suppress("MaxLineLength") -@Serializable -data class Transaction( - var transactionId: String? = null, - var clientId: Long = 0, - var accountId: Long = 0, - var amount: Double = 0.0, - var date: String? = null, - var currency: Currency = Currency(), - var transactionType: TransactionType = TransactionType.OTHER, - var transferId: Long = 0, - var transferDetail: TransferDetail = TransferDetail(), - var receiptId: String? = null, -) { - constructor() : this( - "", - 0, - 0, - 0.0, - "", - Currency(), - TransactionType.OTHER, - 0, - TransferDetail(), - "", - ) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/domain/twofactor/AccessToken.kt b/core/model/src/main/java/com/mifospay/core/model/domain/twofactor/AccessToken.kt deleted file mode 100644 index 1af3aec06..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/domain/twofactor/AccessToken.kt +++ /dev/null @@ -1,20 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.domain.twofactor - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class AccessToken( - var token: String? = null, - var validFrom: Long? = null, - var validTo: Long? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/Invoice.kt b/core/model/src/main/java/com/mifospay/core/model/entity/Invoice.kt deleted file mode 100644 index 12fd3d9f0..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/Invoice.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize -import kotlinx.parcelize.RawValue - -@Parcelize -data class Invoice( - - @SerializedName("consumerId") - var consumerId: String? = null, - - @SerializedName("consumerName") - var consumerName: String? = null, - - @SerializedName("amount") - var amount: Double = 0.0, - - @SerializedName("itemsBought") - var itemsBought: String? = null, - - @SerializedName("status") - var status: Long = 0L, - - @SerializedName("transactionId") - var transactionId: String? = null, - - @SerializedName("id") - var id: Long = 0L, - - @SerializedName("title") - var title: String? = null, - - @SerializedName("date") - var date: @RawValue MutableList = ArrayList(), - -) : Parcelable { - constructor() : this(null, null, 0.0, null, 0L, null, 0L, null, ArrayList()) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/SearchedEntity.kt b/core/model/src/main/java/com/mifospay/core/model/entity/SearchedEntity.kt deleted file mode 100644 index 6ce6d00a7..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/SearchedEntity.kt +++ /dev/null @@ -1,23 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class SearchedEntity( - var entityId: Int = 0, - var entityAccountNo: String = " ", - var entityName: String = " ", - var entityType: String = " ", - var parentId: Int = 0, - var parentName: String = " ", -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/Timeline.kt b/core/model/src/main/java/com/mifospay/core/model/entity/Timeline.kt deleted file mode 100644 index cbc1e3418..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/Timeline.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity - -import kotlinx.serialization.Serializable - -@Serializable -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, -) { - constructor() : this(ArrayList(), "", "", "", ArrayList(), "", "", "", ArrayList(), "", "", "") -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Currency.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Currency.kt deleted file mode 100644 index a6156f0d3..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Currency.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class Currency( - - @SerializedName("code") - var code: String = " ", - - @SerializedName("name") - var name: String = " ", - - @SerializedName("decimalPlaces") - var decimalPlaces: Int? = null, - - @SerializedName("inMultiplesOf") - var inMultiplesOf: Int? = null, - - @SerializedName("displaySymbol") - var displaySymbol: String = " ", - - @SerializedName("nameCode") - var nameCode: String = " ", - - @SerializedName("displayLabel") - var displayLabel: String = " ", - -) { - constructor() : this("", "", 0, 0, "", "", "") -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/PaymentDetailData.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/PaymentDetailData.kt deleted file mode 100644 index 3cca8dfa6..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/PaymentDetailData.kt +++ /dev/null @@ -1,39 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class PaymentDetailData( - @SerializedName("id") - var id: Int? = null, - - @SerializedName("paymentType") - var paymentType: PaymentType? = null, - - @SerializedName("accountNumber") - var accountNumber: String? = null, - - @SerializedName("checkNumber") - var checkNumber: String? = null, - - @SerializedName("routingCode") - var routingCode: String? = null, - - @SerializedName("receiptNumber") - var receiptNumber: String? = null, - - @SerializedName("bankNumber") - var bankNumber: String? = null, -) { - constructor() : this(null, null, null, null, null, null, null) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/SavingAccount.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/SavingAccount.kt deleted file mode 100644 index 5d3336b15..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/SavingAccount.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import com.mifospay.core.model.entity.client.DepositType -import kotlinx.serialization.Serializable - -@Serializable -data class SavingAccount( - - @SerializedName("id") - var id: Long = 0L, - - @SerializedName("accountNo") - var accountNo: String = " ", - - @SerializedName("productName") - var productName: String = " ", - - @SerializedName("productId") - var productId: Int = 0, - - @SerializedName("overdraftLimit") - var overdraftLimit: Long = 0L, - - @SerializedName("minRequiredBalance") - var minRequiredBalance: Long = 0L, - - @SerializedName("accountBalance") - var accountBalance: Double = 0.0, - - @SerializedName("totalDeposits") - var totalDeposits: Double = 0.0, - - @SerializedName("savingsProductName") - var savingsProductName: String? = null, - - @SerializedName("clientName") - var clientName: String? = null, - - @SerializedName("savingsProductId") - var savingsProductId: String? = null, - - @SerializedName("nominalAnnualInterestRate") - var nominalAnnualInterestRate: Double = 0.0, - - @SerializedName("status") - var status: Status? = null, - - @SerializedName("currency") - var currency: Currency = Currency(), - - @SerializedName("depositType") - var depositType: DepositType? = null, - -) { - fun isRecurring(): Boolean { - return this.depositType != null && this.depositType!!.isRecurring - } - constructor() : this(0L, "", "", 0, 0L, 0L, 0.0, 0.0, "", "", "", 0.0, Status(), Currency(), DepositType()) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/SavingsWithAssociations.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/SavingsWithAssociations.kt deleted file mode 100644 index 5e5304f22..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/SavingsWithAssociations.kt +++ /dev/null @@ -1,113 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import com.mifospay.core.model.entity.client.DepositType -import kotlinx.serialization.Serializable - -@Serializable -data class SavingsWithAssociations( - - @SerializedName("id") - var id: Long = 0L, - - @SerializedName("accountNo") - var accountNo: String? = null, - - @SerializedName("depositType") - var depositType: DepositType? = null, - - @SerializedName("externalId") - var externalId: String = " ", - - @SerializedName("clientId") - var clientId: Int = 0, - - @SerializedName("clientName") - var clientName: String = " ", - - @SerializedName("savingsProductId") - var savingsProductId: Int? = null, - - @SerializedName("savingsProductName") - var savingsProductName: String? = null, - - @SerializedName("fieldOfficerId") - var fieldOfficerId: Int? = null, - - @SerializedName("status") - var status: Status? = null, - - @SerializedName("timeline") - var timeline: TimeLine? = null, - - @SerializedName("currency") - var currency: Currency? = null, - - @SerializedName("nominalAnnualInterestRate") - var nominalAnnualInterestRate: Double? = null, - - @SerializedName("minRequiredOpeningBalance") - var minRequiredOpeningBalance: Double? = null, - - @SerializedName("lockinPeriodFrequency") - var lockinPeriodFrequency: Double? = null, - - @SerializedName("withdrawalFeeForTransfers") - var withdrawalFeeForTransfers: Boolean? = null, - - @SerializedName("allowOverdraft") - var allowOverdraft: Boolean? = null, - - @SerializedName("enforceMinRequiredBalance") - var enforceMinRequiredBalance: Boolean? = null, - - @SerializedName("withHoldTax") - var withHoldTax: Boolean? = null, - - @SerializedName("lastActiveTransactionDate") - var lastActiveTransactionDate: List? = null, - - @SerializedName("isDormancyTrackingActive") - var dormancyTrackingActive: Boolean? = null, - - @SerializedName("summary") - var summary: Summary? = null, - - @SerializedName("transactions") - var transactions: List = ArrayList(), - -) { - constructor() : this( - 0L, - null, - null, - " ", - 0, - " ", - null, - null, - 0, - null, - null, - null, - null, - null, - 0.0, - false, - false, - false, - null, - listOf(), - null, - null, - ) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Status.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Status.kt deleted file mode 100644 index 580034a32..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Status.kt +++ /dev/null @@ -1,72 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class Status( - - @SerializedName("id") - var id: Int? = null, - - @SerializedName("code") - var code: String? = null, - - @SerializedName("value") - var value: String? = null, - - @SerializedName("submittedAndPendingApproval") - var submittedAndPendingApproval: Boolean? = null, - - @SerializedName("approved") - var approved: Boolean? = null, - - @SerializedName("rejected") - var rejected: Boolean? = null, - - @SerializedName("withdrawnByApplicant") - var withdrawnByApplicant: Boolean? = null, - - @SerializedName("active") - var active: Boolean? = null, - - @SerializedName("closed") - var closed: Boolean? = null, - - @SerializedName("prematureClosed") - var prematureClosed: Boolean? = null, - - @SerializedName("transferInProgress") - var transferInProgress: Boolean? = null, - - @SerializedName("transferOnHold") - var transferOnHold: Boolean? = null, - - @SerializedName("matured") - var matured: Boolean? = null, -) { - constructor() : this( - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - ) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Summary.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Summary.kt deleted file mode 100644 index 4107908ab..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Summary.kt +++ /dev/null @@ -1,43 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class Summary( - @SerializedName("currency") - var currency: Currency? = null, - - @SerializedName("totalDeposits") - var totalDeposits: Double? = null, - - @SerializedName("totalWithdrawals") - var totalWithdrawals: Double? = null, - - @SerializedName("totalInterestEarned") - var totalInterestEarned: Double? = null, - - @SerializedName("totalInterestPosted") - var totalInterestPosted: Double? = null, - - @SerializedName("accountBalance") - var accountBalance: Double? = null, - - @SerializedName("totalOverdraftInterestDerived") - var totalOverdraftInterestDerived: Double? = null, - - @SerializedName("interestNotPosted") - var interestNotPosted: Double? = null, - - @SerializedName("lastInterestCalculationDate") - var lastInterestCalculationDate: List? = null, -) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TimeLine.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TimeLine.kt deleted file mode 100644 index 033935f16..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TimeLine.kt +++ /dev/null @@ -1,67 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class TimeLine( - @SerializedName("submittedOnDate") - var submittedOnDate: List = ArrayList(), - - @SerializedName("submittedByUsername") - var submittedByUsername: String? = null, - - @SerializedName("submittedByFirstname") - var submittedByFirstname: String? = null, - - @SerializedName("submittedByLastname") - var submittedByLastname: String? = null, - - @SerializedName("approvedOnDate") - var approvedOnDate: List = ArrayList(), - - @SerializedName("approvedByUsername") - var approvedByUsername: String? = null, - - @SerializedName("approvedByFirstname") - var approvedByFirstname: String? = null, - - @SerializedName("approvedByLastname") - var approvedByLastname: String? = null, - - @SerializedName("activatedOnDate") - var activatedOnDate: List? = null, - - @SerializedName("activatedByUsername") - var activatedByUsername: String? = null, - - @SerializedName("activatedByFirstname") - var activatedByFirstname: String? = null, - - @SerializedName("activatedByLastname") - var activatedByLastname: String? = null, -) { - constructor() : this( - ArrayList(), - null, - null, - null, - ArrayList(), - null, - null, - null, - null, - null, - null, - null, - ) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TransactionType.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TransactionType.kt deleted file mode 100644 index 886a5492c..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TransactionType.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class TransactionType( - @SerializedName("id") - var id: Int? = null, - - @SerializedName("code") - var code: String? = null, - - @SerializedName("value") - var value: String? = null, - - @JvmField - @SerializedName("deposit") - var deposit: Boolean = false, - - @SerializedName("dividendPayout") - var dividendPayout: Boolean = false, - - @JvmField - @SerializedName("withdrawal") - var withdrawal: Boolean = false, - - @SerializedName("interestPosting") - var interestPosting: Boolean = false, - - @SerializedName("feeDeduction") - var feeDeduction: Boolean = false, - - @SerializedName("initiateTransfer") - var initiateTransfer: Boolean = false, - - @SerializedName("approveTransfer") - var approveTransfer: Boolean = false, - - @SerializedName("withdrawTransfer") - var withdrawTransfer: Boolean = false, - - @SerializedName("rejectTransfer") - var rejectTransfer: Boolean = false, - - @SerializedName("overdraftInterest") - var overdraftInterest: Boolean = false, - - @SerializedName("writtenoff") - var writtenoff: Boolean = false, - - @SerializedName("overdraftFee") - var overdraftFee: Boolean = false, - - @SerializedName("withholdTax") - var withholdTax: Boolean = false, - - @SerializedName("escheat") - var escheat: Boolean? = null, -) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Transactions.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Transactions.kt deleted file mode 100644 index b5d7dab26..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/Transactions.kt +++ /dev/null @@ -1,72 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class Transactions( - - @SerializedName("id") - var id: Int? = null, - - @SerializedName("transactionType") - var transactionType: TransactionType = TransactionType(), - - @SerializedName("accountId") - var accountId: Int? = null, - - @SerializedName("accountNo") - var accountNo: String? = null, - - @SerializedName("date") - var date: List = ArrayList(), - - @SerializedName("currency") - var currency: Currency = Currency(), - - @SerializedName("paymentDetailData") - var paymentDetailData: PaymentDetailData? = null, - - @SerializedName("amount") - var amount: Double = 0.0, - - @SerializedName("transfer") - var transfer: Transfer = Transfer(), - - @SerializedName("runningBalance") - var runningBalance: Double? = null, - - @SerializedName("reversed") - var reversed: Boolean? = null, - - @SerializedName("submittedOnDate") - var submittedOnDate: List = ArrayList(), - - @SerializedName("interestedPostedAsOn") - var interestedPostedAsOn: Boolean? = null, -) { - constructor() : this( - 0, - TransactionType(), - 0, - "", - ArrayList(), - Currency(), - PaymentDetailData(), - 0.0, - Transfer(), - 0.0, - false, - ArrayList(), - false, - ) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TransferDetail.kt b/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TransferDetail.kt deleted file mode 100644 index 57c156b6a..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/accounts/savings/TransferDetail.kt +++ /dev/null @@ -1,39 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.accounts.savings - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class TransferDetail( - @SerializedName("id") - var id: Long = 0L, - - @SerializedName("fromClient") - var fromClient: com.mifospay.core.model.domain.client.Client = com.mifospay.core.model.domain.client.Client(), - - @SerializedName("fromAccount") - var fromAccount: SavingAccount = SavingAccount(), - - @SerializedName("toClient") - var toClient: com.mifospay.core.model.domain.client.Client = com.mifospay.core.model.domain.client.Client(), - - @SerializedName("toAccount") - var toAccount: SavingAccount = SavingAccount(), -) { - constructor() : this( - 0L, - com.mifospay.core.model.domain.client.Client(), - SavingAccount(), - com.mifospay.core.model.domain.client.Client(), - SavingAccount(), - ) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/authentication/AuthenticationPayload.kt b/core/model/src/main/java/com/mifospay/core/model/entity/authentication/AuthenticationPayload.kt deleted file mode 100644 index 5fbda092e..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/authentication/AuthenticationPayload.kt +++ /dev/null @@ -1,29 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.authentication - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -// @Parcelize -// class AuthenticationPayload( -// @SerializedName("username") -// val userName: String, -// @SerializedName("password") -// val password: String, -// ) : Parcelable - -@Serializable -data class AuthenticationPayload( - @SerializedName("username") - val username: String, - @SerializedName("password") - val password: String, -) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/beneficary/Beneficiary.kt b/core/model/src/main/java/com/mifospay/core/model/entity/beneficary/Beneficiary.kt deleted file mode 100644 index 4e7fe3b95..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/beneficary/Beneficiary.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.beneficary - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import com.mifospay.core.model.entity.templates.account.AccountType -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Beneficiary( - - @SerializedName("id") - var id: Int? = null, - - @SerializedName("name") - var name: String? = null, - - @SerializedName("officeName") - var officeName: String? = null, - - @SerializedName("clientName") - var clientName: String? = null, - - @SerializedName("accountType") - var accountType: AccountType? = null, - - @SerializedName("accountNumber") - var accountNumber: String? = null, - - @SerializedName("transferLimit") - var transferLimit: Int = 0, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/beneficary/BeneficiaryPayload.kt b/core/model/src/main/java/com/mifospay/core/model/entity/beneficary/BeneficiaryPayload.kt deleted file mode 100644 index 4fa428cd2..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/beneficary/BeneficiaryPayload.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.beneficary - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class BeneficiaryPayload( - var locale: String? = "en_GB", - - @SerializedName("name") - var name: String? = null, - - @SerializedName("accountNumber") - var accountNumber: String? = null, - - @SerializedName("accountType") - var accountType: Int = 0, - - @SerializedName("transferLimit") - var transferLimit: Int = 0, - - @SerializedName("officeName") - var officeName: String? = null, -) : Parcelable { - constructor() : this(null, null, null, 0, 0, null) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/client/Client.kt b/core/model/src/main/java/com/mifospay/core/model/entity/client/Client.kt deleted file mode 100644 index 621915b64..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/client/Client.kt +++ /dev/null @@ -1,101 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.client - -import com.google.gson.annotations.SerializedName -import com.mifospay.core.model.entity.Timeline -import kotlinx.serialization.Serializable - -@Serializable -data class Client( - - @SerializedName("id") - var id: Int = 0, - - @SerializedName("accountNo") - var accountNo: String? = null, - - @SerializedName("status") - private var status: Status? = null, - - @SerializedName("active") - private var active: Boolean? = null, - - @SerializedName("activationDate") - var activationDate: List = ArrayList(), - - @SerializedName("dobDate") - var dobDate: List = ArrayList(), - - @SerializedName("firstname") - var firstname: String? = null, - - @SerializedName("middlename") - var middlename: String? = null, - - @SerializedName("lastname") - var lastname: String? = null, - - @SerializedName("displayName") - var displayName: String? = null, - - @SerializedName("fullname") - var fullname: String? = null, - - @SerializedName("officeId") - var officeId: Int = 0, - - @SerializedName("officeName") - var officeName: String? = null, - - @SerializedName("staffId") - private var staffId: Int? = null, - - @SerializedName("staffName") - private var staffName: String? = null, - - @SerializedName("timeline") - private var timeline: Timeline? = null, - - @SerializedName("imageId") - var imageId: Int = 0, - - @SerializedName("imagePresent") - var isImagePresent: Boolean = false, - - @SerializedName("externalId") - var externalId: String = "", - - @SerializedName("mobileNo") - var mobileNo: String = "", -) { - constructor() : this( - 0, - "", - Status(), - false, - ArrayList(), - ArrayList(), - "", - "", - "", - "", - "", - 0, - "", - 0, - "", - Timeline(), - 0, - false, - "", - "", - ) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/client/Currency.kt b/core/model/src/main/java/com/mifospay/core/model/entity/client/Currency.kt deleted file mode 100644 index 7ebf60fb1..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/client/Currency.kt +++ /dev/null @@ -1,37 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.client - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Currency( - @SerializedName("code") - var code: String? = null, - - @SerializedName("name") - var name: String? = null, - - @SerializedName("decimalPlaces") - var decimalPlaces: Int? = null, - - @SerializedName("displaySymbol") - var displaySymbol: String? = null, - - @SerializedName("nameCode") - var nameCode: String? = null, - - @SerializedName("displayLabel") - var displayLabel: String? = null, -) : Parcelable { - constructor() : this(null, null, null, null, null, null) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/client/Status.kt b/core/model/src/main/java/com/mifospay/core/model/entity/client/Status.kt deleted file mode 100644 index a8d079182..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/client/Status.kt +++ /dev/null @@ -1,27 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.client - -import com.google.gson.annotations.SerializedName -import kotlinx.serialization.Serializable - -@Serializable -data class Status( - @SerializedName("id") - var id: Int? = null, - - @SerializedName("code") - var code: String? = null, - - @SerializedName("value") - var value: String? = null, -) { - constructor() : this(null, null, null) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/client/Type.kt b/core/model/src/main/java/com/mifospay/core/model/entity/client/Type.kt deleted file mode 100644 index e30c7e3fe..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/client/Type.kt +++ /dev/null @@ -1,26 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.client - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Type( - @SerializedName("id") - var id: Int? = null, - - @SerializedName("code") - var code: String? = null, - - @SerializedName("value") - var value: String? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/kyc/KYCLevel1Details.kt b/core/model/src/main/java/com/mifospay/core/model/entity/kyc/KYCLevel1Details.kt deleted file mode 100644 index 507dd276a..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/kyc/KYCLevel1Details.kt +++ /dev/null @@ -1,38 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.kyc - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class KYCLevel1Details( - @SerializedName("firstName") - var firstName: String? = null, - - @SerializedName("lastName") - var lastName: String? = null, - - @SerializedName("addressLine1") - var addressLine1: String? = null, - - @SerializedName("addressLine2") - var addressLine2: String? = null, - - @SerializedName("mobileNo") - var mobileNo: String? = null, - - @SerializedName("dob") - var dob: String? = null, - - @SerializedName("currentLevel") - var currentLevel: String = " ", -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/noncore/Document.kt b/core/model/src/main/java/com/mifospay/core/model/entity/noncore/Document.kt deleted file mode 100644 index eb371c4da..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/noncore/Document.kt +++ /dev/null @@ -1,25 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.noncore - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Document( - var id: Int = 0, - var parentEntityType: String? = null, - var parentEntityId: Int = 0, - var name: String? = null, - var fileName: String? = null, - var size: Long = 0, - var type: String? = null, - var description: String? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/payload/ClientPayload.kt b/core/model/src/main/java/com/mifospay/core/model/entity/payload/ClientPayload.kt deleted file mode 100644 index 0fc7e0b7d..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/payload/ClientPayload.kt +++ /dev/null @@ -1,68 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.payload - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class ClientPayload( - @SerializedName("firstname") - var firstname: String? = null, - - @SerializedName("lastname") - var lastname: String? = null, - - @SerializedName("middlename") - var middlename: String? = null, - - @SerializedName("officeId") - var officeId: Int? = null, - - @SerializedName("staffId") - var staffId: Int? = null, - - @SerializedName("genderId") - var genderId: Int? = null, - - @SerializedName("active") - var active: Boolean? = null, - - @SerializedName("activationDate") - var activationDate: String? = null, - - @SerializedName("submittedOnDate") - var submittedOnDate: String? = null, - - @SerializedName("dateOfBirth") - var dateOfBirth: String? = null, - - @SerializedName("mobileNo") - var mobileNo: String? = null, - - @SerializedName("externalId") - var externalId: String? = null, - - @SerializedName("clientTypeId") - var clientTypeId: Int? = null, - - @SerializedName("clientClassificationId") - var clientClassificationId: Int? = null, - - @SerializedName("dateFormat") - var dateFormat: String? = "DD_MMMM_YYYY", - - @SerializedName("locale") - var locale: String? = "en", - - @SerializedName("datatables") - var datatables: List = ArrayList(), -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/payload/DataTablePayload.kt b/core/model/src/main/java/com/mifospay/core/model/entity/payload/DataTablePayload.kt deleted file mode 100644 index e7d62cc13..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/payload/DataTablePayload.kt +++ /dev/null @@ -1,29 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.payload - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize -import kotlinx.parcelize.RawValue - -@Parcelize -data class DataTablePayload( - @Transient - var id: Int? = null, - - @Transient - var clientCreationTime: Long? = null, - - @Transient - var dataTableString: String? = null, - var registeredTableName: String? = null, - var applicationTableName: String? = null, - var data: @RawValue HashMap? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/payload/TransferPayload.kt b/core/model/src/main/java/com/mifospay/core/model/entity/payload/TransferPayload.kt deleted file mode 100644 index a6194e91c..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/payload/TransferPayload.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.payload - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class TransferPayload( - @SerializedName("fromOfficeId") - var fromOfficeId: Int? = null, - - @SerializedName("fromClientId") - var fromClientId: Long? = null, - - @SerializedName("fromAccountType") - var fromAccountType: Int? = null, - - @SerializedName("fromAccountId") - var fromAccountId: Int? = null, - - @SerializedName("toOfficeId") - var toOfficeId: Int? = null, - - @SerializedName("toClientId") - var toClientId: Long? = null, - - @SerializedName("toAccountType") - var toAccountType: Int? = null, - - @SerializedName("toAccountId") - var toAccountId: Int? = null, - - @SerializedName("transferDate") - var transferDate: String? = null, - - @SerializedName("transferAmount") - var transferAmount: Double? = null, - - @SerializedName("transferDescription") - var transferDescription: String? = null, - var dateFormat: String? = "dd MMMM yyyy", - var locale: String? = "en", -) : Parcelable { - constructor() : this(null, null, null, null, null, null, null, null, null, null, null) -} diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/register/RegisterPayload.kt b/core/model/src/main/java/com/mifospay/core/model/entity/register/RegisterPayload.kt deleted file mode 100644 index 80ed5ffb7..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/register/RegisterPayload.kt +++ /dev/null @@ -1,38 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.register - -import com.google.gson.annotations.SerializedName - -data class RegisterPayload( - @SerializedName("username") - var username: String? = null, - - @SerializedName("firstName") - var firstName: String? = null, - - @SerializedName("lastName") - var lastName: String? = null, - - @SerializedName("email") - var email: String? = null, - - @SerializedName("mobileNumber") - var mobileNumber: String? = null, - - @SerializedName("accountNumber") - var accountNumber: String? = null, - - @SerializedName("password") - var password: String? = null, - - @SerializedName("authenticationMode") - var authenticationMode: String? = null, -) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/register/UserVerify.kt b/core/model/src/main/java/com/mifospay/core/model/entity/register/UserVerify.kt deleted file mode 100644 index 3fee2f9de..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/register/UserVerify.kt +++ /dev/null @@ -1,20 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.register - -import com.google.gson.annotations.SerializedName - -data class UserVerify( - @SerializedName("requestId") - var requestId: String? = null, - - @SerializedName("authenticationToken") - var authenticationToken: String? = null, -) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/savedcards/Card.kt b/core/model/src/main/java/com/mifospay/core/model/entity/savedcards/Card.kt deleted file mode 100644 index 25d08479e..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/savedcards/Card.kt +++ /dev/null @@ -1,35 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.savedcards - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class Card( - @SerializedName("cardNumber") - var cardNumber: String = " ", - - @SerializedName("cvv") - var cvv: String = " ", - - @SerializedName("expiryDate") - var expiryDate: String = " ", - - @SerializedName("firstName") - var firstName: String = " ", - - @SerializedName("lastName") - var lastName: String = " ", - - @SerializedName("id") - var id: Int = 0, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/standinginstruction/SDIResponse.kt b/core/model/src/main/java/com/mifospay/core/model/entity/standinginstruction/SDIResponse.kt deleted file mode 100644 index f3a320406..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/standinginstruction/SDIResponse.kt +++ /dev/null @@ -1,16 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.standinginstruction - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class SDIResponse(val clientId: Int, val resourceId: String?) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/standinginstruction/StandingInstruction.kt b/core/model/src/main/java/com/mifospay/core/model/entity/standinginstruction/StandingInstruction.kt deleted file mode 100644 index 84242a7f4..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/standinginstruction/StandingInstruction.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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.standinginstruction - -import com.google.gson.annotations.SerializedName -import com.mifospay.core.model.entity.accounts.savings.SavingAccount -import com.mifospay.core.model.entity.client.Client -import com.mifospay.core.model.entity.client.Status -import kotlinx.serialization.Serializable - -@Serializable -data class StandingInstruction( - - val id: Long, - - @SerializedName("name") - val name: String, - - @SerializedName("fromClient") - val fromClient: Client, - - @SerializedName("fromAccount") - val fromAccount: SavingAccount, - - @SerializedName("toClient") - val toClient: Client, - - @SerializedName("toAccount") - val toAccount: SavingAccount, - - @SerializedName("status") - val status: Status, - - @SerializedName("amount") - var amount: Double, - - @SerializedName("validFrom") - val validFrom: List, - - @SerializedName("validTill") - var validTill: List?, - - @SerializedName("recurrenceInterval") - var recurrenceInterval: Int, - - @SerializedName("recurrenceOnMonthDay") - val recurrenceOnMonthDay: List, -) diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountOption.kt b/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountOption.kt deleted file mode 100644 index ca3e6434b..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountOption.kt +++ /dev/null @@ -1,39 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.templates.account - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class AccountOption( - - @SerializedName("accountId") - var accountId: Int? = null, - - @SerializedName("accountNo") - var accountNo: String? = null, - - @SerializedName("accountType") - var accountType: AccountType? = null, - - @SerializedName("clientId") - var clientId: Long? = null, - - @SerializedName("clientName") - var clientName: String? = null, - - @SerializedName("officeId") - var officeId: Int? = null, - - @SerializedName("officeName") - var officeName: String? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountOptionsTemplate.kt b/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountOptionsTemplate.kt deleted file mode 100644 index 6f6e068a3..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountOptionsTemplate.kt +++ /dev/null @@ -1,22 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.templates.account - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class AccountOptionsTemplate( - var fromAccountOptions: List? = ArrayList(), - - @SerializedName("toAccountOptions") - var toAccountOptions: List? = ArrayList(), -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountType.kt b/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountType.kt deleted file mode 100644 index 0df94a88d..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/templates/account/AccountType.kt +++ /dev/null @@ -1,26 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.templates.account - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class AccountType( - @SerializedName("id") - var id: Int? = null, - - @SerializedName("code") - var code: String? = null, - - @SerializedName("value") - var value: String? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/templates/beneficiary/AccountTypeOption.kt b/core/model/src/main/java/com/mifospay/core/model/entity/templates/beneficiary/AccountTypeOption.kt deleted file mode 100644 index 54467b5fa..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/templates/beneficiary/AccountTypeOption.kt +++ /dev/null @@ -1,26 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.templates.beneficiary - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class AccountTypeOption( - @SerializedName("id") - var id: Int? = null, - - @SerializedName("code") - var code: String? = null, - - @SerializedName("value") - var value: String? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt b/core/model/src/main/java/com/mifospay/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt deleted file mode 100644 index 4468f9756..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/entity/templates/beneficiary/BeneficiaryTemplate.kt +++ /dev/null @@ -1,20 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.entity.templates.beneficiary - -import android.os.Parcelable -import com.google.gson.annotations.SerializedName -import kotlinx.parcelize.Parcelize - -@Parcelize -data class BeneficiaryTemplate( - @SerializedName("accountTypeOptions") - var accountTypeOptions: List? = null, -) : Parcelable diff --git a/core/model/src/main/java/com/mifospay/core/model/utils/DateHelper.kt b/core/model/src/main/java/com/mifospay/core/model/utils/DateHelper.kt deleted file mode 100644 index da39fd6ab..000000000 --- a/core/model/src/main/java/com/mifospay/core/model/utils/DateHelper.kt +++ /dev/null @@ -1,141 +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-wallet/blob/master/LICENSE.md - */ -package com.mifospay.core.model.utils - -import android.util.Log -import java.text.ParseException -import java.text.SimpleDateFormat -import java.util.Calendar -import java.util.Date -import java.util.Locale - -object DateHelper { - private val LOG_TAG = DateHelper::class.java.simpleName - private const val DD_MMM_YYYY = "dd MMM yyyy" - private const val DD_MM_YYYY = "dd-MM-yyyy" - - /** - * the result string uses the list given in a reverse order ([x, y, z] results in "z y x") - * - * @param integersOfDate [year-month-day] (ex [2016, 4, 14]) - * @return date in the format day month year (ex 14 Apr 2016) - */ - - @JvmStatic - fun getDateAsString(integersOfDate: List): String { - val stringBuilder = StringBuilder() - stringBuilder.append(integersOfDate[2]) - .append(' ') - .append(getMonthName(integersOfDate[1])) - .append(' ') - .append(integersOfDate[0]) - return stringBuilder.toString() - } - - fun getDateAsString(integersOfDate: List, pattern: String?): String { - return getFormatConverter( - DD_MMM_YYYY, - pattern, - getDateAsString(integersOfDate), - ) - } - - /** - * This Method converting the dd-MM-yyyy format type date string into dd MMMM yyyy - * - * @param format Final Format of date string - * @param dateString date string - * @return dd MMMM yyyy format date string. - */ - fun getSpecificFormat(format: String, dateString: String): String { - val pickerFormat = SimpleDateFormat(DD_MM_YYYY, Locale.ENGLISH) - val finalFormat = SimpleDateFormat(format, Locale.ENGLISH) - var date: Date? = null - try { - date = pickerFormat.parse(dateString) - } catch (e: ParseException) { - Log.d(LOG_TAG, e.message.toString()) - } - return finalFormat.format(date) - } - - fun getFormatConverter( - currentFormat: String?, - requiredFormat: String?, - dateString: String?, - ): String { - val pickerFormat = SimpleDateFormat(currentFormat, Locale.ENGLISH) - val finalFormat = SimpleDateFormat(requiredFormat, Locale.ENGLISH) - var date: Date? = null - try { - date = pickerFormat.parse(dateString) - } catch (e: ParseException) { - Log.d(LOG_TAG, e.localizedMessage) - } - return finalFormat.format(date) - } - - /** - * @param month an integer from 1 to 12 - * @return string representation of the month like Jan or Feb..etc - */ - private fun getMonthName(month: Int): String { - var monthName = "" - when (month) { - 1 -> monthName = "Jan" - 2 -> monthName = "Feb" - 3 -> monthName = "Mar" - 4 -> monthName = "Apr" - 5 -> monthName = "May" - 6 -> monthName = "Jun" - 7 -> monthName = "Jul" - 8 -> monthName = "Aug" - 9 -> monthName = "Sep" - 10 -> monthName = "Oct" - 11 -> monthName = "Nov" - 12 -> monthName = "Dec" - } - return monthName - } - - private fun getDateAsLongFromString(dateStr: String?, pattern: String?): Long { - val sdf = SimpleDateFormat(pattern, Locale.getDefault()) - var date: Date? = null - try { - date = sdf.parse(dateStr) - } catch (e: ParseException) { - Log.d("TAG", e.message!!) - } - return date!!.time - } - - fun getDateAsLongFromList(integersOfDate: List): Long { - val dateStr = getDateAsString(integersOfDate) - return getDateAsLongFromString(dateStr, DD_MMM_YYYY) - } - - fun subtractWeeks(number: Int): Long { - val calendar = Calendar.getInstance() - calendar.add(Calendar.WEEK_OF_YEAR, -number) - return calendar.timeInMillis - } - - fun subtractMonths(number: Int): Long { - val calendar = Calendar.getInstance() - calendar.add(Calendar.MONTH, -number) - return calendar.timeInMillis - } - - @JvmStatic - fun getDateAsStringFromLong(timeInMillis: Long): String { - val sdf = SimpleDateFormat(DD_MMM_YYYY, Locale.getDefault()) - return sdf.format(Date(timeInMillis)) - } -} diff --git a/core/network/src/androidMain/kotlin/org/mifospay/core/network/localAssets/LocalAssetDataSource.kt b/core/network/src/androidMain/kotlin/org/mifospay/core/network/localAssets/LocalAssetDataSource.kt index 351a54ba9..d884d5157 100644 --- a/core/network/src/androidMain/kotlin/org/mifospay/core/network/localAssets/LocalAssetDataSource.kt +++ b/core/network/src/androidMain/kotlin/org/mifospay/core/network/localAssets/LocalAssetDataSource.kt @@ -9,9 +9,9 @@ */ package org.mifospay.core.network.localAssets -import com.mifospay.core.model.City -import com.mifospay.core.model.Country -import com.mifospay.core.model.State +import org.mifospay.core.model.City +import org.mifospay.core.model.Country +import org.mifospay.core.model.State interface LocalAssetDataSource { diff --git a/core/network/src/androidMain/kotlin/org/mifospay/core/network/localAssets/MifosLocalAssetDataSource.kt b/core/network/src/androidMain/kotlin/org/mifospay/core/network/localAssets/MifosLocalAssetDataSource.kt index 1bb530e4d..f14662124 100644 --- a/core/network/src/androidMain/kotlin/org/mifospay/core/network/localAssets/MifosLocalAssetDataSource.kt +++ b/core/network/src/androidMain/kotlin/org/mifospay/core/network/localAssets/MifosLocalAssetDataSource.kt @@ -9,9 +9,9 @@ */ package org.mifospay.core.network.localAssets -import com.mifospay.core.model.City -import com.mifospay.core.model.Country -import com.mifospay.core.model.State +import org.mifospay.core.model.City +import org.mifospay.core.model.Country +import org.mifospay.core.model.State import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.withContext import kotlinx.serialization.ExperimentalSerializationApi diff --git a/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/BeneficiaryService.kt b/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/BeneficiaryService.kt index e9b074a1a..198e3bcd4 100644 --- a/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/BeneficiaryService.kt +++ b/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/BeneficiaryService.kt @@ -10,7 +10,7 @@ package org.mifospay.core.network.services import com.mifospay.core.model.entity.beneficary.Beneficiary -import com.mifospay.core.model.entity.beneficary.BeneficiaryPayload +import org.mifospay.core.model.entity.beneficary.BeneficiaryPayload import com.mifospay.core.model.entity.beneficary.BeneficiaryUpdatePayload import com.mifospay.core.model.entity.templates.beneficiary.BeneficiaryTemplate import okhttp3.ResponseBody @@ -34,7 +34,7 @@ interface BeneficiaryService { val beneficiaryTemplate: Observable @POST(ApiEndPoints.BENEFICIARIES + "/tpt") - fun createBeneficiary(@Body beneficiaryPayload: BeneficiaryPayload): Observable + fun createBeneficiary(@Body beneficiaryPayload: org.mifospay.core.model.entity.beneficary.BeneficiaryPayload): Observable @PUT(ApiEndPoints.BENEFICIARIES + "/tpt/{beneficiaryId}") fun updateBeneficiary( diff --git a/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/KYCLevel1Service.kt b/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/KYCLevel1Service.kt index 444b72cb6..1066b8e7e 100644 --- a/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/KYCLevel1Service.kt +++ b/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/KYCLevel1Service.kt @@ -9,7 +9,7 @@ */ package org.mifospay.core.network.services -import com.mifospay.core.model.entity.kyc.KYCLevel1Details +import org.mifospay.core.model.entity.kyc.KYCLevel1Details import org.mifospay.core.network.ApiEndPoints import org.mifospay.core.network.GenericResponse import retrofit2.http.Body @@ -23,15 +23,15 @@ interface KYCLevel1Service { @POST(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}") fun addKYCLevel1Details( @Path("clientId") clientId: Int, - @Body kycLevel1Details: KYCLevel1Details, + @Body kycLevel1Details: org.mifospay.core.model.entity.kyc.KYCLevel1Details, ): Observable @GET(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}") - fun fetchKYCLevel1Details(@Path("clientId") clientId: Int): Observable> + fun fetchKYCLevel1Details(@Path("clientId") clientId: Int): Observable> @PUT(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}/") fun updateKYCLevel1Details( @Path("clientId") clientId: Int, - @Body kycLevel1Details: KYCLevel1Details, + @Body kycLevel1Details: org.mifospay.core.model.entity.kyc.KYCLevel1Details, ): Observable } diff --git a/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/ThirdPartyTransferService.kt b/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/ThirdPartyTransferService.kt index 2e6d73f6d..a05074da1 100644 --- a/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/ThirdPartyTransferService.kt +++ b/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/ThirdPartyTransferService.kt @@ -11,7 +11,7 @@ package org.mifospay.core.network.services import com.mifospay.core.model.entity.TPTResponse import com.mifospay.core.model.entity.payload.TransferPayload -import com.mifospay.core.model.entity.templates.account.AccountOptionsTemplate +import org.mifospay.core.model.entity.templates.account.AccountOptionsTemplate import org.mifospay.core.network.ApiEndPoints import retrofit2.http.Body import retrofit2.http.GET @@ -23,7 +23,7 @@ import rx.Observable */ interface ThirdPartyTransferService { @get:GET(ApiEndPoints.ACCOUNT_TRANSFER + "/template?type=tpt") - val accountTransferTemplate: Observable + val accountTransferTemplate: Observable @POST(ApiEndPoints.ACCOUNT_TRANSFER + "?type=\"tpt\"") fun makeTransfer(@Body transferPayload: TransferPayload): Observable diff --git a/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/TwoFactorAuthService.kt b/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/TwoFactorAuthService.kt index 8a4b53ec4..968c5a6b9 100644 --- a/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/TwoFactorAuthService.kt +++ b/core/network/src/androidMain/kotlin/org/mifospay/core/network/services/TwoFactorAuthService.kt @@ -10,7 +10,7 @@ package org.mifospay.core.network.services import com.mifospay.core.model.domain.twofactor.AccessToken -import com.mifospay.core.model.domain.twofactor.DeliveryMethod +import org.mifospay.core.model.domain.twofactor.DeliveryMethod import org.mifospay.core.network.ApiEndPoints import retrofit2.http.GET import retrofit2.http.POST @@ -22,7 +22,7 @@ import rx.Observable */ interface TwoFactorAuthService { @get:GET(ApiEndPoints.TWOFACTOR) - val deliveryMethods: Observable> + val deliveryMethods: Observable> @POST(ApiEndPoints.TWOFACTOR) fun requestOTP(@Query("deliveryMethod") deliveryMethod: String): Observable diff --git a/feature/auth/src/main/kotlin/org/mifospay/feature/auth/signup/SignupScreen.kt b/feature/auth/src/main/kotlin/org/mifospay/feature/auth/signup/SignupScreen.kt index d52642be0..91525c17a 100644 --- a/feature/auth/src/main/kotlin/org/mifospay/feature/auth/signup/SignupScreen.kt +++ b/feature/auth/src/main/kotlin/org/mifospay/feature/auth/signup/SignupScreen.kt @@ -43,7 +43,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle -import com.mifospay.core.model.State +import org.mifospay.core.model.State import com.mifospay.core.model.signup.PasswordStrength import com.mifospay.core.model.signup.SignupData import org.koin.androidx.compose.koinViewModel diff --git a/feature/auth/src/main/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt b/feature/auth/src/main/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt index c9e3aeb77..4fd21843f 100644 --- a/feature/auth/src/main/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt +++ b/feature/auth/src/main/kotlin/org/mifospay/feature/auth/signup/SignupViewModel.kt @@ -14,7 +14,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.mifospay.core.model.State +import org.mifospay.core.model.State import com.mifospay.core.model.domain.user.NewUser import com.mifospay.core.model.domain.user.UpdateUserEntityClients import com.mifospay.core.model.domain.user.User diff --git a/feature/invoices/src/main/kotlin/org/mifospay/feature/invoices/InvoiceDetailScreen.kt b/feature/invoices/src/main/kotlin/org/mifospay/feature/invoices/InvoiceDetailScreen.kt index 5abca0b6d..5655614e6 100644 --- a/feature/invoices/src/main/kotlin/org/mifospay/feature/invoices/InvoiceDetailScreen.kt +++ b/feature/invoices/src/main/kotlin/org/mifospay/feature/invoices/InvoiceDetailScreen.kt @@ -37,7 +37,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.mifospay.core.model.entity.Invoice -import com.mifospay.core.model.utils.DateHelper +import org.mifospay.core.model.utils.DateHelper import org.koin.androidx.compose.koinViewModel import org.mifospay.common.Constants import org.mifospay.core.designsystem.component.MfOverlayLoadingWheel @@ -263,7 +263,7 @@ private fun InvoiceDetailsContent( modifier = Modifier.padding(top = 10.dp), ) Text( - text = DateHelper.getDateAsString(invoice!!.date), + text = org.mifospay.core.model.utils.DateHelper.getDateAsString(invoice!!.date), modifier = Modifier.padding(top = 10.dp), ) } diff --git a/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionScreen.kt b/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionScreen.kt index b8d30baad..45db65ee7 100644 --- a/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionScreen.kt +++ b/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionScreen.kt @@ -45,7 +45,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.mifos.library.pullrefresh.PullRefreshIndicator import com.mifos.library.pullrefresh.pullRefresh import com.mifos.library.pullrefresh.rememberPullRefreshState -import com.mifospay.core.model.entity.kyc.KYCLevel1Details +import org.mifospay.core.model.entity.kyc.KYCLevel1Details import org.koin.androidx.compose.koinViewModel import org.mifospay.core.designsystem.component.MifosButton import org.mifospay.core.designsystem.component.MifosOverlayLoadingWheel @@ -137,7 +137,7 @@ private fun KYCDescriptionScreen( @Composable private fun KYCDescriptionScreen( - kyc: KYCLevel1Details, + kyc: org.mifospay.core.model.entity.kyc.KYCLevel1Details, onLevel1Clicked: () -> Unit, onLevel2Clicked: () -> Unit, onLevel3Clicked: () -> Unit, @@ -285,7 +285,7 @@ private fun KYCDescriptionPreview() { val onLevel2Clicked: () -> Unit = { } val onLevel3Clicked: () -> Unit = { } KYCDescriptionScreen( - kyc = KYCLevel1Details(), + kyc = org.mifospay.core.model.entity.kyc.KYCLevel1Details(), onLevel1Clicked, onLevel2Clicked, onLevel3Clicked, @@ -298,22 +298,22 @@ internal class KYCDescriptionUiStatePreviewProvider : KYCDescriptionUiState.Loading, KYCDescriptionUiState.Error, KYCDescriptionUiState.KYCDescription( - KYCLevel1Details().apply { + org.mifospay.core.model.entity.kyc.KYCLevel1Details().apply { currentLevel = "0" }, ), KYCDescriptionUiState.KYCDescription( - KYCLevel1Details().apply { + org.mifospay.core.model.entity.kyc.KYCLevel1Details().apply { currentLevel = "1" }, ), KYCDescriptionUiState.KYCDescription( - KYCLevel1Details().apply { + org.mifospay.core.model.entity.kyc.KYCLevel1Details().apply { currentLevel = "2" }, ), KYCDescriptionUiState.KYCDescription( - KYCLevel1Details().apply { + org.mifospay.core.model.entity.kyc.KYCLevel1Details().apply { currentLevel = "3" }, ), diff --git a/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt b/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt index a2f9fd98b..2fafcf592 100644 --- a/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt +++ b/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCDescriptionViewModel.kt @@ -11,7 +11,7 @@ package org.mifospay.feature.kyc import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.mifospay.core.model.entity.kyc.KYCLevel1Details +import org.mifospay.core.model.entity.kyc.KYCLevel1Details import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow @@ -74,7 +74,7 @@ class KYCDescriptionViewModel( } sealed interface KYCDescriptionUiState { - data class KYCDescription(val kycLevel1Details: KYCLevel1Details?) : KYCDescriptionUiState + data class KYCDescription(val kycLevel1Details: org.mifospay.core.model.entity.kyc.KYCLevel1Details?) : KYCDescriptionUiState data object Error : KYCDescriptionUiState data object Loading : KYCDescriptionUiState } diff --git a/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt b/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt index 3e7f282d1..e55a6d61b 100644 --- a/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt +++ b/feature/kyc/src/main/kotlin/org/mifospay/feature/kyc/KYCLevel1ViewModel.kt @@ -10,7 +10,7 @@ package org.mifospay.feature.kyc import androidx.lifecycle.ViewModel -import com.mifospay.core.model.entity.kyc.KYCLevel1Details +import org.mifospay.core.model.entity.kyc.KYCLevel1Details import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import org.mifospay.core.data.base.UseCase @@ -72,8 +72,8 @@ data class KYCLevel1DetailsState( val currentLevel: String = "1", ) -internal fun KYCLevel1DetailsState.toModel(): KYCLevel1Details { - return KYCLevel1Details( +internal fun KYCLevel1DetailsState.toModel(): org.mifospay.core.model.entity.kyc.KYCLevel1Details { + return org.mifospay.core.model.entity.kyc.KYCLevel1Details( firstName = firstName.trim(), lastName = lastName.trim(), addressLine1 = addressLine1.trim(), diff --git a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt index 2e2cac8e1..f621ef4e4 100644 --- a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt +++ b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileViewModel.kt @@ -81,7 +81,7 @@ class EditProfileViewModel( mUseCaseHandler.execute( updateClientUseCase, UpdateClient.RequestValues( - com.mifospay.core.model.domain.client.UpdateClientEntityMobile( + org.mifospay.core.model.domain.client.UpdateClientEntityMobile( fullNumber!!, ), mPreferencesHelper.clientId.toInt().toLong(), diff --git a/mifospay/src/main/java/org/mifospay/MainActivityViewModel.kt b/mifospay/src/main/java/org/mifospay/MainActivityViewModel.kt index 35ddb856e..165bf0451 100644 --- a/mifospay/src/main/java/org/mifospay/MainActivityViewModel.kt +++ b/mifospay/src/main/java/org/mifospay/MainActivityViewModel.kt @@ -11,7 +11,7 @@ package org.mifospay import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.mifospay.core.model.UserData +import org.mifospay.core.model.UserData import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.map