package com.yono.messeripos.api.service;

import com.yono.messeripos.api.ApiHelper;
import com.yono.messeripos.models.CategoryModels;
import com.yono.messeripos.models.ProductModels;
import com.yono.messeripos.response.DataResponse;

import java.util.List;

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

public interface CategoryServise {
    @GET(ApiHelper.VERSI_API_1+"categories")
    Call<DataResponse<List<CategoryModels>>> getCategory();

    @GET(ApiHelper.VERSI_API_1+"product-category-id/{id}")
    Call<DataResponse<List<ProductModels>>> getCategoryById(@Path("id") int id);

    @GET(ApiHelper.VERSI_API_1+"category-name/{id}")
    Call<DataResponse<List<CategoryModels>>> getCategoryByName(@Path("id") String name);

    @GET(ApiHelper.VERSI_API_1+"category/{id}")
    Call<DataResponse<CategoryModels>> getCategoryId(@Path("id") int id);

    @POST(ApiHelper.VERSI_API_1+"category")
    Call<DataResponse<CategoryModels>> addCategory(@Body CategoryModels categoryModels);

    @DELETE(ApiHelper.VERSI_API_1+"category/{id}")
    Call<DataResponse<CategoryModels>> deleteCategory(@Path("id") int id);

    @PUT(ApiHelper.VERSI_API_1+"category/{id}")
    Call<DataResponse<CategoryModels>> updateCategory(@Path("id") int id, @Body CategoryModels categoryModels);
}
