package com.fabledsword.minstrel.api.endpoints

import com.fabledsword.minstrel.models.wire.ArtistSuggestionWire
import com.fabledsword.minstrel.models.wire.CreateRequestBody
import com.fabledsword.minstrel.models.wire.LidarrSearchResultWire
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 * Retrofit interface for Discover / Lidarr search / request creation.
 * Mirrors `flutter_client/lib/api/endpoints/discover.dart`.
 *
 * `/api/lidarr/search` has a 60s LRU on the server so quick re-types
 * of the same query are cheap.
 *
 * Cancel + my-requests-list endpoints live on RequestsApi (Phase 10
 * Commit B), not here.
 */
interface DiscoverApi {
    @GET("api/discover/suggestions")
    suspend fun listSuggestions(): List<ArtistSuggestionWire>

    @GET("api/lidarr/search")
    suspend fun search(
        @Query("q") query: String,
        @Query("kind") kind: String,
    ): List<LidarrSearchResultWire>

    @POST("api/requests")
    suspend fun createRequest(@Body body: CreateRequestBody)
}
