package com.younki.maidmatching.services;

import com.younki.maidmatching.services.HTTP.ApplicantWPResponse;
import com.younki.maidmatching.services.HTTP.GlobalResponse;
import com.younki.maidmatching.services.HTTP.JobApplicantRecruitRequest;
import com.younki.maidmatching.services.HTTP.JobApplicantRequest;
import com.younki.maidmatching.services.HTTP.JobParameterRequest;
import com.younki.maidmatching.services.HTTP.JobResponse;
import com.younki.maidmatching.services.HTTP.AddSkillRequest;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface JobService {
    @GET("job/owner/{user_id}")
    Call<JobResponse> getOwnerJob(@Path("user_id") String user_id);
    @GET("job/owner/{user_id}")
    Call<JobResponse> getOwnerJob(@Path("user_id") String user_id, @Query("search") String search);

    @GET("job/maid/{user_id}")
    Call<JobResponse> getUserJobApplied(@Path("user_id") String user_id);
    @GET("job/maid/{user_id}")
    Call<JobResponse> getUserJobApplied(@Path("user_id") String user_id, @Query("search") String search);

    @GET("job")
    Call<JobResponse> getJob();
    @GET("job")
    Call<JobResponse> getJob(@Query("search") String search);
    @GET("job/{id}")
    Call<JobResponse> getJobDetail(@Path("id") String id);

    @DELETE("job/{user_id}")
    Call<GlobalResponse> deleteJob(@Path("user_id") String user_id);

    @Multipart
    @POST("job")
    Call<GlobalResponse> createJob(@Part("user_id") int userId,
                                   @Part("name") RequestBody name,
                                   @Part("description") RequestBody description,
                                   @Part("accommodation") RequestBody accommodation,
                                   @Part("working_days") RequestBody working_days,
                                   @Part("working_hours") RequestBody working_hours,
                                   @Part MultipartBody.Part image,
                                   @Part("salary") int salary,
                                   @Part("address") RequestBody address,
                                   @Part("location") RequestBody location,
                                   @Part("recomended_age") int recomendedAge);

    @POST("job/{id}/parameter")
    Call<GlobalResponse> jobParameter(@Body JobParameterRequest jobParameterRequest, @Path("id") String id);

    @POST("job/{id}/skills")
    Call<GlobalResponse> jobSkills(@Body AddSkillRequest jobSkillRequest, @Path("id") String id);

    @POST("job/{id}/applicant")
    Call<GlobalResponse> jobApplicant(@Body JobApplicantRequest jobApplicantRequest, @Path("id") String id);

    @POST("job/{id}/applicant/recruit")
    Call<GlobalResponse> jobApplicantRecruit(@Body JobApplicantRecruitRequest jobApplicantRecruitRequest, @Path("id") String id);

    @GET("job/applicant/{user_id}")
    Call<ApplicantWPResponse> recentJobApplicant(@Path("user_id") String id);
    @GET("job/{id}/applicant/wp")
    Call<ApplicantWPResponse> jobApplicantWP(@Path("id") String user_id, @Query("search") String search);
    @GET("job/{id}/applicant/wp")
    Call<ApplicantWPResponse> jobApplicantWP(@Path("id") String user_id);
}
