libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit be89bc87d74fd01d78bebb809c022319c322e763
parent a047715a9bd3ff3f65ff3fe286589e25b44bc846
Author: MS <ms@taler.net>
Date:   Tue, 30 Jun 2020 16:46:23 +0200

remove bank connection

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/server/JSON.kt | 4++++
Mnexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 12++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/JSON.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/server/JSON.kt @@ -110,6 +110,10 @@ data class BankConnectionsList( val bankConnections: List<BankConnectionInfo> ) +data class BankConnectionDeletion( + val bankConnectionId: String +) + data class EbicsHostTestRequest( val ebicsBaseUrl: String, val ebicsHostId: String diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt @@ -624,6 +624,18 @@ fun serverMain(dbName: String, host: String) { call.respond(object {}) } + post("/bank-connections/delete") { + val body = call.receive<BankConnectionDeletion>() + transaction { + val conn = NexusBankConnectionEntity.findById(body.bankConnectionId) ?: throw NexusError( + HttpStatusCode.NotFound, + "Bank connection ${body.bankConnectionId}" + ) + conn.delete() // temporary, and instead just _mark_ it as deleted? + } + call.respond(object {}) + } + get("/bank-connections") { val connList = mutableListOf<BankConnectionInfo>() transaction {