package com.example.quiz.data.remote;

import com.example.quiz.data.model.Course;
import com.example.quiz.data.model.Pari;
import com.example.quiz.data.model.Reunion;
import com.example.quiz.data.model.dtos.auth.LoginPayload;
import com.example.quiz.data.model.dtos.auth.LoginResponse;

import java.util.List;

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

public interface ApiService {
    @GET("reunions")
    Call<List<Reunion>> getReunions();

    @GET("courses/reunion/{reunionId}")
    Call<List<Course>> getCourses(@Path("reunionId") String reunionId);

    @POST("pari")
    Call<Pari> createPari(@Body Pari pari);

    @POST("auth/agent/login")
    Call<LoginResponse> login(@Body LoginPayload loginPayload);

    @GET("pari/created-by/{created-by}/today")
    Call<List<Pari>> derniersParis(@Path("created-by") String createdBy);

    @PUT("pari/annuler/{numeroTicket}")
    Call<Pari> annulerPari(@Path("numeroTicket") String numeroTicket);

    @GET("pari/solde/{createdBy}/course/{courseId}")
    Call<Double> getSoldeByCourse(@Path("createdBy") String createdBy, @Path("courseId") String courseId);

    @GET("pari/solde/{createdBy}")
    Call<Double> getSoldeByDay(@Path("createdBy") String createdBy, @Query("date") String day);

}
