package es.verdnatura.domain


import android.content.Context
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeWorkerType
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
import retrofit2.Call

class GetWokerMistakeUSerCase(context: Context) : RestClient(context) {



    fun collectionGet(usuario: String, password: String): Call<List<CollectionVO>> {
        // val params:ArrayList<String> = ArrayList()
        return restClient!!.collectionGet("json", "1", usuario, password, "application/json")
    }
    fun collectionGetSalix(token:String): Call<List<CollectionVO>> {
        // val params:ArrayList<String> = ArrayList()
        return salixClient!!.getCollectionSalix(content_type = "application/json",token)
    }


    fun workerMistake_Add(
        usuario: String,
        password: String,
        vUserFk: String,
        vTypeFk: String
    ): Call<Unit> {
        val params: ArrayList<String> = ArrayList()
        params.add(vUserFk)
        params.add(vTypeFk)
        return restClient!!.workerMistake_Add(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }

    fun workerMistakeType_get(usuario: String, password: String): Call<List<MistakeWorkerType>> {
        return restClient!!.workerMistakeType_get("json", "1", usuario, password, "application/json")
    }

    fun department_getHasMistake(usuario: String, password: String): Call<List<DepartmentMistake>> {
        return restClient!!.department_getHasMistake("json", "1", usuario, password, "application/json")
    }
    fun department_getHasMistakeSalix(token:String): Call<List<DepartmentMistake>> {
        return salixClient!!.department_getHasMistake(content_type = "application/json", authorization = token)
    }


    fun worker_getFromHasMistake(usuario: String, password: String, department:String): Call<List<WorkerFromMistake>> {
        val params: ArrayList<String> = ArrayList()
        params.add(department)
        return restClient!!.worker_getFromHasMistake("json", "1", usuario, password, "application/json",params)
    }
}

