libeufin

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

commit 2b8d626e65aca06c214776211f12272576542022
parent 4f7ad1304847068479ee58f786a73cd603b2dba7
Author: MS <ms@taler.net>
Date:   Mon, 18 Sep 2023 14:29:43 +0200

Account creation bonus policy.

The balance of a new customer is always zero, and if the
bank wants to award a registration bonus, then it'll make
a wire transfer to the new customer.

Diffstat:
Mbank/src/main/kotlin/tech/libeufin/bank/accountsMgmtHandlers.kt | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/bank/src/main/kotlin/tech/libeufin/bank/accountsMgmtHandlers.kt b/bank/src/main/kotlin/tech/libeufin/bank/accountsMgmtHandlers.kt @@ -92,15 +92,13 @@ fun Routing.accountsMgmtHandlers() { parseTalerAmount(this) } val bonus = db.configGet("registration_bonus") - val initialBalance = if (bonus != null) parseTalerAmount(bonus) else TalerAmount(0, 0) val newBankAccount = BankAccount( hasDebt = false, internalPaytoUri = req.internal_payto_uri ?: genIbanPaytoUri(), owningCustomerId = newCustomerRowId, isPublic = req.is_public, isTalerExchange = req.is_taler_exchange, - maxDebt = maxDebt, - balance = initialBalance + maxDebt = maxDebt ) if (!db.bankAccountCreate(newBankAccount)) throw internalServerError("Could not INSERT bank account despite all the checks.")