package com.example.petstoremobile.api;

import com.example.petstoremobile.dtos.BulkDeleteRequest;
import com.example.petstoremobile.dtos.InventoryDTO;
import com.example.petstoremobile.dtos.PageResponse;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface InventoryApi {

    @GET("api/v1/inventory")
    Call<PageResponse<InventoryDTO>> getAllInventory(
            @Query("page") int page,
            @Query("size") int size,
            @Query("q") String query,
            @Query("storeId") Long storeId,
            @Query("sort") String sort);

    // GET /api/v1/inventory/{id}
    @GET("api/v1/inventory/{id}")
    Call<InventoryDTO> getInventoryById(@Path("id") Long id);

    // POST /api/v1/inventory
    @POST("api/v1/inventory")
    Call<InventoryDTO> createInventory(@Body InventoryDTO request);

    // PUT /api/v1/inventory/{id}
    @PUT("api/v1/inventory/{id}")
    Call<InventoryDTO> updateInventory(@Path("id") Long id, @Body InventoryDTO request);

    // DELETE /api/v1/inventory/{id}
    @DELETE("api/v1/inventory/{id}")
    Call<Void> deleteInventory(@Path("id") Long id);

    // DELETE /api/v1/inventory (bulk delete)
    @HTTP(method = "DELETE", path = "api/v1/inventory", hasBody = true)
    Call<Void> bulkDeleteInventory(@Body BulkDeleteRequest request);
}
