package de.haushalt.app.data

import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.PUT
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface TaskSchemaApi {
    @GET("task-schemas")
    suspend fun list(): List<TaskSchema>

    @GET("task-schemas/{id}")
    suspend fun get(@Path("id") id: Int): TaskSchema

    @POST("task-schemas")
    suspend fun create(@Body body: TaskSchemaRequest)

    @PUT("task-schemas/{id}")
    suspend fun update(@Path("id") id: Int, @Body body: TaskSchemaRequest): TaskSchema

    @DELETE("task-schemas/{id}")
    suspend fun delete(@Path("id") id: Int)
}
