diff --git a/BankingClientModel/build.gradle.kts b/BankingClientModel/build.gradle.kts index 1b7e7ca4..ece2949b 100644 --- a/BankingClientModel/build.gradle.kts +++ b/BankingClientModel/build.gradle.kts @@ -84,7 +84,7 @@ kotlin { jvmMain { dependencies { - + implementation("com.fasterxml.jackson.core:jackson-annotations:2.15.0") } } jvmTest { } diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.kt new file mode 100644 index 00000000..d47ad1e8 --- /dev/null +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.kt @@ -0,0 +1,3 @@ +package net.codinux.banking.client.model.config + +expect annotation class JsonIgnore() diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/response/GetAccountDataResponse.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/response/GetAccountDataResponse.kt index a0a9d7f0..b91308cf 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/response/GetAccountDataResponse.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/response/GetAccountDataResponse.kt @@ -2,6 +2,7 @@ package net.codinux.banking.client.model.response import net.codinux.banking.client.model.AccountTransaction import net.codinux.banking.client.model.CustomerAccount +import net.codinux.banking.client.model.config.JsonIgnore import net.codinux.banking.client.model.config.NoArgConstructor @NoArgConstructor @@ -9,8 +10,10 @@ class GetAccountDataResponse( val customer: CustomerAccount ) { + @get:JsonIgnore val bookedTransactions: List get() = customer.accounts.flatMap { it.bookedTransactions }.sortedByDescending { it.valueDate } + override fun toString() = customer.toString() } \ No newline at end of file diff --git a/BankingClientModel/src/jsMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.js.kt b/BankingClientModel/src/jsMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.js.kt new file mode 100644 index 00000000..fa075a72 --- /dev/null +++ b/BankingClientModel/src/jsMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.js.kt @@ -0,0 +1,3 @@ +package net.codinux.banking.client.model.config + +actual annotation class JsonIgnore \ No newline at end of file diff --git a/BankingClientModel/src/jvmMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.jvm.kt b/BankingClientModel/src/jvmMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.jvm.kt new file mode 100644 index 00000000..2b2ece81 --- /dev/null +++ b/BankingClientModel/src/jvmMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.jvm.kt @@ -0,0 +1,6 @@ +package net.codinux.banking.client.model.config + +import com.fasterxml.jackson.annotation.JsonIgnore + +@JsonIgnore +actual annotation class JsonIgnore \ No newline at end of file diff --git a/BankingClientModel/src/nativeMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.native.kt b/BankingClientModel/src/nativeMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.native.kt new file mode 100644 index 00000000..fa075a72 --- /dev/null +++ b/BankingClientModel/src/nativeMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.native.kt @@ -0,0 +1,3 @@ +package net.codinux.banking.client.model.config + +actual annotation class JsonIgnore \ No newline at end of file diff --git a/BankingClientModel/src/wasmJsMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.wasmJs.kt b/BankingClientModel/src/wasmJsMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.wasmJs.kt new file mode 100644 index 00000000..fa075a72 --- /dev/null +++ b/BankingClientModel/src/wasmJsMain/kotlin/net/codinux/banking/client/model/config/JsonIgnore.wasmJs.kt @@ -0,0 +1,3 @@ +package net.codinux.banking.client.model.config + +actual annotation class JsonIgnore \ No newline at end of file