Parsing now also isCleared
This commit is contained in:
parent
94dd1aaff8
commit
d0910b7180
|
@ -7,5 +7,6 @@ open class CreditCardTransaction(
|
|||
val amount: Money,
|
||||
val otherPartyName: String,
|
||||
val bookingDate: Date,
|
||||
val valueDate: Date
|
||||
val valueDate: Date,
|
||||
val isCleared: Boolean
|
||||
)
|
|
@ -700,8 +700,9 @@ open class ResponseParser(
|
|||
val valueDate = parseDate(dataElements[2])
|
||||
val amount = parseCreditCardAmount(dataElements.subList(4, 7))
|
||||
val otherPartyName = parseString(dataElements[11])
|
||||
val isCleared = parseBoolean(dataElements[20])
|
||||
|
||||
return CreditCardTransaction(amount, otherPartyName, bookingDate, valueDate)
|
||||
return CreditCardTransaction(amount, otherPartyName, bookingDate, valueDate, isCleared)
|
||||
}
|
||||
|
||||
private fun parseCreditCardAmount(amountDataElements: List<String>): Money {
|
||||
|
|
|
@ -1113,6 +1113,7 @@ class ResponseParserTest : FinTsTestBase() {
|
|||
expect(transaction.valueDate).toBe(Date(2020, 8, 20))
|
||||
expect(transaction.amount.amount.string).toBe("-" + amount)
|
||||
expect(transaction.amount.currency.code).toBe("EUR")
|
||||
expect(transaction.isCleared).isTrue()
|
||||
}
|
||||
}
|
||||
?: run { fail("No segment of type ReceivedCreditCardTransactionsAndBalance found in ${result.receivedSegments}") }
|
||||
|
|
Loading…
Reference in New Issue