package com.fabledsword.minstrel.api.endpoints

import com.fabledsword.minstrel.models.wire.SyncResponseWire
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * Retrofit interface for `/api/library/sync` (#357). The endpoint
 * returns three possible status codes that the SyncController
 * branches on:
 *   - 200: parsed body with cursor + upserts + deletes
 *   - 204: no changes since the cursor; advance lastSyncAt only
 *   - 410: cursor is too old; wipe + retry with cursor=0
 *
 * The Retrofit return type is `Response<SyncResponseWire>` so the
 * controller can read `code()` directly instead of having to wrap
 * a successful no-content body or catch HttpException for 410.
 */
interface SyncApi {
    @GET("api/library/sync")
    suspend fun sync(@Query("since") since: Long): Response<SyncResponseWire>
}
