[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated (a58a9c2 -> 7eb8e4c)
From: |
gnunet |
Subject: |
[libeufin] branch master updated (a58a9c2 -> 7eb8e4c) |
Date: |
Wed, 10 Jun 2020 08:47:37 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a change to branch master
in repository libeufin.
from a58a9c2 ebics/fetch-c52
new 759783e remove unnecessary check (DB should complain there)
new e6b8c8b remove unused column
new 7eb8e4c remove arbitrary length constraint at DB level
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt | 48 +++++++++++--------------
1 file changed, 20 insertions(+), 28 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
index 15a79bf..58cbc9b 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
@@ -1,11 +1,10 @@
package tech.libeufin.nexus
-import io.ktor.http.HttpStatusCode
import org.jetbrains.exposed.dao.*
-import org.jetbrains.exposed.dao.id.LongIdTable
import org.jetbrains.exposed.dao.id.EntityID
import org.jetbrains.exposed.dao.id.IdTable
import org.jetbrains.exposed.dao.id.IntIdTable
+import org.jetbrains.exposed.dao.id.LongIdTable
import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.SchemaUtils
import org.jetbrains.exposed.sql.StdOutSqlLogger
@@ -16,8 +15,6 @@ import tech.libeufin.util.EbicsInitState
import tech.libeufin.util.amount
import java.sql.Connection
-const val ID_MAX_LENGTH = 50
-
/**
* This table holds the values that exchange gave to issue a payment,
* plus a reference to the prepared pain.001 version of. Note that
@@ -58,31 +55,13 @@ class TalerRequestedPaymentEntity(id: EntityID<Long>) :
LongEntity(id) {
object TalerIncomingPayments : LongIdTable() {
val payment = reference("payment", RawBankTransactionsTable)
val valid = bool("valid")
-
- // avoid refunding twice!
- val refunded = bool("refunded").default(false)
}
class TalerIncomingPaymentEntity(id: EntityID<Long>) : LongEntity(id) {
- companion object :
LongEntityClass<TalerIncomingPaymentEntity>(TalerIncomingPayments) {
- override fun new(init: TalerIncomingPaymentEntity.() -> Unit):
TalerIncomingPaymentEntity {
- val newRow = super.new(init)
- /**
- * In case the exchange asks for all the values strictly lesser
than MAX_VALUE,
- * it would lose the row whose id == MAX_VALUE. So the check
below makes this
- * situation impossible by disallowing MAX_VALUE as a id value.
- */
- if (newRow.id.value == Long.MAX_VALUE) {
- throw NexusError(
- HttpStatusCode.InsufficientStorage, "Cannot store rows
anymore"
- )
- }
- return newRow
- }
- }
+ companion object :
LongEntityClass<TalerIncomingPaymentEntity>(TalerIncomingPayments)
+
var payment by RawBankTransactionEntity referencedOn
TalerIncomingPayments.payment
var valid by TalerIncomingPayments.valid
- var refunded by TalerIncomingPayments.refunded
}
/**
@@ -90,6 +69,7 @@ class TalerIncomingPaymentEntity(id: EntityID<Long>) :
LongEntity(id) {
*/
object NexusBankMessagesTable : IntIdTable() {
val bankConnection = reference("bankConnection", NexusBankConnectionsTable)
+
// Unique identifier for the message within the bank connection
val messageId = text("messageId")
val code = text("code")
@@ -125,6 +105,7 @@ object RawBankTransactionsTable : LongIdTable() {
class RawBankTransactionEntity(id: EntityID<Long>) : LongEntity(id) {
companion object :
LongEntityClass<RawBankTransactionEntity>(RawBankTransactionsTable)
+
var unstructuredRemittanceInformation by
RawBankTransactionsTable.unstructuredRemittanceInformation
var transactionType by RawBankTransactionsTable.transactionType
var currency by RawBankTransactionsTable.currency
@@ -143,7 +124,7 @@ class RawBankTransactionEntity(id: EntityID<Long>) :
LongEntity(id) {
*/
object PreparedPaymentsTable : IdTable<String>() {
/** the UUID representing this payment in the system */
- override val id = varchar("id", ID_MAX_LENGTH).entityId()
+ override val id = text("id").entityId()
val paymentId = long("paymentId")
val preparationDate = long("preparationDate")
val submissionDate = long("submissionDate").nullable()
@@ -157,8 +138,10 @@ object PreparedPaymentsTable : IdTable<String>() {
val debitorIban = text("debitorIban")
val debitorBic = text("debitorBic")
val debitorName = text("debitorName").nullable()
+
/* Indicates whether the PAIN message was sent to the bank. */
val submitted = bool("submitted").default(false)
+
/* Indicates whether the bank didn't perform the payment: note that
* this state can be reached when the payment gets listed in a CRZ
* response OR when the payment doesn't show up in a C52/C53 response */
@@ -167,6 +150,7 @@ object PreparedPaymentsTable : IdTable<String>() {
class PreparedPaymentEntity(id: EntityID<String>) : Entity<String>(id) {
companion object : EntityClass<String,
PreparedPaymentEntity>(PreparedPaymentsTable)
+
var paymentId by PreparedPaymentsTable.paymentId
var preparationDate by PreparedPaymentsTable.preparationDate
var submissionDate by PreparedPaymentsTable.submissionDate
@@ -188,17 +172,19 @@ class PreparedPaymentEntity(id: EntityID<String>) :
Entity<String>(id) {
* This table holds triples of <iban, bic, holder name>.
*/
object NexusBankAccountsTable : IdTable<String>() {
- override val id = varchar("id", ID_MAX_LENGTH).entityId()
+ override val id = text("id").entityId()
val accountHolder = text("accountHolder")
val iban = text("iban")
val bankCode = text("bankCode")
val defaultBankConnection = reference("defaultBankConnection",
NexusBankConnectionsTable).nullable()
+
// Highest bank message ID that this bank account is aware of.
val highestSeenBankMessageId = integer("")
}
class NexusBankAccountEntity(id: EntityID<String>) : Entity<String>(id) {
companion object : EntityClass<String,
NexusBankAccountEntity>(NexusBankAccountsTable)
+
var accountHolder by NexusBankAccountsTable.accountHolder
var iban by NexusBankAccountsTable.iban
var bankCode by NexusBankAccountsTable.bankCode
@@ -224,6 +210,7 @@ object EbicsSubscribersTable : IntIdTable() {
class EbicsSubscriberEntity(id: EntityID<Int>) : IntEntity(id) {
companion object :
IntEntityClass<EbicsSubscriberEntity>(EbicsSubscribersTable)
+
var ebicsURL by EbicsSubscribersTable.ebicsURL
var hostID by EbicsSubscribersTable.hostID
var partnerID by EbicsSubscribersTable.partnerID
@@ -240,13 +227,14 @@ class EbicsSubscriberEntity(id: EntityID<Int>) :
IntEntity(id) {
}
object NexusUsersTable : IdTable<String>() {
- override val id = varchar("id", ID_MAX_LENGTH).entityId()
+ override val id = text("id").entityId()
val passwordHash = text("password")
val superuser = bool("superuser")
}
class NexusUserEntity(id: EntityID<String>) : Entity<String>(id) {
companion object : EntityClass<String, NexusUserEntity>(NexusUsersTable)
+
var passwordHash by NexusUsersTable.passwordHash
var superuser by NexusUsersTable.superuser
}
@@ -259,6 +247,7 @@ object NexusBankConnectionsTable : IdTable<String>() {
class NexusBankConnectionEntity(id: EntityID<String>) : Entity<String>(id) {
companion object : EntityClass<String,
NexusBankConnectionEntity>(NexusBankConnectionsTable)
+
var type by NexusBankConnectionsTable.type
var owner by NexusUserEntity referencedOn NexusBankConnectionsTable.owner
}
@@ -267,11 +256,11 @@ object FacadesTable : IdTable<String>() {
override val id = FacadesTable.text("id").entityId()
val type = text("type")
val creator = reference("creator", NexusUsersTable)
- val highestSeenMsgID = long("highestSeenMessageID").default(0)
}
class FacadeEntity(id: EntityID<String>) : Entity<String>(id) {
companion object : EntityClass<String, FacadeEntity>(FacadesTable)
+
var type by FacadesTable.type
var creator by NexusUserEntity referencedOn FacadesTable.creator
}
@@ -279,6 +268,7 @@ class FacadeEntity(id: EntityID<String>) :
Entity<String>(id) {
object TalerFacadeStatesTable : IntIdTable() {
val bankAccount = text("bankAccount")
val bankConnection = text("bankConnection")
+
/* "statement", "report", "notification" */
val reserveTransferLevel = text("reserveTransferLevel")
val intervalIncrement = text("intervalIncrement")
@@ -288,8 +278,10 @@ object TalerFacadeStatesTable : IntIdTable() {
class TalerFacadeStateEntity(id: EntityID<Int>) : IntEntity(id) {
companion object :
IntEntityClass<TalerFacadeStateEntity>(TalerFacadeStatesTable)
+
var bankAccount by TalerFacadeStatesTable.bankAccount
var bankConnection by TalerFacadeStatesTable.bankConnection
+
/* "statement", "report", "notification" */
var reserveTransferLevel by TalerFacadeStatesTable.reserveTransferLevel
var intervalIncrement by TalerFacadeStatesTable.intervalIncrement
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libeufin] branch master updated (a58a9c2 -> 7eb8e4c),
gnunet <=