package com.khmer9.kdmain.remote.service

import com.khmer9.kdmain.remote.*
import com.khmer9.kdmain.screen.detail.BettingDetailLottoPlusResponse
import com.khmer9.kdmain.screen.detail.BettingDetailResponse
import com.khmer9.kdmain.screen.detail.BettingDetailYukiResponse
import com.khmer9.kdmain.screen.main.TokenResponse
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>

    @GET("/v1/api/user")
    fun remoteUser(): Single<UserResponse>

    //Report api

    @POST("/v1/api/report/statement")
    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>

    @GET("/v1/api/module/sub")
    fun remoteSubModule(@Query("module_id") module_id: String): Single<SubModuleResponse>


    //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/report/lotto_plus/invoice_detail")
    fun getLottPlusInvoiceDetail(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailLottoPlusResponse>

    @GET("/v1/api/report/lotto/invoice")
    fun getLott80Invoice(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailResponse>

    @GET("/v1/api/report/yuki/invoice_detail")
    fun getYukiInvoiceDetail(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailYukiResponse>

    @GET("/v1/api/report/6number/invoice")
    fun get6NumberInvoiceDetail(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailResponse>

    @GET("/v1/api/report/cock/invoice")
    fun getCockInvoiceDetail(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailResponse>

    @GET("/v1/api/module/token")
    fun getToken(@Query("app_id") tokenId: String): Single<TokenResponse>
}