package com.doctate.watch.net

import com.doctate.watch.domain.OnelinersResponse

/** Outcome of one `/api/oneliners` poll. Mirrors `PollOutcome` in `server_sync.rs`. */
sealed interface PollOutcome {
    /** 200 OK — body parsed, etag returned (may be null if server didn't ship one). */
    data class Success(val response: OnelinersResponse, val etag: String?) : PollOutcome

    /** 304 — client cache is current. */
    data object NotModified : PollOutcome

    /** Transient HTTP failure (5xx, 408, 429). Caller backs off and retries. */
    data class TransientHttp(val code: Int) : PollOutcome

    /** Network/IO/parse failure. Treated as transient. */
    data class Network(val cause: Throwable) : PollOutcome
}
