package com.app.simplitend.patientprofile;

import com.app.simplitend.patientprofile.medicalinfo.mvvm.MedicationInfo;
import com.app.simplitend.patientprofile.medreminder.mvvm.models.FreqNMedTypeResult;
import com.app.simplitend.patientprofile.medreminder.mvvm.models.ReminderResult;
import com.app.simplitend.patientprofile.setuproutine.mvvm.RoutineDetails;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
import com.app.simplitend.welcome.welcomepatient.mvvm.models.PatientData;

import java.util.List;
import java.util.Map;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface PatientProfileAPIService {

    @GET("api/auth-user-data")
    Call<CallResponse<PatientData>> getUsrProfileProgress(@Header("Authorization") String token,
                                                          @Query("player_id") String player_id,
                                                          @Header("timezone") String timezone);

    @GET("api/patient-reminder-list/{id}")
    Call<CallResponse<List<ReminderResult>>> getRemindersList(@Path("id") int patient_id,
                                              @Query("weekday") int week_day,
                                              @Header("Authorization") String token);

    @POST("api/patient-reminder-store/{id}")
    Call<CallResponse<ReminderResult>> addReminder(@Path("id") int patient_id,
                                                   @Body ReminderResult reminder,
                                                   @Header("Authorization") String token);

    @GET("api/master-frequency-types")
    Call<CallResponse<FreqNMedTypeResult>> getFreqNMedTypes(@Header("Authorization") String token);

    @POST("api/patient-reminder-delete")
    Call<CallResponse<List<Void>>> deleteReminder(@Header("patientId") int patient_id,
                                                  @Header("patientReminderId") int patient_reminder_id,
                                                  @Header("Authorization") String token);


    // medical information apis

    @Multipart
    @POST("api/patient-medical-details-store/{id}")
    Call<CallResponse<MedicationInfo>> addNUpdateMedicalInfo(@PartMap Map<String, RequestBody> body,
                                                             @Path("id") int patient_id,
                                                             @Header("Authorization") String token);

    @GET("api/get-medical-details/{id}")
    Call<CallResponse<MedicationInfo>> getMedicalInfo(@Path("id") int patient_id,
                                                      @Header("Authorization") String token);


    // routines apis

    @GET("api/get-routine-details/{id}")
    Call<CallResponse<List<RoutineDetails>>> getRoutines(@Path("id") int patient_id,
                                                         @Query("weekday") int week_day,
                                                   @Header("Authorization") String token);

    @POST("api/patient-routine-store/{id}")
    Call<CallResponse<RoutineDetails>> addNUpdateRoutine(@Path("id") int patient_id,
                                                         @Body RoutineDetails routineDetails,
                                                         @Header("Authorization") String token);

    @POST("api/patient-routine-delete")
    Call<CallResponse<Object>> deleteRoutine(@Header("patientId") int patient_id,
                                             @Header("patientRoutineId") int patient_routine_id,
                                             @Header("Authorization") String token);

    @POST("api/patient-current-location-update")
    Call<CallResponse<Object>> updatePatientCurrLocation(@Body Map<String, String> body,
                                                         @Header("Authorization") String token);
}
