package com.example.petstoremobile.api;

import com.example.petstoremobile.dtos.BulkDeleteRequest;
import com.example.petstoremobile.dtos.PageResponse;
import com.example.petstoremobile.dtos.ProductSupplierDTO;
import retrofit2.Call;
import retrofit2.http.*;

public interface ProductSupplierApi {

    @GET("api/v1/product-suppliers")
    Call<PageResponse<ProductSupplierDTO>> getAllProductSuppliers(
            @Query("page") int page,
            @Query("size") int size,
            @Query("q") String query,
            @Query("productId") Long productId,
            @Query("supplierId") Long supplierId,
            @Query("sort") String sort);

    @GET("api/v1/product-suppliers/{productId}/{supplierId}")
    Call<ProductSupplierDTO> getProductSupplierById(
            @Path("productId") Long productId,
            @Path("supplierId") Long supplierId);

    @POST("api/v1/product-suppliers")
    Call<ProductSupplierDTO> createProductSupplier(@Body ProductSupplierDTO dto);

    @PUT("api/v1/product-suppliers/{productId}/{supplierId}")
    Call<ProductSupplierDTO> updateProductSupplier(
            @Path("productId") Long productId,
            @Path("supplierId") Long supplierId,
            @Body ProductSupplierDTO dto);

    @DELETE("api/v1/product-suppliers/{productId}/{supplierId}")
    Call<Void> deleteProductSupplier(
            @Path("productId") Long productId,
            @Path("supplierId") Long supplierId);
    @HTTP(method = "DELETE", path = "api/v1/product-suppliers", hasBody = true)
    Call<Void> bulkDeleteProductSuppliers(@Body BulkDeleteRequest request);
}