summaryrefslogtreecommitdiff
path: root/nexus/src/main
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-05-14 20:19:38 +0200
committerMS <ms@taler.net>2020-05-14 20:19:38 +0200
commit96898782fa6809d9b680cbbc74086aaf036ee9c5 (patch)
tree9bc792d07f70d307ab24c4228de41067d7e30c9c /nexus/src/main
parentb31804f28e24b9a5399b52a75fc0e30645e588e6 (diff)
downloadlibeufin-96898782fa6809d9b680cbbc74086aaf036ee9c5.tar.gz
libeufin-96898782fa6809d9b680cbbc74086aaf036ee9c5.tar.bz2
libeufin-96898782fa6809d9b680cbbc74086aaf036ee9c5.zip
Default dates needed.
Diffstat (limited to 'nexus/src/main')
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt7
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt2
2 files changed, 5 insertions, 4 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
index 8f27ec94..b010332b 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
@@ -1,5 +1,6 @@
package tech.libeufin.nexus
+import org.joda.time.DateTime
import tech.libeufin.util.*
import java.time.LocalDate
@@ -15,8 +16,8 @@ data class EbicsStandardOrderParamsJson(val dateRange: EbicsDateRangeJson?) {
fun toOrderParams(): EbicsOrderParams {
var dateRange: EbicsDateRange? = if (this.dateRange != null) {
EbicsDateRange(
- LocalDate.parse(this.dateRange.start),
- LocalDate.parse(this.dateRange.end)
+ LocalDate.parse(this.dateRange.start ?: "1970-01-31"),
+ LocalDate.parse(this.dateRange.end ?: DateTime.now().toDashedDate())
)
} else {
null
@@ -158,7 +159,7 @@ data class SubmitPayment(
/** Request type of "POST /collected-transactions" */
data class CollectedTransaction(
- val transport: tech.libeufin.nexus.Transport?,
+ val transport: Transport?,
val start: String?,
val end: String?
)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 5d2b96fd..7b7c19d2 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -376,7 +376,7 @@ fun main() {
* the basis of a transport subscriber (regardless of their
* bank account details)
*/
- post("/bank-accounts/{accountid}/collected-transactions") {
+ post("/bank-accounts/collected-transactions") {
val userId = authenticateRequest(call.request.headers["Authorization"])
val body = call.receive<CollectedTransaction>()
if (body.transport != null) {