commit b226e1f6da70b776ed9c90addf52408f6f683b50
parent 9db46d5f84901f29f57edf01dffdcfea184a38e9
Author: tanhengyeow <E0032242@u.nus.edu>
Date: Fri, 14 Aug 2020 17:11:09 +0800
Update all instances from PaymentsTable to BankAccountTransactionsTable
Diffstat:
2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -62,16 +62,16 @@ import com.github.ajalt.clikt.core.subcommands
import com.github.ajalt.clikt.parameters.options.default
import com.github.ajalt.clikt.parameters.options.option
import io.ktor.util.AttributeKey
-import tech.libeufin.sandbox.PaymentsTable
-import tech.libeufin.sandbox.PaymentsTable.amount
-import tech.libeufin.sandbox.PaymentsTable.creditorBic
-import tech.libeufin.sandbox.PaymentsTable.creditorIban
-import tech.libeufin.sandbox.PaymentsTable.creditorName
-import tech.libeufin.sandbox.PaymentsTable.currency
-import tech.libeufin.sandbox.PaymentsTable.date
-import tech.libeufin.sandbox.PaymentsTable.debitorBic
-import tech.libeufin.sandbox.PaymentsTable.debitorIban
-import tech.libeufin.sandbox.PaymentsTable.debitorName
+import tech.libeufin.sandbox.BankAccountTransactionsTable
+import tech.libeufin.sandbox.BankAccountTransactionsTable.amount
+import tech.libeufin.sandbox.BankAccountTransactionsTable.creditorBic
+import tech.libeufin.sandbox.BankAccountTransactionsTable.creditorIban
+import tech.libeufin.sandbox.BankAccountTransactionsTable.creditorName
+import tech.libeufin.sandbox.BankAccountTransactionsTable.currency
+import tech.libeufin.sandbox.BankAccountTransactionsTable.date
+import tech.libeufin.sandbox.BankAccountTransactionsTable.debitorBic
+import tech.libeufin.sandbox.BankAccountTransactionsTable.debitorIban
+import tech.libeufin.sandbox.BankAccountTransactionsTable.debitorName
import tech.libeufin.util.*
import tech.libeufin.util.ebics_h004.EbicsResponse
import tech.libeufin.util.ebics_h004.EbicsTypes
@@ -236,12 +236,12 @@ fun serverMain(dbName: String) {
get("/admin/payments") {
val ret = PaymentsResponse()
transaction {
- PaymentsTable.selectAll().forEach {
+ BankAccountTransactionsTable.selectAll().forEach {
ret.payments.add(
RawPayment(
creditorIban = it[creditorIban],
debitorIban = it[debitorIban],
- subject = it[PaymentsTable.subject],
+ subject = it[BankAccountTransactionsTable.subject],
date = it[date].toHttpDateString(),
amount = it[amount],
creditorBic = it[creditorBic],
@@ -263,7 +263,7 @@ fun serverMain(dbName: String) {
post("/admin/payments") {
val body = call.receive<RawPayment>()
transaction {
- PaymentsTable.insert {
+ BankAccountTransactionsTable.insert {
it[creditorIban] = body.creditorIban
it[creditorBic] = body.creditorBic
it[creditorName] = body.creditorName
diff --git a/sandbox/src/test/kotlin/DBTest.kt b/sandbox/src/test/kotlin/DBTest.kt
@@ -21,9 +21,9 @@ import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.transactions.TransactionManager
import org.jetbrains.exposed.sql.transactions.transaction
import org.junit.Test
-import tech.libeufin.sandbox.PaymentsTable
-import tech.libeufin.sandbox.PaymentsTable.msgId
-import tech.libeufin.sandbox.PaymentsTable.pmtInfId
+import tech.libeufin.sandbox.BankAccountTransactionsTable
+import tech.libeufin.sandbox.BankAccountTransactionsTable.msgId
+import tech.libeufin.sandbox.BankAccountTransactionsTable.pmtInfId
import tech.libeufin.util.millis
import tech.libeufin.util.parseDashedDate
import java.io.File
@@ -65,8 +65,8 @@ class DBTest {
fun betweenDates() {
withTestDatabase {
transaction {
- SchemaUtils.create(PaymentsTable)
- PaymentsTable.insert {
+ SchemaUtils.create(BankAccountTransactionsTable)
+ BankAccountTransactionsTable.insert {
it[creditorIban] = "earns"
it[creditorBic] = "BIC"
it[creditorName] = "Creditor Name"
@@ -83,8 +83,8 @@ class DBTest {
}
val result = transaction {
addLogger(StdOutSqlLogger)
- PaymentsTable.select {
- PaymentsTable.date.between(
+ BankAccountTransactionsTable.select {
+ BankAccountTransactionsTable.date.between(
parseDashedDate(
"1970-01-01"
).millis(),