From fba6c2a0d5abfa3e74887370d6326f56396be9ff Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 13 Nov 2021 00:17:18 +0100 Subject: [PATCH] Implemented also logging dialog number --- .../kotlin/net/dankito/banking/fints/log/MessageContext.kt | 1 + .../net/dankito/banking/fints/log/MessageLogCollector.kt | 2 +- .../kotlin/net/dankito/banking/fints/model/JobContext.kt | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/log/MessageContext.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/log/MessageContext.kt index 3c4a59cb..8177783e 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/log/MessageContext.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/log/MessageContext.kt @@ -7,6 +7,7 @@ import net.dankito.banking.fints.model.BankData class MessageContext( val jobNumber: Int, val dialogNumber: Int, + val messageNumber: Int, val bank: BankData, val account: AccountData? ) \ No newline at end of file diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/log/MessageLogCollector.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/log/MessageLogCollector.kt index a7bf63a0..24d27e49 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/log/MessageLogCollector.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/log/MessageLogCollector.kt @@ -62,7 +62,7 @@ open class MessageLogCollector { protected open fun createMessageTraceString(type: MessageLogEntryType, context: MessageContext): String { - return "${twoDigits(context.jobNumber)}_${twoDigits(context.dialogNumber)}_" + + return "${twoDigits(context.jobNumber)}_${twoDigits(context.dialogNumber)}_${twoDigits(context.messageNumber)}_" + "${context.bank.bankCode}_${context.bank.customerId}" + "${ context.account?.let { "_${it.accountIdentifier}" } ?: "" } " + "${getTypeString(type)}:" diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt index 783924e1..40e6e1f1 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt @@ -49,6 +49,8 @@ open class JobContext( protected open val jobNumber: Int = ++JobCount + protected open var dialogNumber: Int = 0 + open fun startNewDialog(closeDialog: Boolean = true, dialogId: String = DialogContext.InitialDialogId, versionOfSecurityProcedure: VersionDesSicherheitsverfahrens = VersionDesSicherheitsverfahrens.Version_2, @@ -62,6 +64,8 @@ open class JobContext( this._dialogs.add(newDialogContext) + this.dialogNumber++ + return newDialogContext }