package de.haushalt.app.data

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

interface TaskApi {
    @GET("tasks")
    suspend fun list(@Query("filter") filter: String? = null): List<Task>

    @GET("tasks/{id}")
    suspend fun get(@Path("id") id: Int): Task

    @PUT("tasks/{id}")
    suspend fun update(@Path("id") id: Int, @Body body: TaskRequest): Task

    @DELETE("tasks/{id}")
    suspend fun delete(@Path("id") id: Int)

    @PATCH("tasks/{id}/toggle")
    suspend fun toggle(@Path("id") id: Int): Task

    @GET("tasks/statuses")
    suspend fun statuses(): List<TaskStatus>
}
