commit d7ed09726e13df4c8ef950ad29494795d11f81f9
parent 2ac98c6d8c712e5de360d1dc64da4f4ecd93c0d1
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Sat, 11 Jan 2020 09:59:28 +0100
use less generic name
Diffstat:
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
@@ -152,7 +152,6 @@ open class IntIdTableWithAmount : IntIdTable() {
}
}
-
object BankTransactionsTable : IntIdTableWithAmount() {
/* Using varchar to store the IBAN - or possibly other formats
@@ -188,12 +187,12 @@ class BankTransactionEntity(id: EntityID<Int>) : IntEntity(id) {
*/
object BankCustomersTable : IntIdTable() {
// Customer ID is the default 'id' field provided by the constructor.
- val name = varchar("name", CUSTOMER_NAME_MAX_LENGTH).primaryKey()
+ val customerName = varchar("customerName", CUSTOMER_NAME_MAX_LENGTH)
}
class BankCustomerEntity(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<BankCustomerEntity>(BankCustomersTable)
- var name by BankCustomersTable.name
+ var customerName by BankCustomersTable.customerName
}
@@ -368,8 +367,8 @@ fun dbCreateTables() {
transaction {
addLogger(StdOutSqlLogger)
SchemaUtils.create(
- BankTransactionsTable,
BankCustomersTable,
+ BankTransactionsTable,
EbicsSubscribersTable,
EbicsHostsTable,
EbicsDownloadTransactionsTable,
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -143,7 +143,7 @@ fun sampleData() {
val customerEntity = BankCustomerEntity.new {
addLogger(StdOutSqlLogger)
- name = "Mina"
+ customerName = "Mina"
}
LOGGER.debug("Creating customer number: ${customerEntity.id}")
@@ -269,7 +269,7 @@ fun main() {
call.respond(
CustomerBalance(
- name = customer.name,
+ name = customer.customerName,
balance = "${balance} EUR"
)
)