Finalize the Expense class and add an Enum for the rate.

This commit is contained in:
Hyperling 2025-01-09 14:02:26 -07:00
parent 49eb36514d
commit 845715122f
2 changed files with 18 additions and 20 deletions

View File

@ -1,23 +1,13 @@
package com.hyperling.expensetracker
/*class Expense {
var name: String = ""
var cost: Double = 0.0
var freq: Char = '*'
var note: String = ""
import androidx.room.Entity
import androidx.room.PrimaryKey
/*public Expense (val name: String, val cost: Double, val freq: Char, val note: String) {
this.name = name
this.name = name
this.name = name
this.name = name
}*/
}*/
class Expense (
var name: String = "",
var cost: Double = 0.0,
var freq: Char = '*',
var note: String = "",
) {
}
@Entity
data class Expense (
val name: String,
val cost: Double,
val rate: Enum<Rate>,
@PrimaryKey(autoGenerate = true)
val ID: Int = 0,
)

View File

@ -0,0 +1,8 @@
package com.hyperling.expensetracker
enum class Rate {
DAILY,
WEEKLY,
MONTHLY,
YEARLY,
}