diff options
author | MS <ms@taler.net> | 2021-01-18 17:36:10 +0100 |
---|---|---|
committer | MS <ms@taler.net> | 2021-01-18 17:36:10 +0100 |
commit | 5c1397963a939dbe260226b5076636346c20a308 (patch) | |
tree | 6cb5f08765df07a50eba3f34e7014cf71708a84f | |
parent | e943ef765147028b88564ff1b5c1c7883843cf97 (diff) | |
download | libeufin-5c1397963a939dbe260226b5076636346c20a308.tar.gz libeufin-5c1397963a939dbe260226b5076636346c20a308.tar.bz2 libeufin-5c1397963a939dbe260226b5076636346c20a308.zip |
Remove avoidable MsgId value per transaction (sandbox)
4 files changed, 2 insertions, 9 deletions
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt index 034fcf0a..d9e75aea 100644 --- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt +++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt @@ -258,11 +258,10 @@ object BankAccountTransactionsTable : Table() { val currency = text("currency") val date = long("date") val pmtInfId = text("pmtInfId") - val msgId = text("msgId") val direction = text("direction") val account = reference("account", BankAccountsTable) - override val primaryKey = PrimaryKey(pmtInfId, msgId) + override val primaryKey = PrimaryKey(pmtInfId) } /** diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt index 1f8fa82a..fc044829 100644 --- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt +++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt @@ -562,7 +562,6 @@ private fun handleCct(paymentRequest: String, initiatorName: String, ctx: Reques it[currency] = parseResult.currency it[date] = Instant.now().toEpochMilli() it[pmtInfId] = parseResult.pmtInfId - it[msgId] = parseResult.msgId it[direction] = "DBIT" } } catch (e: ExposedSQLException) { diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt index ca7cc898..dedcee63 100644 --- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt +++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -348,7 +348,6 @@ fun serverMain(dbName: String, port: Int) { it[currency] = body.currency it[date] = Instant.now().toEpochMilli() it[pmtInfId] = random.toString() - it[msgId] = random.toString() it[account] = getBankAccountFromIban(localIban).id it[direction] = body.direction } @@ -376,7 +375,6 @@ fun serverMain(dbName: String, port: Int) { it[currency] = account.currency it[date] = Instant.now().toEpochMilli() it[pmtInfId] = random.toString() - it[msgId] = random.toString() it[BankAccountTransactionsTable.account] = account.id it[direction] = "CRDT" } @@ -482,7 +480,6 @@ fun serverMain(dbName: String, port: Int) { it[currency] = account.currency it[date] = Instant.now().toEpochMilli() it[pmtInfId] = random.toString() - it[msgId] = random.toString() it[BankAccountTransactionsTable.account] = account.id it[direction] = "CRDT" } @@ -504,7 +501,6 @@ fun serverMain(dbName: String, port: Int) { it[currency] = account.currency it[date] = Instant.now().toEpochMilli() it[pmtInfId] = random.toString() - it[msgId] = random.toString() it[BankAccountTransactionsTable.account] = account.id it[direction] = "DBIT" } diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt index 46780f01..c93db81c 100644 --- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt +++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt @@ -45,8 +45,7 @@ fun historyForAccount(iban: String): List<RawPayment> { // uid = "${it[pmtInfId]}-${it[msgId]}" uid = "${it[BankAccountTransactionsTable.pmtInfId]}", direction = it[BankAccountTransactionsTable.direction], - pmtInfId = it[BankAccountTransactionsTable.pmtInfId], - msgId = it[BankAccountTransactionsTable.msgId] + pmtInfId = it[BankAccountTransactionsTable.pmtInfId] ) ) } |