Added no-arg constructors so that e.g. deserialization with Jackson works
This commit is contained in:
parent
21d13622d3
commit
2a90e6d19d
|
@ -4,6 +4,7 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
|
kotlin("plugin.noarg")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,6 +102,11 @@ kotlin {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
noArg {
|
||||||
|
annotation("net.codinux.accounting.common.config.NoArgConstructor")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ext["customArtifactId"] = "banking-client-model"
|
ext["customArtifactId"] = "banking-client-model"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
package net.codinux.banking.client.model
|
package net.codinux.banking.client.model
|
||||||
|
|
||||||
|
import net.codinux.banking.client.model.config.NoArgConstructor
|
||||||
|
|
||||||
|
@NoArgConstructor
|
||||||
class AccountCredentials(
|
class AccountCredentials(
|
||||||
var bankCode: String,
|
var bankCode: String,
|
||||||
var loginName: String,
|
var loginName: String,
|
||||||
var password: String
|
var password: String
|
||||||
)
|
) {
|
||||||
|
override fun toString() = "$bankCode $loginName"
|
||||||
|
}
|
|
@ -1,7 +1,9 @@
|
||||||
package net.codinux.banking.client.model
|
package net.codinux.banking.client.model
|
||||||
|
|
||||||
import kotlinx.datetime.LocalDate
|
import kotlinx.datetime.LocalDate
|
||||||
|
import net.codinux.banking.client.model.config.NoArgConstructor
|
||||||
|
|
||||||
|
@NoArgConstructor
|
||||||
class AccountTransaction(
|
class AccountTransaction(
|
||||||
val amount: Amount = Amount.Zero,
|
val amount: Amount = Amount.Zero,
|
||||||
val currency: String,
|
val currency: String,
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package net.codinux.banking.client.model
|
package net.codinux.banking.client.model
|
||||||
|
|
||||||
|
import net.codinux.banking.client.model.config.NoArgConstructor
|
||||||
import kotlin.jvm.JvmInline
|
import kotlin.jvm.JvmInline
|
||||||
|
|
||||||
@JvmInline
|
@JvmInline
|
||||||
|
@NoArgConstructor
|
||||||
value class Amount(val amount: String = "0") {
|
value class Amount(val amount: String = "0") {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package net.codinux.banking.client.model
|
package net.codinux.banking.client.model
|
||||||
|
|
||||||
import kotlinx.datetime.LocalDate
|
import kotlinx.datetime.LocalDate
|
||||||
|
import net.codinux.banking.client.model.config.NoArgConstructor
|
||||||
|
|
||||||
|
@NoArgConstructor
|
||||||
class BankAccount(
|
class BankAccount(
|
||||||
val identifier: String,
|
val identifier: String,
|
||||||
var accountHolderName: String,
|
var accountHolderName: String,
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package net.codinux.banking.client.model
|
package net.codinux.banking.client.model
|
||||||
|
|
||||||
|
import net.codinux.banking.client.model.config.NoArgConstructor
|
||||||
|
|
||||||
|
@NoArgConstructor
|
||||||
class CustomerAccount(
|
class CustomerAccount(
|
||||||
val bankCode: String,
|
val bankCode: String,
|
||||||
var loginName: String,
|
var loginName: String,
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
package net.codinux.banking.client.model
|
package net.codinux.banking.client.model
|
||||||
|
|
||||||
|
import net.codinux.banking.client.model.config.NoArgConstructor
|
||||||
|
|
||||||
|
@NoArgConstructor
|
||||||
class UnbookedAccountTransaction {
|
class UnbookedAccountTransaction {
|
||||||
}
|
}
|
|
@ -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
|
Loading…
Reference in New Issue