|
| 1 | +package to.bitkit.models |
| 2 | + |
| 3 | +import androidx.annotation.DrawableRes |
| 4 | +import androidx.annotation.StringRes |
| 5 | +import kotlinx.serialization.Serializable |
| 6 | +import to.bitkit.R |
| 7 | + |
| 8 | +@Serializable |
| 9 | +enum class BackupCategory( |
| 10 | + @DrawableRes val icon: Int, |
| 11 | + @StringRes val title: Int, |
| 12 | +) { |
| 13 | + LIGHTNING_CONNECTIONS( |
| 14 | + icon = R.drawable.ic_lightning, |
| 15 | + title = R.string.settings__backup__category_connections, |
| 16 | + ), |
| 17 | + BLOCKTANK( |
| 18 | + icon = R.drawable.ic_note, |
| 19 | + title = R.string.settings__backup__category_connection_receipts, |
| 20 | + ), |
| 21 | + ACTIVITY( |
| 22 | + icon = R.drawable.ic_transfer, |
| 23 | + title = R.string.settings__backup__category_transaction_log, |
| 24 | + ), |
| 25 | + WALLET( |
| 26 | + icon = R.drawable.ic_timer_alt, |
| 27 | + title = R.string.settings__backup__category_wallet, |
| 28 | + ), |
| 29 | + SETTINGS( |
| 30 | + icon = R.drawable.ic_settings, |
| 31 | + title = R.string.settings__backup__category_settings, |
| 32 | + ), |
| 33 | + WIDGETS( |
| 34 | + icon = R.drawable.ic_rectangles_two, |
| 35 | + title = R.string.settings__backup__category_widgets, |
| 36 | + ), |
| 37 | + METADATA( |
| 38 | + icon = R.drawable.ic_tag, |
| 39 | + title = R.string.settings__backup__category_tags, |
| 40 | + ), |
| 41 | + // Descoped in v1, will return in v2: |
| 42 | + // PROFILE( |
| 43 | + // icon = R.drawable.ic_user, |
| 44 | + // title = R.string.settings__backup__category_profile, |
| 45 | + // ), |
| 46 | + // CONTACTS( |
| 47 | + // icon = R.drawable.ic_users, |
| 48 | + // title = R.string.settings__backup__category_contacts, |
| 49 | + // ), |
| 50 | +} |
| 51 | + |
| 52 | +/** |
| 53 | + * @property running In progress |
| 54 | + * @property synced Timestamp in ms of last time this backup was synced |
| 55 | + * @property required Timestamp in ms of last time this backup was required |
| 56 | + */ |
| 57 | +@Serializable |
| 58 | +data class BackupItemStatus( |
| 59 | + val running: Boolean = false, |
| 60 | + val synced: Long = 0L, |
| 61 | + val required: Long = 0L, |
| 62 | +) |
0 commit comments