From 78d13f96fa49b32bdbbc7c5d0127d29b48ee132b Mon Sep 17 00:00:00 2001 From: iliyangermanov Date: Tue, 22 Aug 2023 15:11:44 +0300 Subject: [PATCH] Fix proguard issue --- .../domain/data/IvyWalletCompleteData.kt | 10 ++++++++++ .../io/persistence/data/AccountEntity.kt | 10 ++++++++++ .../wallet/io/persistence/data/BudgetEntity.kt | 9 +++++++++ .../io/persistence/data/CategoryEntity.kt | 8 ++++++++ .../io/persistence/data/ExchangeRateEntity.kt | 5 +++++ .../wallet/io/persistence/data/LoanEntity.kt | 11 +++++++++++ .../io/persistence/data/LoanRecordEntity.kt | 11 +++++++++++ .../data/PlannedPaymentRuleEntity.kt | 14 ++++++++++++++ .../io/persistence/data/SettingsEntity.kt | 8 ++++++++ .../io/persistence/data/TransactionEntity.kt | 18 ++++++++++++++++++ .../wallet/io/persistence/data/UserEntity.kt | 12 +++++++++++- 11 files changed, 115 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/ivy/wallet/domain/data/IvyWalletCompleteData.kt b/app/src/main/java/com/ivy/wallet/domain/data/IvyWalletCompleteData.kt index efe0b95e52..271201c073 100644 --- a/app/src/main/java/com/ivy/wallet/domain/data/IvyWalletCompleteData.kt +++ b/app/src/main/java/com/ivy/wallet/domain/data/IvyWalletCompleteData.kt @@ -1,15 +1,25 @@ package com.ivy.wallet.domain.data +import com.google.gson.annotations.SerializedName import com.ivy.wallet.io.persistence.data.* data class IvyWalletCompleteData( + @SerializedName("accounts") val accounts: List = emptyList(), + @SerializedName("budgets") val budgets: List = emptyList(), + @SerializedName("categories") val categories: List = emptyList(), + @SerializedName("loanRecords") val loanRecords: List = emptyList(), + @SerializedName("loans") val loans: List = emptyList(), + @SerializedName("plannedPaymentRules") val plannedPaymentRules: List = emptyList(), + @SerializedName("settings") val settings: List = emptyList(), + @SerializedName("transactions") val transactions: List = emptyList(), + @SerializedName("sharedPrefs") val sharedPrefs: HashMap = HashMap() ) \ No newline at end of file diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/AccountEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/AccountEntity.kt index e4d4d8faf7..a29b658928 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/AccountEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/AccountEntity.kt @@ -3,23 +3,33 @@ package com.ivy.wallet.io.persistence.data import androidx.compose.ui.graphics.toArgb import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.core.Account import com.ivy.wallet.ui.theme.Green import java.util.* @Entity(tableName = "accounts") data class AccountEntity( + @SerializedName("name") val name: String, + @SerializedName("currency") val currency: String? = null, + @SerializedName("color") val color: Int = Green.toArgb(), + @SerializedName("icon") val icon: String? = null, + @SerializedName("orderNum") val orderNum: Double = 0.0, + @SerializedName("includeInBalance") val includeInBalance: Boolean = true, + @SerializedName("isSynced") val isSynced: Boolean = false, + @SerializedName("isDeleted") val isDeleted: Boolean = false, @PrimaryKey + @SerializedName("id") val id: UUID = UUID.randomUUID() ) { fun toDomain(): Account = Account( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/BudgetEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/BudgetEntity.kt index 7446b1ea6f..fa5bdd74c9 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/BudgetEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/BudgetEntity.kt @@ -2,22 +2,31 @@ package com.ivy.wallet.io.persistence.data import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.core.Budget import java.util.* @Entity(tableName = "budgets") data class BudgetEntity( + @SerializedName("name") val name: String, + @SerializedName("amount") val amount: Double, + @SerializedName("categoryIdsSerialized") val categoryIdsSerialized: String?, + @SerializedName("accountIdsSerialized") val accountIdsSerialized: String?, + @SerializedName("isSynced") val isSynced: Boolean = false, + @SerializedName("isDeleted") val isDeleted: Boolean = false, + @SerializedName("orderId") val orderId: Double, @PrimaryKey + @SerializedName("id") val id: UUID = UUID.randomUUID() ) { fun toDomain(): Budget = Budget( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/CategoryEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/CategoryEntity.kt index b6ebf86c68..59f3b7bf92 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/CategoryEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/CategoryEntity.kt @@ -3,21 +3,29 @@ package com.ivy.wallet.io.persistence.data import androidx.compose.ui.graphics.toArgb import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.core.Category import com.ivy.wallet.ui.theme.Ivy import java.util.* @Entity(tableName = "categories") data class CategoryEntity( + @SerializedName("name") val name: String, + @SerializedName("color") val color: Int = Ivy.toArgb(), + @SerializedName("icon") val icon: String? = null, + @SerializedName("orderNum") val orderNum: Double = 0.0, + @SerializedName("isSynced") val isSynced: Boolean = false, + @SerializedName("isDeleted") val isDeleted: Boolean = false, @PrimaryKey + @SerializedName("id") val id: UUID = UUID.randomUUID() ) { fun toDomain(): Category = Category( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/ExchangeRateEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/ExchangeRateEntity.kt index e3d83e6b7c..815b31e70c 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/ExchangeRateEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/ExchangeRateEntity.kt @@ -1,13 +1,18 @@ package com.ivy.wallet.io.persistence.data import androidx.room.Entity +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.core.ExchangeRate @Entity(tableName = "exchange_rates", primaryKeys = ["baseCurrency", "currency"]) data class ExchangeRateEntity( + @SerializedName("baseCurrency") val baseCurrency: String, + @SerializedName("currency") val currency: String, + @SerializedName("rate") val rate: Double, + @SerializedName("manualOverride") val manualOverride: Boolean = false, ) { fun toDomain(): ExchangeRate = ExchangeRate( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/LoanEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/LoanEntity.kt index fe5a447cfe..fb110d2afc 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/LoanEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/LoanEntity.kt @@ -2,24 +2,35 @@ package com.ivy.wallet.io.persistence.data import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.LoanType import com.ivy.wallet.domain.data.core.Loan import java.util.* @Entity(tableName = "loans") data class LoanEntity( + @SerializedName("name") val name: String, + @SerializedName("amount") val amount: Double, + @SerializedName("type") val type: LoanType, + @SerializedName("color") val color: Int = 0, + @SerializedName("icon") val icon: String? = null, + @SerializedName("orderNum") val orderNum: Double = 0.0, + @SerializedName("accountId") val accountId: UUID? = null, + @SerializedName("isSynced") val isSynced: Boolean = false, + @SerializedName("isDeleted") val isDeleted: Boolean = false, @PrimaryKey + @SerializedName("id") val id: UUID = UUID.randomUUID() ) { fun toDomain(): Loan = Loan( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/LoanRecordEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/LoanRecordEntity.kt index af6487f78b..f8f3bfda1b 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/LoanRecordEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/LoanRecordEntity.kt @@ -2,25 +2,36 @@ package com.ivy.wallet.io.persistence.data import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.core.LoanRecord import java.time.LocalDateTime import java.util.* @Entity(tableName = "loan_records") data class LoanRecordEntity( + @SerializedName("loanId") val loanId: UUID, + @SerializedName("amount") val amount: Double, + @SerializedName("note") val note: String? = null, + @SerializedName("dateTime") val dateTime: LocalDateTime, + @SerializedName("interest") val interest: Boolean = false, + @SerializedName("accountId") val accountId: UUID? = null, //This is used store the converted amount for currencies which are different from the loan account currency + @SerializedName("convertedAmount") val convertedAmount: Double? = null, + @SerializedName("isSynced") val isSynced: Boolean = false, + @SerializedName("isDeleted") val isDeleted: Boolean = false, @PrimaryKey + @SerializedName("id") val id: UUID = UUID.randomUUID() ) { fun toDomain(): LoanRecord = LoanRecord( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/PlannedPaymentRuleEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/PlannedPaymentRuleEntity.kt index e38fa3c151..04d9496c88 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/PlannedPaymentRuleEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/PlannedPaymentRuleEntity.kt @@ -2,6 +2,7 @@ package com.ivy.wallet.io.persistence.data import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.IntervalType import com.ivy.wallet.domain.data.TransactionType import com.ivy.wallet.domain.data.core.PlannedPaymentRule @@ -10,22 +11,35 @@ import java.util.* @Entity(tableName = "planned_payment_rules") data class PlannedPaymentRuleEntity( + @SerializedName("startDate") val startDate: LocalDateTime?, + @SerializedName("intervalN") val intervalN: Int?, + @SerializedName("intervalType") val intervalType: IntervalType?, + @SerializedName("oneTime") val oneTime: Boolean, + @SerializedName("type") val type: TransactionType, + @SerializedName("accountId") val accountId: UUID, + @SerializedName("amount") val amount: Double = 0.0, + @SerializedName("categoryId") val categoryId: UUID? = null, + @SerializedName("title") val title: String? = null, + @SerializedName("description") val description: String? = null, + @SerializedName("isSynced") val isSynced: Boolean = false, + @SerializedName("isDeleted") val isDeleted: Boolean = false, @PrimaryKey + @SerializedName("id") val id: UUID = UUID.randomUUID() ) { fun toDomain(): PlannedPaymentRule = PlannedPaymentRule( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/SettingsEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/SettingsEntity.kt index f153edabde..3d208f609d 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/SettingsEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/SettingsEntity.kt @@ -2,21 +2,29 @@ package com.ivy.wallet.io.persistence.data import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.design.l0_system.Theme import com.ivy.wallet.domain.data.core.Settings import java.util.* @Entity(tableName = "settings") data class SettingsEntity( + @SerializedName("theme") val theme: Theme, + @SerializedName("currency") val currency: String, + @SerializedName("bufferAmount") val bufferAmount: Double, + @SerializedName("name") val name: String, + @SerializedName("isSynced") val isSynced: Boolean = false, + @SerializedName("isDeleted") val isDeleted: Boolean = false, @PrimaryKey + @SerializedName("id") val id: UUID = UUID.randomUUID() ) { fun toDomain(): Settings = Settings( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/TransactionEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/TransactionEntity.kt index 749a803622..ccffaac168 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/TransactionEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/TransactionEntity.kt @@ -2,6 +2,7 @@ package com.ivy.wallet.io.persistence.data import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.TransactionType import com.ivy.wallet.domain.data.core.Transaction import java.time.LocalDateTime @@ -9,31 +10,48 @@ import java.util.* @Entity(tableName = "transactions") data class TransactionEntity( + @SerializedName("accountId") val accountId: UUID, + @SerializedName("type") val type: TransactionType, + @SerializedName("amount") val amount: Double, + @SerializedName("toAccountId") val toAccountId: UUID? = null, + @SerializedName("toAmount") val toAmount: Double? = null, + @SerializedName("title") val title: String? = null, + @SerializedName("description") val description: String? = null, + @SerializedName("dateTime") val dateTime: LocalDateTime? = null, + @SerializedName("categoryId") val categoryId: UUID? = null, + @SerializedName("dueDate") val dueDate: LocalDateTime? = null, + @SerializedName("recurringRuleId") val recurringRuleId: UUID? = null, + @SerializedName("attachmentUrl") val attachmentUrl: String? = null, //This refers to the loan id that is linked with a transaction + @SerializedName("loanId") val loanId: UUID? = null, //This refers to the loan record id that is linked with a transaction + @SerializedName("loanRecordId") val loanRecordId: UUID? = null, + @SerializedName("isSynced") val isSynced: Boolean = false, + @SerializedName("isDeleted") val isDeleted: Boolean = false, @PrimaryKey + @SerializedName("id") val id: UUID = UUID.randomUUID() ) { fun toDomain(): Transaction = Transaction( diff --git a/app/src/main/java/com/ivy/wallet/io/persistence/data/UserEntity.kt b/app/src/main/java/com/ivy/wallet/io/persistence/data/UserEntity.kt index 55f48c6ab9..3f21e6d8e4 100644 --- a/app/src/main/java/com/ivy/wallet/io/persistence/data/UserEntity.kt +++ b/app/src/main/java/com/ivy/wallet/io/persistence/data/UserEntity.kt @@ -3,29 +3,39 @@ package com.ivy.wallet.io.persistence.data import androidx.room.ColumnInfo import androidx.room.Entity import androidx.room.PrimaryKey +import com.google.gson.annotations.SerializedName import com.ivy.wallet.domain.data.AuthProviderType import com.ivy.wallet.domain.data.core.User import java.util.* @Entity(tableName = "users") data class UserEntity( + @SerializedName("email") @ColumnInfo(name = "email") val email: String, + @SerializedName("authProviderType") @ColumnInfo(name = "authProviderType") val authProviderType: AuthProviderType, + @SerializedName("firstName") @ColumnInfo(name = "firstName") var firstName: String, + @SerializedName("lastName") @ColumnInfo(name = "lastName") val lastName: String?, + @SerializedName("profilePicture") @ColumnInfo(name = "profilePicture") val profilePicture: String?, + @SerializedName("color") @ColumnInfo(name = "color") val color: Int, + @SerializedName("testUser") @ColumnInfo(name = "testUser") val testUser: Boolean = false, - @PrimaryKey @ColumnInfo(name = "id") + @PrimaryKey + @SerializedName("id") + @ColumnInfo(name = "id") var id: UUID ) { fun toDomain(): User = User(