diff --git a/BankingClientModel/build.gradle.kts b/BankingClientModel/build.gradle.kts index f225d6be..1b7e7ca4 100644 --- a/BankingClientModel/build.gradle.kts +++ b/BankingClientModel/build.gradle.kts @@ -4,6 +4,7 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl plugins { kotlin("multiplatform") + kotlin("plugin.noarg") } @@ -101,6 +102,11 @@ kotlin { } +noArg { + annotation("net.codinux.accounting.common.config.NoArgConstructor") +} + + ext["customArtifactId"] = "banking-client-model" diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountCredentials.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountCredentials.kt index 35c5e0c4..2ead74dc 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountCredentials.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountCredentials.kt @@ -1,7 +1,12 @@ package net.codinux.banking.client.model +import net.codinux.banking.client.model.config.NoArgConstructor + +@NoArgConstructor class AccountCredentials( var bankCode: String, var loginName: String, var password: String -) \ No newline at end of file +) { + override fun toString() = "$bankCode $loginName" +} \ No newline at end of file diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountTransaction.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountTransaction.kt index abbbf45b..d45f5282 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountTransaction.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/AccountTransaction.kt @@ -1,7 +1,9 @@ package net.codinux.banking.client.model import kotlinx.datetime.LocalDate +import net.codinux.banking.client.model.config.NoArgConstructor +@NoArgConstructor class AccountTransaction( val amount: Amount = Amount.Zero, val currency: String, diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/Amount.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/Amount.kt index e688cb7f..bd98ea00 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/Amount.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/Amount.kt @@ -1,8 +1,10 @@ package net.codinux.banking.client.model +import net.codinux.banking.client.model.config.NoArgConstructor import kotlin.jvm.JvmInline @JvmInline +@NoArgConstructor value class Amount(val amount: String = "0") { companion object { diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccount.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccount.kt index 1401f6a8..3e3c069e 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccount.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/BankAccount.kt @@ -1,7 +1,9 @@ package net.codinux.banking.client.model import kotlinx.datetime.LocalDate +import net.codinux.banking.client.model.config.NoArgConstructor +@NoArgConstructor class BankAccount( val identifier: String, var accountHolderName: String, diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/CustomerAccount.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/CustomerAccount.kt index 64b23a9d..9b1fae92 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/CustomerAccount.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/CustomerAccount.kt @@ -1,5 +1,8 @@ package net.codinux.banking.client.model +import net.codinux.banking.client.model.config.NoArgConstructor + +@NoArgConstructor class CustomerAccount( val bankCode: String, var loginName: String, diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/UnbookedAccountTransaction.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/UnbookedAccountTransaction.kt index dc9f3edb..66ef4882 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/UnbookedAccountTransaction.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/UnbookedAccountTransaction.kt @@ -1,4 +1,7 @@ package net.codinux.banking.client.model +import net.codinux.banking.client.model.config.NoArgConstructor + +@NoArgConstructor class UnbookedAccountTransaction { } \ No newline at end of file diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/config/NoArgConstructor.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/config/NoArgConstructor.kt new file mode 100644 index 00000000..20a4551b --- /dev/null +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/config/NoArgConstructor.kt @@ -0,0 +1,6 @@ +package net.codinux.banking.client.model.config + +/** + * Marker interface for Kotlin No-arg plugin so that No-arg plugin adds no-arg constructors to classes marked with this annotation. + */ +annotation class NoArgConstructor \ No newline at end of file