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.GetNewRouletteResponse
import kr.co.vividnext.sodalive.live.roulette.GetRouletteResponse
import kr.co.vividnext.sodalive.live.roulette.SpinRouletteRequest
import kr.co.vividnext.sodalive.live.roulette.SpinRouletteResponse
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query

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

    @PUT("/v2/roulette")
    fun updateRoulette(
        @Body request: UpdateRouletteRequest,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<Any>>

    @GET("/v2/roulette/creator")
    fun getAllRoulette(
        @Query("creatorId") creatorId: Long,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<List<GetNewRouletteResponse>>>

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

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

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