package com.fabledsword.minstrel.api.endpoints

import com.fabledsword.minstrel.models.wire.SearchResponseWire
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * Retrofit interface for `GET /api/search`. Mirrors
 * `flutter_client/lib/api/endpoints/search.dart`. Server returns 400
 * on empty/whitespace-only `q` — the caller is responsible for
 * guarding.
 */
interface SearchApi {
    @GET("api/search")
    suspend fun search(
        @Query("q") query: String,
        @Query("limit") limit: Int = DEFAULT_LIMIT,
        @Query("offset") offset: Int = 0,
    ): SearchResponseWire

    companion object {
        const val DEFAULT_LIMIT: Int = 20
    }
}
