diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/daos/BitsyDatabase.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/daos/BitsyDatabase.kt index 9e68537..02c0a2f 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/daos/BitsyDatabase.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/daos/BitsyDatabase.kt @@ -11,6 +11,7 @@ abstract class BitsyDatabase : RoomDatabase() { abstract fun assetDao(): AssetDao abstract fun balanceDao(): BalanceDao + abstract fun userAccountDao(): UserAccountDao companion object { diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/daos/UserAccountDao.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/daos/UserAccountDao.kt new file mode 100644 index 0000000..9bb78f4 --- /dev/null +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/daos/UserAccountDao.kt @@ -0,0 +1,17 @@ +package cy.agorise.bitsybitshareswallet.daos + +import androidx.lifecycle.LiveData +import androidx.room.Dao +import androidx.room.Insert +import androidx.room.Query +import cy.agorise.bitsybitshareswallet.models.UserAccount + +@Dao +interface UserAccountDao { + + @Query("SELECT * FROM user_accounts") + fun getAllUserAccounts(): LiveData> + + @Insert + fun insert(userAccount: UserAccount) +} \ No newline at end of file diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/models/UserAccount.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/models/UserAccount.kt new file mode 100644 index 0000000..7ed6aa9 --- /dev/null +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/models/UserAccount.kt @@ -0,0 +1,13 @@ +package cy.agorise.bitsybitshareswallet.models + +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity(tableName = "user_accounts") +data class UserAccount ( + @PrimaryKey + @ColumnInfo(name = "id") val id: String, + @ColumnInfo(name = "name") val name: String, + @ColumnInfo(name = "is_ltm") val isLtm: Boolean // Todo verify data type +) \ No newline at end of file