Skip to content

Instantly share code, notes, and snippets.

@markchristopherng
Created November 19, 2019 05:51
Show Gist options
  • Save markchristopherng/7ec8c4d16bfd8fbcdf416138bffbcb77 to your computer and use it in GitHub Desktop.
Save markchristopherng/7ec8c4d16bfd8fbcdf416138bffbcb77 to your computer and use it in GitHub Desktop.
@Singleton
open class PayBillManager {
@Inject
lateinit var db: IPaybillDataProvider
open suspend fun save(bill: SavedBill?) {
if (bill != null) {
db.payBillDao().insert(bill)
}
}
open suspend fun delete(id: Int?) {
id ?: return
db.payBillDao().delete(id)
}
open suspend fun getAll(): List<SavedBill> = db.payBillDao().getAll()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment