HomeRepository

Interface defining operations for interacting with the home repository.

This repository follows the offline-first pattern where the local database serves as the single source of truth. Network operations update the local database, and UI observes local data via Flow.

Synchronization

This repository implements Syncable to support background sync via WorkManager. See sync for details on the sync implementation.

See also

Implementation class with network and local data sources

For background sync interface

SyncProgress

For sync progress tracking

Functions

Link copied to clipboard
abstract suspend fun createOrUpdateJetpack(jetpack: Jetpack): Result<Unit>

Creates or updates a jetpack in the repository.

Link copied to clipboard
abstract fun getJetpack(id: String): Flow<Jetpack>

Retrieves a specific jetpack by its ID.

Link copied to clipboard
abstract fun getJetpacks(): Flow<List<Jetpack>>

Retrieves a list of all jetpacks.

Link copied to clipboard
abstract suspend fun markJetpackAsDeleted(jetpack: Jetpack): Result<Unit>

Marks a jetpack as deleted in the repository.

Link copied to clipboard
abstract suspend fun sync(): Flow<SyncProgress>

Synchronizes data and returns a Flow emitting the progress of the sync operation.