package com.doverfuelingsolutions.issp.api.service

import com.doverfuelingsolutions.issp.api.dto.ResultAccumulationInfo
import com.doverfuelingsolutions.issp.api.dto.ResultApiInfo
import com.doverfuelingsolutions.issp.api.dto.ResultPumpInfo
import com.doverfuelingsolutions.issp.api.entity.DefaultParams
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Url

interface ServiceStation {

    @POST
    fun postBody(@Url url: String, @Body params: RequestBody) : Call<ResponseBody>

    @Headers("requestName: getApiInfo", "Content-Type: application/json")
    @POST("u/?apitype=service&an=ShowMeApi&pn=ProcessorsDispatcher&en=Edge.Core.Processor.Dispatcher.DefaultDispatcher")
    fun getApiInfo(@Body params: RequestBody = RequestBody.create(okhttp3.MediaType.parse("application/json"), "[\"webApi\", [\"IfsfFdcServer\"]]")): Call<Array<ResultApiInfo>>

    @Headers("requestName: getNozzleInfo")
    @POST("u/?mn=GetPumpsLayout&pn=fdcServerApp&en=Applications.FDC.FdcServerHostApp")
    fun getNozzleInfo(@Body params: DefaultParams = DefaultParams(emptyList())): Call<Array<ResultPumpInfo>>


    @POST("u/?mn=GetFuelSaleTrxDetailsAsync&pn=fdcServerApp&en=Applications.FDC.FdcServerHostApp")
    @Headers("requestName: accumulationInfo", "Content-Type: application/json", "Accept: application/json")
    fun accumulationInfo(@Body params: DefaultParams): Call<List<ResultAccumulationInfo>>
}