package com.example.elva.data.remote.api

import com.example.elva.data.remote.model.emergency.AlertResponse
import com.example.elva.data.remote.model.emergency.AlertResponseItem
import com.example.elva.data.remote.model.emergency.CreateAlertRequest
import com.example.elva.data.remote.model.emergency.NearbyAlertsResponse
import com.example.elva.data.remote.model.emergency.RespondToAlertRequest
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query

interface EmergencyApiService {

    @POST("api/v1/alert")
    suspend fun createAlert(@Body request: CreateAlertRequest): AlertResponse

    @POST("api/v1/alert/{alert_id}/respond")
    suspend fun respondToAlert(
        @Path("alert_id") alertId: Int,
        @Body request: RespondToAlertRequest
    ): AlertResponseItem

    @GET("api/v1/alerts/nearby")
    suspend fun getNearbyAlerts(
        @Query("latitude") latitude: Double,
        @Query("longitude") longitude: Double,
        @Query("radius_km") radiusKm: Double = 5.0
    ): NearbyAlertsResponse

    @PUT("api/v1/alert/{alert_id}/resolve")
    suspend fun resolveAlert(@Path("alert_id") alertId: Int): AlertResponse

    @GET("api/v1/alert/{alert_id}")
    suspend fun getAlertDetails(@Path("alert_id") alertId: Int): AlertResponse
}

