Coverage Summary for Class: SyncStep (com.georgeci.moneysurfer.sync.api)
| Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| SyncStep$Cancelled |
100%
(1/1)
|
|
100%
(2/2)
|
100%
(21/21)
|
| SyncStep$Completed |
100%
(1/1)
|
|
100%
(2/2)
|
100%
(12/12)
|
| SyncStep$Failed |
100%
(1/1)
|
|
100%
(2/2)
|
100%
(12/12)
|
| SyncStep$PullingCollection |
100%
(1/1)
|
|
100%
(4/4)
|
100%
(26/26)
|
| SyncStep$PullingRemoteChanges |
100%
(1/1)
|
|
100%
(1/1)
|
100%
(3/3)
|
| SyncStep$RecalculatingProjections |
100%
(1/1)
|
|
100%
(1/1)
|
100%
(3/3)
|
| SyncStep$Started |
100%
(1/1)
|
|
100%
(1/1)
|
100%
(3/3)
|
| SyncStep$UploadingEntity |
100%
(1/1)
|
|
100%
(5/5)
|
100%
(28/28)
|
| SyncStep$UploadingPendingChanges |
100%
(1/1)
|
|
100%
(1/1)
|
100%
(3/3)
|
| SyncStep$WaitingForNetwork |
100%
(1/1)
|
|
100%
(1/1)
|
100%
(3/3)
|
| Total |
100%
(10/10)
|
|
100%
(20/20)
|
100%
(114/114)
|
package com.georgeci.moneysurfer.sync.api
/**
* Steps emitted by the coordinator pipeline.
*
* `ResolvingConflicts` is intentionally omitted — the pull stage resolves
* conflicts itself via LWW (see SyncCoordinatorFAQ.md №5).
*/
sealed interface SyncStep {
val title: String
data object WaitingForNetwork : SyncStep {
override val title: String = "Waiting for network"
}
data object Started : SyncStep {
override val title: String = "Sync started"
}
data object UploadingPendingChanges : SyncStep {
override val title: String = "Uploading changes"
}
data class UploadingEntity(
val entityType: String,
val current: Int,
val total: Int,
) : SyncStep {
override val title: String = "Uploading $entityType $current/$total"
}
data object PullingRemoteChanges : SyncStep {
override val title: String = "Downloading changes"
}
data class PullingCollection(
val collection: String,
val current: Int? = null,
val total: Int? = null,
) : SyncStep {
override val title: String = "Downloading $collection"
}
data object RecalculatingProjections : SyncStep {
override val title: String = "Recalculating balances"
}
data class Completed(val summary: SyncSummary) : SyncStep {
override val title: String = "Sync completed"
}
data class Cancelled(val summary: SyncSummary? = null) : SyncStep {
override val title: String = "Sync cancelled"
}
data class Failed(val error: SyncError) : SyncStep {
override val title: String = "Sync failed"
}
}