From 1d58a3b9e270ca02a234ba25c390fe4559c0defa Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 12 Sep 2024 11:09:03 +0200 Subject: [PATCH] Updated to new data model --- .../kotlin/net/codinux/banking/ui/service/FormatUtil.kt | 3 ++- .../src/commonMain/sqldelight/net/codinux/banking/ui/User.sq | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt index aad120a..265a80e 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/FormatUtil.kt @@ -3,6 +3,7 @@ package net.codinux.banking.ui.service import androidx.compose.ui.graphics.Color import kotlinx.datetime.* import net.codinux.banking.client.model.Amount +import net.codinux.banking.client.model.isNegative import net.codinux.banking.ui.config.Colors import net.codinux.banking.ui.model.TransactionsGrouping @@ -66,7 +67,7 @@ class FormatUtil { fun getColorForAmount(amount: Amount, showColoredAmounts: Boolean = true): Color = when { showColoredAmounts == false -> Color.Unspecified - amount.toString().startsWith("-") -> Colors.Red600 + amount.isNegative -> Colors.Red600 else -> Colors.Green600 } diff --git a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/User.sq b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/User.sq index 5a57a72..c3fc222 100644 --- a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/User.sq +++ b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/User.sq @@ -99,7 +99,7 @@ CREATE TABLE IF NOT EXISTS BankAccount ( balance TEXT NOT NULL, serverTransactionsRetentionDays INTEGER, - lastTransactionsRetrievalTime TEXT, + lastAccountUpdateTime TEXT, retrievedTransactionsFrom TEXT, userSetDisplayName TEXT, @@ -121,7 +121,7 @@ INSERT INTO BankAccount( isAccountTypeSupportedByApplication, features, - serverTransactionsRetentionDays, lastTransactionsRetrievalTime, retrievedTransactionsFrom, + serverTransactionsRetentionDays, lastAccountUpdateTime, retrievedTransactionsFrom, userSetDisplayName, displayIndex,