package com.example.petstoremobile.api;

import com.example.petstoremobile.dtos.AppointmentDTO;
import com.example.petstoremobile.dtos.BulkDeleteRequest;
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 AppointmentApi {

    @GET("api/v1/appointments")
    Call<PageResponse<AppointmentDTO>> getAllAppointments(
            @Query("page") int page,
            @Query("size") int size,
            @Query("q") String query,
            @Query("status") String status,
            @Query("storeId") Long storeId,
            @Query("date") String date,
            @Query("employeeId") Long employeeId,
            @Query("sort") String sort);

    @GET("api/v1/appointments/{id}")
    Call<AppointmentDTO> getAppointmentById(@Path("id") Long id);

    @POST("api/v1/appointments")
    Call<AppointmentDTO> createAppointment(@Body AppointmentDTO appointment);

    @PUT("api/v1/appointments/{id}")
    Call<AppointmentDTO> updateAppointment(@Path("id") Long id, @Body AppointmentDTO appointment);

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

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