package com.doctate.watch.sync

/**
 * Snapshot of what the sync worker is currently doing, surfaced to the UI
 * (Tile / List / Detail) so it can render the cloud indicator. Mirrors
 * `WorkerSnapshot` in `doctate-desktop::server_sync`.
 *
 * This is the authoritative view — never trust the queue length you'd
 * compute by listing the directory yourself, because the worker can be
 * mid-delete-pair and the disk count is briefly off-by-one.
 */
enum class WorkerPhase { Idle, Uploading, Polling }

data class SyncState(
    val phase: WorkerPhase = WorkerPhase.Idle,
    val queueLen: Int = 0,
    val pendingCaseIds: Set<String> = emptySet(),
    val lastSuccessAt: Long? = null,
    val lastFailureAt: Long? = null,
    val lastFailureReason: String? = null,
)
