Fixed displaying reference
This commit is contained in:
parent
15177ed2ef
commit
e4c5e5ccfc
|
@ -99,6 +99,7 @@ open class SqliteBankingRepository(
|
|||
|
||||
|
||||
override fun getAllAccountTransactionsAsViewModel(): List<AccountTransactionViewModel> =
|
||||
// TODO: find a better way to express the reference value to display, sepaReference or (unparsed)reference
|
||||
accountTransactionQueries.selectAllTransactionsAsViewModel { id, userAccountId, bankAccountId, amount, currency, reference, valueDate, otherPartyName, bookingText, sepaReference, userSetDisplayName, category ->
|
||||
AccountTransactionViewModel(id, userAccountId, bankAccountId, mapToAmount(amount), currency, sepaReference ?: reference, mapToDate(valueDate), otherPartyName, bookingText, userSetDisplayName, category)
|
||||
}.executeAsList()
|
||||
|
|
|
@ -23,5 +23,5 @@ data class AccountTransactionViewModel(
|
|||
constructor(entity: AccountTransactionEntity) : this(entity.id, entity.userAccountId, entity.bankAccountId, entity)
|
||||
|
||||
constructor(id: Long, userAccountId: Long, bankAccountId: Long, transaction: AccountTransaction)
|
||||
: this(id, userAccountId, bankAccountId, transaction.amount, transaction.currency, transaction.reference, transaction.valueDate, transaction.otherPartyName, transaction.bookingText)
|
||||
: this(id, userAccountId, bankAccountId, transaction.amount, transaction.currency, transaction.sepaReference ?: transaction.reference, transaction.valueDate, transaction.otherPartyName, transaction.bookingText)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue