package com.fabledsword.minstrel.api.endpoints

import com.fabledsword.minstrel.models.wire.RequestWire
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Path

/**
 * Retrofit interface for the user-side `/api/requests`. Mirrors
 * `flutter_client/lib/api/endpoints/requests.dart`.
 *
 * Server scopes results to the caller — admins see only their own
 * requests through this endpoint. The cross-user admin view lives on
 * a separate `/api/admin/requests` route (Phase 10 Commit D).
 *
 * The DELETE endpoint returns the cancelled row (not 204) so the UI
 * can patch local state without a refetch.
 */
interface RequestsApi {
    @GET("api/requests")
    suspend fun listMine(): List<RequestWire>

    @DELETE("api/requests/{id}")
    suspend fun cancel(@Path("id") id: String): RequestWire
}
