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

View File

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