LocalDataSource

interface LocalDataSource

Data source interface for managing local storage operations related to JetpackEntity objects.

Functions

Link copied to clipboard
abstract suspend fun deleteJetpackPermanently(id: String)

Permanently deletes a jetpack from the database.

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

Retrieves a specific jetpack by its ID.

Link copied to clipboard
abstract fun getJetpacks(userId: String): Flow<List<JetpackEntity>>

Retrieves a list of jetpacks for a specific user.

Link copied to clipboard
abstract suspend fun getLatestUpdateTimestamp(userId: String): Long

Gets the most recent lastUpdated timestamp for a specific user's jetpacks.

Link copied to clipboard
abstract suspend fun getUnsyncedJetpacks(userId: String): List<JetpackEntity>

Retrieves a list of jetpacks for a specific user that need to be synced.

Link copied to clipboard
abstract suspend fun insertJetpack(jetpackEntity: JetpackEntity)

Inserts a new jetpack into the database.

Link copied to clipboard
abstract suspend fun markAsSynced(id: String, timestamp: Long = System.currentTimeMillis())

Marks a jetpack as synced.

Link copied to clipboard
abstract suspend fun markJetpackAsDeleted(id: String)

Marks a jetpack as deleted.

Link copied to clipboard
abstract suspend fun updateJetpack(jetpackEntity: JetpackEntity)

Updates an existing jetpack in the database.

Link copied to clipboard
abstract suspend fun upsertJetpack(jetpackEntity: JetpackEntity)

Inserts or updates a jetpack in the database.

Link copied to clipboard
abstract suspend fun upsertJetpacks(remoteJetpacks: List<JetpackEntity>)

Upserts (insert or update) jetpacks from a remote source.