package com.khmer9.yuki.remote.service

import com.khmer9.yuki.remote.*
import com.khmer9.yuki.screen.detail.BettingDetailResponse
import io.reactivex.Single
import retrofit2.http.*

interface ApiService {
    @POST("/v1/api/user/login")
    @Headers("No-Authentication: true")
    fun login(@Body loginRequest: LoginRequest): Single<LoginResponse>

    //Report api

    @POST("/v1/api/report/betting")
    fun remoteBettingScreen(@Body reportBettingRequest: ReportBettingRequest? = null): Single<ReportBettingResponse>

    @POST("/v1/api/report/withdraw")
    fun remoteWithdrawScreen(@Body reportWithdrawRequest: ReportWithdrawRequest? = null): Single<ReportWithdrawResponse>

    @POST("/v1/api/report/deposit")
    fun remoteDepositScreen(@Body reportDepositRequest: ReportDepositRequest? = null): Single<ReportDepositResponse>

    @POST("/v1/api/result/filter")
    fun remoteResultStatementScreen(@Body reportResultRequest: ReportResultRequest? = null): Single<ReportResultResponse>

    //Main Module
    @GET("/v1/api/module/main")
    fun remoteMainModule(): Single<MainModuleResponse>


    //Home api
    //TODO: Change <LottoSetResponse> to <YukiSetResponse>
    @GET("/v1/api/type")
    fun remoteLottoSet(): Single<LottoSetResponse>

    @GET("/v1/api/betting/previous")
    fun remotePreviousBetting(): Single<PreviousBettingResponse>

    @GET("/v1/api/result")
    fun remoteResultScreen(): Single<ResultResponse>

    @GET("/v1/api/betting/current")
    fun remoteCurrentBetting(): Single<CurrentBettingResponse>

    @POST("/v1/api/betting/")
    fun createBetting(@Body bettingRequest: List<CreateBettingRequest>): Single<CreateBettingResponse>

    @GET("/v1/api/game")
    fun remoteCurrentGame(): Single<CurrentGameResponse>

    @GET("/v1/api/betting/currentMobile")
    fun remoteCurrentBettingMobile(): Single<CurrentBettingMobileResponse>

    @FormUrlEncoded
    @POST("/v1/api/user/changepassword")
    fun updatePassword(@Field(value = "old_password") userName: String, @Field(value = "new_password") password: String): Single<UpdatePwdResponse>

    @GET("/v1/api/betting/detail/")
    fun getBettingDetail(@Query("invoice_no") invoiceNum: String): Single<BettingDetailResponse>
}