From d75e8705eaf4d739a98a7ef9cbe2e53548a7e311 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 27 Aug 2024 21:01:33 +0200 Subject: [PATCH] Added category to AccountTransactionEntity --- .../codinux/banking/dataaccess/SqliteBankingRepository.kt | 6 +++--- .../sqldelight/net/codinux/banking/ui/AccountTransaction.sq | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/dataaccess/SqliteBankingRepository.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/dataaccess/SqliteBankingRepository.kt index 0b84497..c8d7bc2 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/dataaccess/SqliteBankingRepository.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/dataaccess/SqliteBankingRepository.kt @@ -37,7 +37,7 @@ class SqliteBankingRepository( override fun getAllAccountTransactions(): List { - return accountTransactionQueries.selectAllTransactions { id, amount, currency, reference, bookingDate, valueDate, otherPartyName, otherPartyBankCode, otherPartyAccountId, bookingText, userSetDisplayName, notes, information, statementNumber, sequenceNumber, openingBalance, closingBalance, endToEndReference, customerReference, mandateReference, creditorIdentifier, originatorsIdentificationCode, compensationAmount, originalAmount, sepaReference, deviantOriginator, deviantRecipient, referenceWithNoSpecialType, primaNotaNumber, textKeySupplement, currencyType, bookingKey, referenceForTheAccountOwner, referenceOfTheAccountServicingInstitution, supplementaryDetails, transactionReferenceNumber, relatedReferenceNumber -> + return accountTransactionQueries.selectAllTransactions { id, amount, currency, reference, bookingDate, valueDate, otherPartyName, otherPartyBankCode, otherPartyAccountId, bookingText, userSetDisplayName, category, notes, information, statementNumber, sequenceNumber, openingBalance, closingBalance, endToEndReference, customerReference, mandateReference, creditorIdentifier, originatorsIdentificationCode, compensationAmount, originalAmount, sepaReference, deviantOriginator, deviantRecipient, referenceWithNoSpecialType, primaNotaNumber, textKeySupplement, currencyType, bookingKey, referenceForTheAccountOwner, referenceOfTheAccountServicingInstitution, supplementaryDetails, transactionReferenceNumber, relatedReferenceNumber -> AccountTransactionEntity( id, Amount(amount), currency, reference, @@ -45,7 +45,7 @@ class SqliteBankingRepository( otherPartyName, otherPartyBankCode, otherPartyAccountId, bookingText, - userSetDisplayName, notes, + userSetDisplayName, category, notes, information, statementNumber?.toInt(), sequenceNumber?.toInt(), @@ -82,7 +82,7 @@ class SqliteBankingRepository( transaction.otherPartyName, transaction.otherPartyBankCode, transaction.otherPartyAccountId, transaction.bookingText, - transaction.userSetDisplayName, transaction.notes, + transaction.userSetDisplayName, null, transaction.notes, // TODO: add category to AccountTransaction transaction.information, transaction.statementNumber?.toLong(), transaction.sequenceNumber?.toLong(), diff --git a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/AccountTransaction.sq b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/AccountTransaction.sq index 5edf3a6..68eb0b6 100644 --- a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/AccountTransaction.sq +++ b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/AccountTransaction.sq @@ -15,6 +15,7 @@ CREATE TABLE IF NOT EXISTS AccountTransaction ( bookingText TEXT, userSetDisplayName TEXT, + category TEXT, notes TEXT, information TEXT, @@ -57,7 +58,7 @@ INSERT INTO AccountTransaction( otherPartyName, otherPartyBankCode, otherPartyAccountId, bookingText, - userSetDisplayName, notes, + userSetDisplayName, category, notes, information, statementNumber, sequenceNumber, @@ -83,7 +84,7 @@ VALUES( ?, ?, ?, ?, - ?, ?, + ?, ?, ?, ?, ?, ?,