libeufin

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

commit 6647945e3ebba4fce2fd8eabf871ffb448a9f274
parent 5c970c5d7735b66ca4ec9df6ff146e3c1c422d3b
Author: ms <ms@taler.net>
Date:   Wed,  4 May 2022 08:34:26 +0200

Snack-machine demo changes.

CHF becomes the default currency.  Do not 500
when the 'bank' username is tried to be registered.

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt | 3++-
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 6+++++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt @@ -169,11 +169,12 @@ fun getDefaultDemobank(): DemobankConfigEntity { "Default demobank is missing." ) } + fun maybeCreateDefaultDemobank() { transaction { if (DemobankConfigEntity.all().empty()) { DemobankConfigEntity.new { - currency = "EUR" + currency = "CHF" bankDebtLimit = 1000000 usersDebtLimit = 10000 allowRegistrations = true diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -1408,7 +1408,11 @@ val sandboxApp: Application.() -> Unit = { DemobankCustomersTable.username eq req.username }.firstOrNull() } - if (checkExist != null) { + /** + * Not allowing 'bank' username, as it's been assigned + * to the default bank's bank account. + */ + if (checkExist != null || req.username == "bank") { throw SandboxError( HttpStatusCode.Conflict, "Username ${req.username} not available."