package kr.co.vividnext.sodalive.live.roulette.config

import io.reactivex.rxjava3.core.Single
import kr.co.vividnext.sodalive.common.ApiResponse
import kr.co.vividnext.sodalive.live.roulette.GetRouletteResponse
import kr.co.vividnext.sodalive.live.roulette.SpinRouletteRequest
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface RouletteApi {
    @POST("/roulette")
    fun createOrUpdateRoulette(
        @Body request: CreateOrUpdateRouletteRequest,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<Any>>

    @GET("/roulette")
    fun getRoulette(
        @Query("creatorId") creatorId: Long,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<GetRouletteResponse>>

    @POST("/roulette/spin")
    fun spinRoulette(
        @Body request: SpinRouletteRequest,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<GetRouletteResponse>>

    @POST("/roulette/refund/{id}")
    fun refundRouletteDonation(
        @Path("id") id: Long,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<Any>>
}
