Extracted GetTransactionsParameter to configure GetAccountTransactions job
This commit is contained in:
parent
2b744ddd09
commit
3e4a72184e
|
@ -90,7 +90,9 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun getTransactions(bank: BankData, customer: CustomerData, product: ProductData): Response {
|
open fun getTransactions(parameter: GetTransactionsParameter, bank: BankData, customer: CustomerData,
|
||||||
|
product: ProductData): Response {
|
||||||
|
|
||||||
val dialogData = DialogData()
|
val dialogData = DialogData()
|
||||||
|
|
||||||
val initDialogResponse = initDialog(bank, customer, product, dialogData)
|
val initDialogResponse = initDialog(bank, customer, product, dialogData)
|
||||||
|
@ -113,7 +115,7 @@ open class FinTsClient(
|
||||||
|
|
||||||
dialogData.increaseMessageNumber()
|
dialogData.increaseMessageNumber()
|
||||||
|
|
||||||
val requestBody = messageBuilder.createGetTransactionsMessage(bank, customer, product, dialogData)
|
val requestBody = messageBuilder.createGetTransactionsMessage(parameter, bank, customer, product, dialogData)
|
||||||
|
|
||||||
val response = getAndHandleResponseForMessage(requestBody, bank)
|
val response = getAndHandleResponseForMessage(requestBody, bank)
|
||||||
|
|
||||||
|
|
|
@ -85,10 +85,11 @@ open class MessageBuilder(protected val generator: ISegmentNumberGenerator = Seg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun createGetTransactionsMessage(bank: BankData, customer: CustomerData, product: ProductData, dialogData: DialogData): String {
|
open fun createGetTransactionsMessage(parameter: GetTransactionsParameter, bank: BankData, customer: CustomerData,
|
||||||
|
product: ProductData, dialogData: DialogData): String {
|
||||||
|
|
||||||
return createSignedMessage(bank, customer, dialogData, listOf(
|
return createSignedMessage(bank, customer, dialogData, listOf(
|
||||||
KontoumsaetzeZeitraumMt940Version5(generator.resetSegmentNumber(2), bank, customer),
|
KontoumsaetzeZeitraumMt940Version5(generator.resetSegmentNumber(2), parameter, bank, customer),
|
||||||
ZweiSchrittTanEinreichung(generator.getNextSegmentNumber(), TanProcess.TanProcess4, CustomerSegmentId.AccountTransactionsMt940)
|
ZweiSchrittTanEinreichung(generator.getNextSegmentNumber(), TanProcess.TanProcess4, CustomerSegmentId.AccountTransactionsMt940)
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import net.dankito.fints.messages.datenelementgruppen.Datenelementgruppe
|
||||||
import net.dankito.fints.messages.datenelementgruppen.implementierte.Segmentkopf
|
import net.dankito.fints.messages.datenelementgruppen.implementierte.Segmentkopf
|
||||||
import net.dankito.fints.messages.segmente.Segment
|
import net.dankito.fints.messages.segmente.Segment
|
||||||
import net.dankito.fints.messages.segmente.id.CustomerSegmentId
|
import net.dankito.fints.messages.segmente.id.CustomerSegmentId
|
||||||
|
import net.dankito.fints.model.GetTransactionsParameter
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,17 +24,13 @@ abstract class KontoumsaetzeZeitraumMt940Base(
|
||||||
segmentVersion: Int,
|
segmentVersion: Int,
|
||||||
segmentNumber: Int,
|
segmentNumber: Int,
|
||||||
account: Datenelementgruppe,
|
account: Datenelementgruppe,
|
||||||
allAccounts: Boolean = false,
|
parameter: GetTransactionsParameter
|
||||||
fromDate: Int? = null,
|
|
||||||
toDate: Int? = null,
|
|
||||||
maxAmount: Int? = null,
|
|
||||||
continuationId: String? = null
|
|
||||||
)
|
)
|
||||||
: Segment(listOf(
|
: Segment(listOf(
|
||||||
Segmentkopf(CustomerSegmentId.AccountTransactionsMt940, segmentVersion, segmentNumber),
|
Segmentkopf(CustomerSegmentId.AccountTransactionsMt940, segmentVersion, segmentNumber),
|
||||||
account,
|
account,
|
||||||
AlleKonten(allAccounts, Existenzstatus.Mandatory),
|
AlleKonten(parameter.allAccounts, Existenzstatus.Mandatory),
|
||||||
Datum(fromDate ?: 0, Existenzstatus.Optional)
|
Datum(parameter.fromDate, Existenzstatus.Optional)
|
||||||
// Datum(toDate ?: 0, Existenzstatus.Optional),
|
// Datum(toDate ?: 0, Existenzstatus.Optional),
|
||||||
// MaximaleAnzahlEintraege(maxAmount ?: 0, Existenzstatus.Optional), // > 0. O: „Eingabe Anzahl Einträge erlaubt“ (BPD) = „J“. N: sonst
|
// MaximaleAnzahlEintraege(maxAmount ?: 0, Existenzstatus.Optional), // > 0. O: „Eingabe Anzahl Einträge erlaubt“ (BPD) = „J“. N: sonst
|
||||||
// Aufsetzpunkt(continuationId ?: "", Existenzstatus.Optional) // M: vom Institut wurde ein Aufsetzpunkt rückgemeldet. N: sonst
|
// Aufsetzpunkt(continuationId ?: "", Existenzstatus.Optional) // M: vom Institut wurde ein Aufsetzpunkt rückgemeldet. N: sonst
|
||||||
|
|
|
@ -3,6 +3,7 @@ package net.dankito.fints.messages.segmente.implementierte.umsaetze
|
||||||
import net.dankito.fints.messages.datenelementgruppen.implementierte.account.Kontoverbindung
|
import net.dankito.fints.messages.datenelementgruppen.implementierte.account.Kontoverbindung
|
||||||
import net.dankito.fints.model.BankData
|
import net.dankito.fints.model.BankData
|
||||||
import net.dankito.fints.model.CustomerData
|
import net.dankito.fints.model.CustomerData
|
||||||
|
import net.dankito.fints.model.GetTransactionsParameter
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,22 +18,15 @@ import net.dankito.fints.model.CustomerData
|
||||||
*/
|
*/
|
||||||
open class KontoumsaetzeZeitraumMt940Version5(
|
open class KontoumsaetzeZeitraumMt940Version5(
|
||||||
segmentNumber: Int,
|
segmentNumber: Int,
|
||||||
|
parameter: GetTransactionsParameter,
|
||||||
bank: BankData,
|
bank: BankData,
|
||||||
customer: CustomerData,
|
customer: CustomerData,
|
||||||
subAccountAttribute: String? = null,
|
subAccountAttribute: String? = null
|
||||||
allAccounts: Boolean = false,
|
|
||||||
fromDate: Int? = null,
|
|
||||||
toDate: Int? = null,
|
|
||||||
maxAmount: Int? = null,
|
|
||||||
continuationId: String? = null
|
|
||||||
)
|
)
|
||||||
: KontoumsaetzeZeitraumMt940Base(
|
: KontoumsaetzeZeitraumMt940Base(
|
||||||
5,
|
5,
|
||||||
segmentNumber,
|
segmentNumber,
|
||||||
Kontoverbindung(bank.countryCode, bank.bankCode, customer.customerId, subAccountAttribute),
|
Kontoverbindung(bank.countryCode, bank.bankCode, customer.customerId, subAccountAttribute),
|
||||||
allAccounts,
|
parameter
|
||||||
fromDate,
|
|
||||||
toDate,
|
|
||||||
maxAmount,
|
|
||||||
continuationId
|
|
||||||
)
|
)
|
|
@ -3,6 +3,7 @@ package net.dankito.fints.messages.segmente.implementierte.umsaetze
|
||||||
import net.dankito.fints.messages.datenelementgruppen.implementierte.account.KontoverbindungInternational
|
import net.dankito.fints.messages.datenelementgruppen.implementierte.account.KontoverbindungInternational
|
||||||
import net.dankito.fints.model.BankData
|
import net.dankito.fints.model.BankData
|
||||||
import net.dankito.fints.model.CustomerData
|
import net.dankito.fints.model.CustomerData
|
||||||
|
import net.dankito.fints.model.GetTransactionsParameter
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,22 +18,14 @@ import net.dankito.fints.model.CustomerData
|
||||||
*/
|
*/
|
||||||
open class KontoumsaetzeZeitraumMt940Version7(
|
open class KontoumsaetzeZeitraumMt940Version7(
|
||||||
segmentNumber: Int,
|
segmentNumber: Int,
|
||||||
|
parameter: GetTransactionsParameter,
|
||||||
bank: BankData,
|
bank: BankData,
|
||||||
customer: CustomerData,
|
customer: CustomerData,
|
||||||
subAccountAttribute: String? = null, // TODO: move to CustomerData.accounts
|
subAccountAttribute: String? = null // TODO: move to CustomerData.accounts
|
||||||
allAccounts: Boolean = false,
|
|
||||||
fromDate: Int? = null,
|
|
||||||
toDate: Int? = null,
|
|
||||||
maxAmount: Int? = null,
|
|
||||||
continuationId: String? = null
|
|
||||||
)
|
)
|
||||||
: KontoumsaetzeZeitraumMt940Base(
|
: KontoumsaetzeZeitraumMt940Base(
|
||||||
7,
|
7,
|
||||||
segmentNumber,
|
segmentNumber,
|
||||||
KontoverbindungInternational(bank, customer, subAccountAttribute),
|
KontoverbindungInternational(bank, customer, subAccountAttribute),
|
||||||
allAccounts,
|
parameter
|
||||||
fromDate,
|
|
||||||
toDate,
|
|
||||||
maxAmount,
|
|
||||||
continuationId
|
|
||||||
)
|
)
|
|
@ -0,0 +1,12 @@
|
||||||
|
package net.dankito.fints.model
|
||||||
|
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
|
open class GetTransactionsParameter(
|
||||||
|
val fromDate: Date? = null,
|
||||||
|
val toDate: Date? = null,
|
||||||
|
val maxAmount: Int? = null,
|
||||||
|
val allAccounts: Boolean = false,
|
||||||
|
val continuationId: String? = null
|
||||||
|
)
|
Loading…
Reference in New Issue