package com.doctate.watch.sync

import android.content.Context

/**
 * Kick the sync worker. Implementation lives in Phase 4 (`SyncServiceLauncher`);
 * Phase 2 only needs the seam so the recording flow can call into it.
 *
 * Different kicks carry different intent — `NewPending` says the queue
 * just grew, `BurstPoll` (Phase 7) says "poll aggressively for this case
 * for the next 60 seconds".
 */
sealed interface SyncKick {
    data object NewPending : SyncKick
    data class BurstPoll(val caseId: String, val deadlineMs: Long) : SyncKick
}

/** Indirection so the ViewModel can call into the sync service without owning a reference to it. */
fun interface SyncTrigger {
    fun kick(context: Context, kick: SyncKick)
}

/** No-op. Replaced by [com.doctate.watch.sync.SyncServiceLauncher] in Phase 4. */
object NoopSyncTrigger : SyncTrigger {
    override fun kick(context: Context, kick: SyncKick) = Unit
}
