package es.verdnatura.domain

import android.content.Context
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import retrofit2.Call

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


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

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

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

    fun sectorCollection_new(
        usuario: String,
        password: String,
        sectorFk: String

    ): Call<Unit> {
        val params: ArrayList<String> = ArrayList()
        params.add(sectorFk)
        return restClient!!.sectorCollection_new(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )

    }

    fun sectorCollectionSaleGroup_add(
        usuario: String,
        password: String,
        vSaleGroupFk: String,
        vSectorCollectionFk: String

    ): Call<Unit> {
        val params: ArrayList<String> = ArrayList()
        params.add(vSaleGroupFk)
        params.add(vSectorCollectionFk)
        return restClient!!.sectorCollectionSaleGroup_add(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )

    }

    fun saleTracking_addPrevOK(
        usuario: String,
        password: String,
        vSectorCollectionFk: String

    ): Call<Unit> {
        val params: ArrayList<String> = ArrayList()
        params.add(vSectorCollectionFk)
        return restClient!!.saleTracking_addPrevOK(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )

    }

    fun saleTracking_updateIsChecked(
        usuario: String,
        password: String,
        vSaleFk: String,
        vIsChecked: String

    ): Call<Unit> {
        val params: ArrayList<String> = ArrayList()
        params.add(vSaleFk)
        params.add(vIsChecked)
        return restClient!!.saleTracking_updateIsChecked(
            "json",
            "1",
            usuario,
            password,
            "application/json",
            params
        )

    }


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

    fun sectorCollection_getSale(
        usuario: String,
        password: String,
        sectorCollectionFK: String,
        vSectorFk: String

    ): Call<List<PreSacadorItemVO>> {
        val params: ArrayList<String> = ArrayList()
        params.add(sectorCollectionFK)
        params.add(vSectorFk)

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

}

