diff --git a/app/src/main/java/com/hyperling/expensetracker/Expense.kt b/app/src/main/java/com/hyperling/expensetracker/Expense.kt index 23e2aa7..2445868 100644 --- a/app/src/main/java/com/hyperling/expensetracker/Expense.kt +++ b/app/src/main/java/com/hyperling/expensetracker/Expense.kt @@ -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 = "", -) { -} \ No newline at end of file +@Entity +data class Expense ( + val name: String, + val cost: Double, + val rate: Enum, + @PrimaryKey(autoGenerate = true) + val ID: Int = 0, +) \ No newline at end of file diff --git a/app/src/main/java/com/hyperling/expensetracker/Rate.kt b/app/src/main/java/com/hyperling/expensetracker/Rate.kt new file mode 100644 index 0000000..cf4c858 --- /dev/null +++ b/app/src/main/java/com/hyperling/expensetracker/Rate.kt @@ -0,0 +1,8 @@ +package com.hyperling.expensetracker + +enum class Rate { + DAILY, + WEEKLY, + MONTHLY, + YEARLY, +} \ No newline at end of file