FirebaseJetpack

data class FirebaseJetpack(val id: String = UUID.randomUUID().toString(), val name: String = String(), val price: Double = 0.0, val userId: String = String(), val lastUpdated: Long = 0, val lastSynced: Long = 0, val deleted: Boolean = false)(source)

A Jetpack item as it is stored in Firestore, at /dev.atick.jetpack/{userId}/jetpacks/{jetpackId}.

FirebaseJetpack.lastUpdated and FirebaseJetpack.lastSynced carry device-clock milliseconds into Room, where they affect list ordering and pending-row selection. serverUpdatedAt carries the server write timestamp used by the pull cursor; it is independent of those device clocks.

Constructors

Link copied to clipboard
constructor(id: String = UUID.randomUUID().toString(), name: String = String(), price: Double = 0.0, userId: String = String(), lastUpdated: Long = 0, lastSynced: Long = 0, deleted: Boolean = false)

Properties

Link copied to clipboard

Soft delete flag.

Link copied to clipboard
val id: String

Unique identifier, shared with the Room entity and used as the document ID.

Link copied to clipboard

Device-clock milliseconds set on upload; also mapped back into Room.

Link copied to clipboard

Writing device's clock, in milliseconds, when the row was last edited.

Link copied to clipboard

Display name.

Link copied to clipboard

Price in the user's currency.

Link copied to clipboard
var serverUpdatedAt: Timestamp?
Link copied to clipboard

Firebase Auth UID of the owner. Also the parent document in the path above.

Functions

Link copied to clipboard

FirebaseJetpack.serverUpdatedAt as nanoseconds since the epoch, or 0 for a document the server has not stamped yet.