[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 01/02: fetching
From: |
gnunet |
Subject: |
[libeufin] 01/02: fetching |
Date: |
Tue, 16 Jun 2020 15:50:49 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository libeufin.
commit f0b8d057dd6308c2f0f43f54bdb1066623121755
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Tue Jun 16 19:00:37 2020 +0530
fetching
---
nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt | 4 ++++
.../main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt | 16 ++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
index c5d7c3a..cff2b05 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
@@ -143,9 +143,13 @@ abstract class FetchSpecJson(
val bankConnection: String?
)
+@JsonTypeName("latest")
class FetchSpecLatestJson(level: FetchLevel, bankConnection: String?) :
FetchSpecJson(level, bankConnection)
+@JsonTypeName("all")
class FetchSpecAllJson(level: FetchLevel, bankConnection: String?) :
FetchSpecJson(level, bankConnection)
+@JsonTypeName("since-last")
class FetchSpecSinceLastJson(level: FetchLevel, bankConnection: String?) :
FetchSpecJson(level, bankConnection)
+@JsonTypeName("previous-days")
class FetchSpecPreviousDaysJson(level: FetchLevel, bankConnection: String?,
val number: Int) :
FetchSpecJson(level, bankConnection)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
index 57d531a..abbcaf1 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
@@ -48,6 +48,7 @@ import tech.libeufin.util.*
import tech.libeufin.util.ebics_h004.HTDResponseOrderData
import java.io.ByteArrayOutputStream
import java.security.interfaces.RSAPrivateCrtKey
+import java.time.LocalDate
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.*
@@ -78,6 +79,21 @@ suspend fun fetchEbicsBySpec(fetchSpec: FetchSpecJson,
client: HttpClient, bankC
}
}
}
+ is FetchSpecAllJson -> {
+ val p = EbicsStandardOrderParams(EbicsDateRange(LocalDate.EPOCH,
LocalDate.now()))
+ when (fetchSpec.level) {
+ FetchLevel.ALL -> {
+ specs.add(EbicsFetchSpec("C52", p))
+ specs.add(EbicsFetchSpec("C53", p))
+ }
+ FetchLevel.REPORT -> {
+ specs.add(EbicsFetchSpec("C52", p))
+ }
+ FetchLevel.STATEMENT -> {
+ specs.add(EbicsFetchSpec("C53", p))
+ }
+ }
+ }
}
for (spec in specs) {
fetchEbicsC5x(spec.orderType, client, bankConnectionId,
spec.orderParams, subscriberDetails)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.