Coverage Summary for Class: PullSummary (com.georgeci.moneysurfer.domain.sync)
| Class |
Class, %
|
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| PullSummary |
100%
(1/1)
|
100%
(1/1)
|
|
100%
(3/3)
|
100%
(12/12)
|
package com.georgeci.moneysurfer.domain.sync
import com.georgeci.moneysurfer.sync.api.SyncCancelToken
import com.georgeci.moneysurfer.sync.api.SyncResult
import com.georgeci.moneysurfer.sync.api.SyncScope
/**
* Pulls remote changes since the last cursor, applies them locally, and resolves
* conflicts inline (LWW by default).
*
* Pull-applied writes MUST bypass the outbox to avoid push echo.
* See SyncCoordinatorFAQ.md №5, §4.3.
*/
interface PullRemoteChangesUseCase {
suspend operator fun invoke(
scope: SyncScope,
onProgress: suspend (PullProgress) -> Unit,
cancelToken: SyncCancelToken,
): SyncResult<PullSummary>
}
data class PullProgress(
val collection: String,
val current: Int,
val total: Int,
)
data class PullSummary(
val downloadedCount: Int,
val conflictCount: Int,
)