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 {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.noarg")
|
||||
}
|
||||
|
||||
|
||||
|
@ -101,6 +102,11 @@ kotlin {
|
|||
}
|
||||
|
||||
|
||||
noArg {
|
||||
annotation("net.codinux.accounting.common.config.NoArgConstructor")
|
||||
}
|
||||
|
||||
|
||||
|
||||
ext["customArtifactId"] = "banking-client-model"
|
||||
|
||||
|
|
|
@ -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
|
||||
)
|
||||
) {
|
||||
override fun toString() = "$bankCode $loginName"
|
||||
}
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
package net.codinux.banking.client.model
|
||||
|
||||
import net.codinux.banking.client.model.config.NoArgConstructor
|
||||
|
||||
@NoArgConstructor
|
||||
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