package de.ypchat.android.data.api

import de.ypchat.android.data.model.CountriesResponse
import de.ypchat.android.data.model.FeedbackAdminLoginRequest
import de.ypchat.android.data.model.FeedbackAdminStatusResponse
import de.ypchat.android.data.model.FeedbackRequest
import de.ypchat.android.data.model.FeedbackResponse
import de.ypchat.android.data.model.ImageUploadResponse
import de.ypchat.android.data.model.LogoutResponse
import de.ypchat.android.data.model.PartnerLinkDto
import de.ypchat.android.data.model.SessionResponse
import okhttp3.MultipartBody
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part

interface RestApi {
    @GET("api/session")
    suspend fun session(): SessionResponse

    @POST("api/logout")
    suspend fun logout(): LogoutResponse

    @GET("api/countries")
    suspend fun countries(): CountriesResponse

    @GET("api/feedback")
    suspend fun feedback(): FeedbackResponse

    @GET("api/feedback/admin-status")
    suspend fun feedbackAdminStatus(): FeedbackAdminStatusResponse

    @POST("api/feedback")
    suspend fun submitFeedback(@Body request: FeedbackRequest)

    @POST("api/feedback/admin-login")
    suspend fun feedbackAdminLogin(@Body request: FeedbackAdminLoginRequest): FeedbackAdminStatusResponse

    @POST("api/feedback/admin-logout")
    suspend fun feedbackAdminLogout()

    @retrofit2.http.DELETE("api/feedback/{id}")
    suspend fun deleteFeedback(@retrofit2.http.Path("id") id: String)

    @GET("api/partners")
    suspend fun partners(): List<PartnerLinkDto>

    @Multipart
    @POST("api/upload-image")
    suspend fun uploadImage(@Part image: MultipartBody.Part): Response<ImageUploadResponse>
}
