package es.verdnatura.domain

import android.content.Context
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
import retrofit2.Call

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

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

    fun itemShelvingMake(
        usuario: String,
        password: String,
        shelving: String,
        item: String,
        quantity: String,
        packing: String,
        warehouse: String,
        grouping:String
    ): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(shelving)
        params.add(item)
        params.add(quantity)
        params.add(packing)
        params.add(warehouse)
        params.add(grouping)
        return restClient!!.itemShelvingMake(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }

    fun itemShelvingMakeEdit(
        usuario: String,
        password: String,
        shelving: String,
        item: String,
        deep: String,
        quantity: String,
        packing: String,
        warehouse: String,
        level: String,
        itemShelvingFk: String,
        grouping:String

    ): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(shelving)
        params.add(item)
        params.add(deep)
        params.add(quantity)
        params.add(packing)
        params.add(warehouse)
        params.add(level)
        params.add(itemShelvingFk)
        params.add(grouping)
        return restClient!!.itemShelvingMakeEdit(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }

    fun itemShelvingMake_multi(
        usuario: String,
        password: String,
        shelving: String,
        items: List<String>,
        warehouse: String
    ): Call<Any> {
        val params: ArrayList<Any> = ArrayList()
        params.add(shelving)
        params.add(items)
        params.add(warehouse)
        return restClient!!.itemShelvingMake_multi(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }

    fun shelvingPriorityUpdate(
        usuario: String,
        password: String,
        priority: String,
        shelving: String
    ): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(priority)
        params.add(shelving)
        return restClient!!.shelvingPriorityUpdate(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }

    fun shelvingPark(
        usuario: String,
        password: String,
        shelving: String,
        parking: String
    ): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(shelving)
        params.add(parking)
        return restClient!!.shelvingPark("json", "1", usuario, password, "application/json", params)
    }

  /*  fun saleParking_add(
        usuario: String,
        password: String,
        sales:List<String>,
        parking: String
    ): Call<String> {
        val params: ArrayList<Any> = ArrayList()
        params.add(sales)
        params.add(parking)
        return restClient!!.saleParking_add("json", "1", usuario, password, "application/json", params)
    }*/

    fun shelvingChange(
        usuario: String,
        password: String,
        origen: String,
        destino: String
    ): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(origen)
        params.add(destino)
        return restClient!!.shelvingChange(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }

    fun itemShelving_return(
        usuario: String,
        password: String,
        shelvingFk: String

    ): Call<ArrayList<Reubication>> {
        val params: ArrayList<String> = ArrayList()
        params.add(shelvingFk)

        return restClient!!.itemShelving_return(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }


    fun clearShelvingList(usuario: String, password: String, shelvingFk: String): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(shelvingFk)
        return restClient!!.clearShelvingList(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }

    fun itemShelvingTransfer(
        usuario: String,
        password: String,
        itemFk: String,
        shelvingFk: String
    ): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(itemFk)
        params.add(shelvingFk)
        return restClient!!.itemShelvingTransfer(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }
    fun itemShelving_merge(
        usuario: String,
        password: String,
        vShelf: String,
        vShelvingFk: String,
    ): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(vShelf)
        params.add(vShelvingFk)
        return restClient!!.itemShelving_merge(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }
    fun itemShelvingDelete(usuario: String, password: String, itemFk: String): Call<Any> {
        val params: ArrayList<String> = ArrayList()
        params.add(itemFk)
        return restClient!!.itemShelvingDelete(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )
    }
}


