package com.example.petstoremobile.api;

import com.example.petstoremobile.dtos.CouponDTO;
import com.example.petstoremobile.dtos.PageResponse;

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 CouponApi {

    @GET("api/v1/coupons")
    Call<PageResponse<CouponDTO>> getAllCoupons(
            @Query("page") int page,
            @Query("size") int size,
            @Query("active") Boolean active,
            @Query("discountType") String discountType,
            @Query("sort") String sort);

    @GET("api/v1/coupons/{id}")
    Call<CouponDTO> getCouponById(@Path("id") Long id);

    @GET("api/v1/coupons/code/{code}")
    Call<CouponDTO> getCouponByCode(@Path("code") String code);

    @POST("api/v1/coupons")
    Call<CouponDTO> createCoupon(@Body CouponDTO coupon);

    @PUT("api/v1/coupons/{id}")
    Call<CouponDTO> updateCoupon(@Path("id") Long id, @Body CouponDTO coupon);

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

    @DELETE("api/v1/coupons")
    Call<Void> bulkDeleteCoupons(@Query("ids") List<Long> ids);
}
