package org.zaine.management.data.api

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

interface OrgBackendApi {
    @POST("api/auth/login")
    suspend fun login(@Body request: LoginRequest): LoginResponse

    @GET("api/calendar/today")
    suspend fun todayEvents(): List<CalendarEventDto>

    @GET("api/calendar/month")
    suspend fun monthEvents(
        @Query("year") year: Int,
        @Query("month") month: Int
    ): List<CalendarEventDto>

    @GET("api/calendar/range")
    suspend fun rangeEvents(
        @Query("from") from: String,
        @Query("to") to: String
    ): List<CalendarEventDto>

    @GET("api/calendar/events/{id}")
    suspend fun event(@Path("id") id: Long): CalendarEventDto

    @GET("api/checkin/today-status")
    suspend fun todayStatus(): TodayStatusDto

    @GET("api/checkin/history")
    suspend fun checkinHistory(
        @Query("from") from: String,
        @Query("to") to: String
    ): List<TodayStatusDto>

    @POST("api/checkin/morning")
    suspend fun submitMorning(@Body request: MorningCheckinRequest): TodayStatusDto

    @POST("api/checkin/evening")
    suspend fun submitEvening(@Body request: EveningCheckinRequest): TodayStatusDto

    @GET("api/wird/entries/today")
    suspend fun todayWirdEntries(): List<WirdEntryDto>

    @GET("api/wird/entries/range")
    suspend fun wirdEntries(
        @Query("from") from: String,
        @Query("to") to: String
    ): List<WirdEntryDto>

    @POST("api/wird/entries")
    suspend fun createWirdEntry(@Body request: WirdEntryRequest): WirdEntryDto
}
