Finalize the Expense class and add an Enum for the rate.
This commit is contained in:
parent
49eb36514d
commit
845715122f
@ -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,
|
||||
)
|
8
app/src/main/java/com/hyperling/expensetracker/Rate.kt
Normal file
8
app/src/main/java/com/hyperling/expensetracker/Rate.kt
Normal file
@ -0,0 +1,8 @@
|
||||
package com.hyperling.expensetracker
|
||||
|
||||
enum class Rate {
|
||||
DAILY,
|
||||
WEEKLY,
|
||||
MONTHLY,
|
||||
YEARLY,
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user