package de.oaa.xxx.app.data.api

import de.oaa.xxx.app.data.model.RegistrationRequest
import de.oaa.xxx.app.data.model.User
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface AuthApi {

    @GET("login")
    suspend fun login(
        @Query("email") email: String,
        @Query("hash") hash: String
    ): Response<User>

    @GET("login/me")
    suspend fun me(): Response<User>

    @GET("login/logout")
    suspend fun logout(): Response<Unit>

    @POST("registration")
    suspend fun register(@Body request: RegistrationRequest): Response<Unit>

    @POST("user")
    suspend fun createUser(@Body user: User): Response<User>
}
