Coverage Summary for Class: FirebaseRemoteDocument (com.georgeci.moneysurfer.data.sync)
| Class |
Class, %
|
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| FirebaseRemoteDocument |
0%
(0/1)
|
0%
(0/4)
|
0%
(0/2)
|
0%
(0/4)
|
0%
(0/49)
|
package com.georgeci.moneysurfer.data.sync
import com.georgeci.moneysurfer.sync.plugin.RemoteDocument
import dev.gitlive.firebase.firestore.DocumentSnapshot
import kotlinx.serialization.DeserializationStrategy
class FirebaseRemoteDocument(val snap: DocumentSnapshot) : RemoteDocument {
override val id: String get() = snap.id
override fun <T> decode(deserializer: DeserializationStrategy<T>): T = snap.data(deserializer)
override fun getLong(field: String): Long? = runCatching { snap.get<Long>(field) }.getOrNull()
}