package es.verdnatura.presentation.view.feature.transferencia.fragment

import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.GetUbicadorUserCase
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.ResponseItemVO
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response

class TransferenciaViewModel(context: Context) : BaseViewModel() {

    private val getUbicadorUserCase: GetUbicadorUserCase = GetUbicadorUserCase(context)

    private val _response by lazy { MutableLiveData<ResponseItemVO>() }
    val response: LiveData<ResponseItemVO>
        get() = _response

   /* fun itemShelvingTransfer(usuario:String,password:String,itemFk:String,shelvingFk:String){
        getUbicadorUserCase.itemShelvingTransfer(usuario,password,itemFk,shelvingFk).enqueue(object :
            Callback<Any> {
            override fun onFailure(call: Call<Any>, t: Throwable) {
                _response.value = ResponseItemVO(isError = true,errorMessage ="Error en llamada itemShelvingTransfer."+t.message!!)
            }
            override fun onResponse(call: Call<Any>, response: Response<Any>) {
                if (!response.isSuccessul == null){
                    _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelvingTransfer")
                }else{
                    _response.value = ResponseItemVO(isError = false,response = response.message()!!)
                }
            }
        })
    }*/
}
