Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Fix proguard issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Aug 22, 2023
1 parent d298dbe commit 78d13f9
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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<AccountEntity> = emptyList(),
@SerializedName("budgets")
val budgets: List<BudgetEntity> = emptyList(),
@SerializedName("categories")
val categories: List<CategoryEntity> = emptyList(),
@SerializedName("loanRecords")
val loanRecords: List<LoanRecordEntity> = emptyList(),
@SerializedName("loans")
val loans: List<LoanEntity> = emptyList(),
@SerializedName("plannedPaymentRules")
val plannedPaymentRules: List<PlannedPaymentRuleEntity> = emptyList(),
@SerializedName("settings")
val settings: List<SettingsEntity> = emptyList(),
@SerializedName("transactions")
val transactions: List<TransactionEntity> = emptyList(),
@SerializedName("sharedPrefs")
val sharedPrefs: HashMap<String, String> = HashMap()
)
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/com/ivy/wallet/io/persistence/data/LoanEntity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,56 @@ 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
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 78d13f9

Please sign in to comment.