package com.fabledsword.minstrel.api.endpoints

import com.fabledsword.minstrel.models.wire.QuarantineMineWire
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path

/**
 * Retrofit interface for `/api/quarantine`. Mirrors the relevant
 * parts of `flutter_client/lib/api/endpoints/quarantine.dart` (flag
 * and unflag) plus the `/api/quarantine/mine` endpoint from `me.dart`.
 *
 * Both flag and unflag are user-scoped — callers act on their own
 * quarantine entries. The cross-user admin surface is a separate
 * `/api/admin/quarantine` route (Phase 10 Commit D).
 */
interface QuarantineApi {
    @GET("api/quarantine/mine")
    suspend fun listMine(): List<QuarantineMineWire>

    @POST("api/quarantine")
    suspend fun flag(@Body body: FlagRequest)

    @DELETE("api/quarantine/{trackId}")
    suspend fun unflag(@Path("trackId") trackId: String)
}

/**
 * POST /api/quarantine body. `reason` is one of bad_rip / wrong_file
 * / wrong_tags / duplicate / other; `notes` is the free-text comment.
 */
@kotlinx.serialization.Serializable
data class FlagRequest(
    @kotlinx.serialization.SerialName("track_id") val trackId: String,
    val reason: String,
    val notes: String = "",
)
