package es.verdnatura.domain

import com.google.gson.JsonObject
import es.verdnatura.presentation.common.ExpeditionPrintOut
import es.verdnatura.presentation.common.ItemBarCodeSalix
import es.verdnatura.presentation.common.PackingSiteSalix
import es.verdnatura.presentation.common.SaleTrackingSalix
import es.verdnatura.presentation.common.TicketState
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.Train
import es.verdnatura.presentation.view.feature.articulo.model.AddressLoses
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
import es.verdnatura.presentation.view.feature.articulo.model.ItemDetails
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.model.DeviceId
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
import es.verdnatura.presentation.view.feature.delivery.model.DeliveryInfo
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
import es.verdnatura.presentation.view.feature.delivery.model.TicketObservation
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalix
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
import es.verdnatura.presentation.view.feature.login.model.AccessConfigSalix
import es.verdnatura.presentation.view.feature.login.model.DataUserSalix
import es.verdnatura.presentation.view.feature.login.model.LoginApp
import es.verdnatura.presentation.view.feature.login.model.LoginAppData
import es.verdnatura.presentation.view.feature.login.model.LoginDevice
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
import es.verdnatura.presentation.view.feature.login.model.NameWorker
import es.verdnatura.presentation.view.feature.login.model.OperatorAdd
import es.verdnatura.presentation.view.feature.login.model.OperatorSalix
import es.verdnatura.presentation.view.feature.login.model.RenewToken
import es.verdnatura.presentation.view.feature.login.model.VersionApp
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
import es.verdnatura.presentation.view.feature.packaging.model.NotificationQueue
import es.verdnatura.presentation.view.feature.packaging.model.ObervationEntry
import es.verdnatura.presentation.view.feature.packaging.model.Supplier
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckSalix
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
import es.verdnatura.presentation.view.feature.pasillero.model.WorkerActionSalix
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.roadmap.model.RoadMapTruck
import es.verdnatura.presentation.view.feature.roadmap.model.RoadStopMapTruck
import es.verdnatura.presentation.view.feature.roadmap.model.StopMapTruckPallet
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
import es.verdnatura.presentation.view.feature.sacador.model.TicketStateSalix
import es.verdnatura.presentation.view.feature.ubicador.model.ItemBuy
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewer
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
import es.verdnatura.presentation.view.feature.workermistake.model.ExpeditionMistakeSalix
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
import es.verdnatura.presentation.view.feature.workermistake.model.SaleTrackingDelSalix
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerMistakeSalix
import okhttp3.MultipartBody
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Part
import retrofit2.http.Path
import retrofit2.http.Query
import retrofit2.http.QueryMap

interface SalixService {

    @POST("Accounts/login")
    fun login(
        @Body params: LoginSalixVO
    ): Call<LoginSalixVO>

    @POST("VnUsers/validate-auth")
    fun validateAuth(
        @Query("user") user: Any, @Query("password") password: Any, @Query("code") code: Any
    ): Call<LoginSalixVO>

    @POST("Devices/handleUser")
    fun handleUser(
        @Body params: LoginApp
    ): Call<LoginAppData>

    @GET("VnUsers/getCurrentUserData")
    fun getCurrentUserData(
    ): Call<DataUserSalix>

    @GET("collections/getSectors")
    fun getSectorsSalix(
    ): Call<List<SectorItemVO>>

    @GET("sectors")
    fun getSectors(
        @Query("filter") filter: String
    ): Call<List<SectorItemVO>>

    @GET("deviceProductions")
    fun getSerialNumber(
        @Query("filter") filter: String
    ): Call<List<JsonObject>>

    @GET("collections/getCollection")
    fun getCollectionSalix(
    ): Call<List<CollectionVO>>

    /*@GET("AddressShortages")
    fun getAddressSalix(
        @Query("filter") filter: String
    ): Call<List<AddressLoses>>*/

    @GET("AddressWastes")
    fun getAddress(
        @Query("filter") filter: String
    ): Call<List<AddressLoses>>

    @GET("Buyers")
    fun getBuyers(
        @Query("filter") filter: String
    ): Call<List<BuyerVO>>

    @GET("Tickets/myLastModified")
    fun myLastModified(
        @Query("filter") filter: String
    ): Call<List<TicketStateSalix>>

    @POST("Applications/{routine}/execute-func")
    fun executeFunc(
        @Path("routine") routine: String,
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any? = null
    ): Call<Any>

    @POST("Applications/expedition_checkRoute/execute-func")
    fun expeditionCheckRoute(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Int>

    @GET("ExpeditionStates/filter")
    fun getExpeditionStates(
        @Query("filter") filter: Any,
    ): Call<List<ExpeditionInfoLog>>

    @GET("Expeditions")
    fun getRoutesFromExpedition(
        @Query("filter") filter: Any,
    ): Call<List<RouteDelivery>>

    @GET("Routes/getTickets")
    fun getTickets(
        @Query("filter") filter: Any,
    ): Call<MutableList<ClientTicketSalix>>

    @GET("Routes/getByWorker")
    fun getRoutes(
    ): Call<MutableList<RouteInfo>>

    @GET("Workers/findOne")
    fun getNameWorker(
        @Query("filter") filter: String
    ): Call<NameWorker>

    @POST("Applications/{routine}/execute-proc")
    fun executeProc(
        @Path("routine") routine: String,
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any? = null
    ): Call<Any>

    @POST("Applications/collection_setState/execute-proc")
    fun collectionSetState(
        @Query("schema") schema: String = "vn", @Query("params") params: Any? = null
    ): Call<Any?>

    @POST("Applications/itemShelvingSale_setQuantity/execute-proc")
    fun itemShelvingSaleSetquantitySalix(
        @Query("schema") schema: String = "vn", @Query("params") params: Any? = null
    ): Call<Any>

    @POST("Applications/itemShelvingSale_addBySectorCollection/execute-proc")
    fun getReserveBySectorCollection(
        @Query("schema") schema: String = "vn", @Query("params") params: Any? = null
    ): Call<Any>

    @POST("Applications/itemShelvingSale_addBySaleGroup/execute-proc")
    fun getReserveBySaleGroup(
        @Query("schema") schema: String = "vn", @Query("params") params: Any? = null
    ): Call<Any>

    @POST("Applications/collection_addWithReservation/execute-proc")
    fun collectionAddWithReservation(
        @Query("schema") schema: String = "vn", @Query("params") params: Any? = null
    ): Call<Any>

    @POST("Applications/collection_get/execute-proc")
    fun collectionGet(
        @Query("schema") schema: String = "vn", @Query("params") params: Any? = null
    ): Call<CollectionVO>

    @GET("Routes/getExpeditionSummary")
    fun routeGetExpeditionSummary(
        @Query("routeFk") params: Int,
    ): Call<List<ExpeditionInfoSummary>>

    @POST("Applications/addNoteFromDelivery/execute-proc")
    fun addNote(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("TicketObservations")
    fun addNoteFromDropOff(
        @Body params: Any
    ): Call<Any>

    @GET("TicketObservations")
    fun getTicketObservations(
        @Query("filter") filter: String,
    ): Call<List<TicketObservation>>

    @POST("TicketObservations/upsertWithWhere")
    fun updateNoteFromDropOff(
        @Query("where") where: Any? = null, @Body params: Any
    ): Call<Any>

    @POST("TicketObservations/addDropOff")
    fun addFropOff(
        @Query("ticketFk") ticketFk: Long,
        @Query("note") note: String,
    ): Call<Any>

    @POST("Applications/item_getBalance/execute-proc")
    fun itemGetBalance(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<ItemHistoricoVO>>

    @POST("workerActivities/add")
    fun workerActivityAdd(
        @Body workerActionSalix: WorkerActionSalix
    ): Call<Any>

    @POST("Applications/cmrPallet_add/execute-proc")
    fun cmrPalletAdd(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Unit>

    @POST("Applications/expeditionScan_Put/execute-proc")
    fun expeditionScanPut(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/expeditionScan_List/execute-proc")
    fun expeditionScanList(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<ItemExpeditionScanVO>>

    @POST("Applications/expeditionScan_Add/execute-proc")
    fun expeditionScanAdd(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<ItemScanVO>>

    @POST("Applications/expeditionPallet_View/execute-proc")
    fun expeditionPalletView(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<ItemPalletViewVO>>

    @POST("Applications/expeditionPallet_List/execute-proc")
    fun expeditionPalletList(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<ItemPalletVO>>

    @POST("Applications/expeditionPallet_printLabel/execute-proc")
    fun expeditionPalletPrintLabel(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/expeditionLoading_add/execute-proc")
    fun expeditionLoadingAdd(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<Map<String, Any>>>

    @POST("Applications/expeditionState_addByPallet/execute-proc")
    fun expeditionStateAddByPallet(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Unit>

    @GET("ExpeditionPallets/getPallet")
    fun expeditionPalletGetPallet(
        @Query("expeditionFk") expeditionFk: Number,
    ): Call<ItemExpeditionTruckVO>

    @GET("ExpeditionPallets")
    fun expeditionPalletGet(
        @Query("filter") filter: Any?,
    ): Call<List<ItemExpeditionTruckSalix>>

    @GET("Printers")
    fun getprinters(
        @Query("filter") filter: Any?
    ): Call<MutableList<Printers>>

    @GET("Collections/getSales")
    fun getSalesFromTicketOrCollection(
        @Query("collectionOrTicketFk") collectionOrTicketFk: Number,
        @Query("print") print: Boolean,
        @Query("source") source: String,

        ): Call<CollectionVO>

    @GET("Expedition_printOuts/findOne")
    fun isBoxPickingInPrintOut(
        @Query("filter") filter: String,
    ): Call<ExpeditionPrintOut>

    @PATCH("Expedition_printOuts/{id}")
    fun update(
        @Path("id") id: Number, @Body expeditionPrintOut: ExpeditionPrintOut
    ): Call<ExpeditionPrintOut>

    @GET("TicketCollections/hasUncheckedTicket")
    fun hasUncheckedTicket(
        @Query("ticketFk") ticketFk: Number,

        ): Call<String>

    @POST("SaleTrackings/setPicked")
    fun saleTrackingMark(
        @Body saleTRackingSalix: SaleTrackingSalix
    ): Call<Any>

    @GET("Sales/getFromSectorCollection")
    fun sectorCollectionGetSale(
        @Query("sectorFk") sectorFk: Int,
        @Query("sectorCollectionFk") sectorCollectionFk: Int,
    ): Call<List<PreSacadorItemVO>>

    @POST("Tickets/addSaleByCode")
    fun addSaleByCode(
        @Body params: Any
    ): Call<Any>

    @POST("Tickets/{id}/addSale")
    fun addSale(
        @Path("id") id: Number,
        @Query("quantity") quantity: Number,
        @Query("barcode") barcode: String
    ): Call<Any>

    @POST("Collections/assign")
    fun collectionAssign(
    ): Call<Int>

    @POST("Collections/assignCollection")
    fun collectionAssigned(
    ): Call<Int>

    @POST("ItemShelvings/updateFromSale")
    fun itemShelvingUpdateFromSale(
        @Body params: Any
    ): Call<Any>

    @POST("SaleTrackings/delete")
    fun saleTrackingDel(
        @Body params: SaleTrackingDelSalix
    ): Call<Any>

    @POST("Shelvings/addLog")
    fun shelvingLogAdd(
        @Body params: Any
    ): Call<Any>

    @POST("ItemShelvings/upsertItem")
    fun upsertItem(
        @Body params: Any
    ): Call<Any>

    @POST("MachineWorkers/updateInTime")
    fun machineWorkerUpdateInTime(
        @Body params: Any
    ): Call<Any>

    @POST("MachineWorkers/add")
    fun machineWorkerAdd(
        @Query("plate") plate: Any
    ): Call<Any>

    @POST("SaleTrackings/updateTracking")
    fun saleTrackingUpdate(
        @Body params: Any
    ): Call<Any>

    @GET("ItemShelvings/return")
    fun itemShelvingReturn(
        @Query("shelvingFk") shelvingFk: String
    ): Call<ArrayList<Reubication>>

    @GET("ItemShelvings/getAlternative")
    fun itemShelvingAlternative(
        @Query("shelvingFk") shelvingFk: String
    ): Call<ArrayList<Reubication>>

    @GET("MobileAppVersionControls/getVersion")
    fun getVersion(
        @Query("app") app: String
    ): Call<VersionApp>

    @GET("Items/get")
    fun getCard(
        @Query("barcode") barcode: Number, @Query("warehouseFk") warehouseFk: Int
    ): Call<ItemCardVO>

    @POST("Applications/itemPlacementSupplyAiming/execute-proc")
    fun itemPlacementSupplyAiming(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<PlacementSupplyVO>>

    @POST("Applications/machineWorker_getHistorical/execute-proc")
    fun machineWorkerGetHistorical(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<ItemHistoricoVehiculo>>

    @POST("Applications/expedition_getFromRoute/execute-proc")
    fun expeditionGetFromRoute(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<ExpeditionInfoLoadUnload>>

    @POST("Applications/company_getFiscaldata/execute-proc")
    fun companyGetFiscaldata(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<DeliveryInfo>>

    @POST("Applications/freelance_getInfo/execute-proc")
    fun freelanceGetInfo(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<DeliveryInfo>>

    @POST("Applications/travel_updatePacking/execute-proc")
    fun travelUpdatePacking(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/saleTracking_updateIsChecked/execute-proc")
    fun saleTrackingUpdateIsChecked(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/saleTracking_addPreparedSaleGroup/execute-proc")
    fun saleTrackingAddPreparedSaleGroup(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Unit>

    @POST("Applications/itemShelvingSale_setPicked/execute-proc")
    fun itemShelvingSaleSetSaleGroup(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Unit>

    @POST("Applications/itemShelvingSale_unpicked/execute-proc")
    fun itemShelvingSaleUnpicked(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Unit>

    @POST("Applications/setParking/execute-proc")
    fun setParking(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @GET("ItemShelvings/getListItemNewer")
    fun getListItemNewer(
        @Query("shelvingFk") shelvingFkIn: Any, @Query("parking") parking: Any? = null
    ): Call<List<ItemShelvingNewer>>

    @POST("Applications/sectorCollectionSaleGroup_add/execute-proc")
    fun sectorCollectionSaleGroupAdd(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/saleTracking_addPrevOK/execute-proc")
    fun saleTrackingAddPrevOK(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/machine_getWorkerPlate/execute-proc")
    fun machineGetWorkerPlate(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<JsonObject>>

    @POST("Applications/sectorCollection_get/execute-proc")
    fun sectorCollectionGet(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<CollectionVO>>

    @POST("Applications/sectorCollection_getMyPartial/execute-proc")
    fun sectorCollectionGetPartial(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<CollectionVO>>

    @POST("Applications/sectorCollection_hasSalesReserved/execute-func")
    fun hasSalesReserved(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<String>

    @POST("Applications/worker_getFromHasMistake/execute-proc")
    fun workerGetFromHasMistake(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<List<WorkerFromMistake>>

    @POST("Applications/sectorCollection_new/execute-proc")
    fun sectorCollectionNew(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/ticketStateToday_setState/execute-proc")
    fun ticketStateTodaySetState(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Unit>

    @POST("Applications/ticket_isOutClosureZone/execute-func")
    fun ticketIsOutClosureZone(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any?>

    @GET("TicketStates")
    fun ticketState(
        @Query("filter") filter: Any, @Query("schema") schema: String = "vn"
    ): Call<List<TicketState>>

    @POST("Applications/workerMachinery_isRegistered/execute-func")
    fun workerMachineryIsRegistered(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<String>

    @POST("Applications/ticket_printLabelPrevious/execute-proc")
    fun ticketPrintLabelPrevious(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/deviceProductionUser_getWorker/execute-proc")
    fun deviceProductionUserGetWorker(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<List<JsonObject>>

    @POST("Applications/device_checkLogin/execute-proc")
    fun deviceCheckLogin(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<List<LoginDevice>>

    @POST("Applications/collection_printSticker/execute-proc")
    fun collectionStickerPrint(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/itemShelving_add/execute-proc")
    fun itemShelvingAdd(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/itemShelvingSale_Add/execute-proc")
    fun itemShelvingSaleAdd(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/itemShelving_selfConsumption/execute-proc")
    fun itemShelvingSelfConsumption(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/itemShelving_addList/execute-proc")
    fun itemShelvingAddList(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/itemShelving_transfer/execute-proc")
    fun itemShelvingTransfer(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Any>

    @POST("Applications/itemShelving_addByClaim/execute-proc")
    fun itemShelvingAddByClaim(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<Unit>

    @POST("Applications/itemShelving_filterBuyer/execute-proc")
    fun itemShelvingFilterBuyer(
        @Query("params") params: Any, @Query("schema") schema: String = "vn"
    ): Call<List<ItemInventaryVO>>

    @POST("Applications/itemShelving_getSaleDate/execute-proc")
    fun itemShelvingGetSaleDate(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): Call<List<ItemShelvingSaleDate>>

    @POST("Applications/itemShelving_add/execute-proc")
    fun itemShelvingMake(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): Call<Any>

    @GET("ItemShelvingLogs")
    fun itemShelvingLogGet(
        @Query("filter") filter: String,
    ): Call<List<ItemShelvingLog>>

    @POST("Applications/itemshelving_getInfo/execute-proc")
    fun itemshelvingGetInfo(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): Call<List<ItemLocationVO>>

    @POST("Applications/itemShelving_get/execute-proc")
    fun itemShelvingList(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): Call<List<ItemUbicadorVO>>

    @POST("Applications/itemShelving_get/execute-proc")
    fun itemShelvingListNew(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): Call<List<ItemUbicador>>

    @POST("Applications/expedition_scan/execute-proc")
    fun expeditionScan(
        @Query("schema") schema: String = "srt",
        @Query("params") params: Any,
    ): Call<Unit>

    @POST("Applications/item_devalueA2/execute-proc")
    fun itemDevalueA2(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): Call<Unit>

    @POST("Applications/itemShelving_getItemDetails/execute-proc")
    fun itemShelvingGetItemDetails(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): Call<List<ItemDetails>>

    @POST("Applications/expedition_getState/execute-proc")
    fun expeditionGetState(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): Call<ArrayList<JsonObject>>

    @POST("Applications/item_getSimilar/execute-proc")
    fun getItemSimilar(
        @Query("schema") schema: String = "vn", @Query("params") params: Any
    ): Call<List<ItemProposal>>

    @POST("Applications/buy_updatePacking/execute-proc")
    fun updatePacking(
        @Query("schema") schema: String = "vn", @Query("params") params: Any
    ): Call<Any>

    @POST("Applications/buy_updateGrouping/execute-proc")
    fun updateGrouping(
        @Query("schema") schema: String = "vn", @Query("params") params: Any
    ): Call<Any>

    @POST("Applications/buffer_setTypeByName/execute-proc")
    fun bufferSetTypeByName(
        @Query("schema") schema: String = "srt", @Query("params") params: Any
    ): Call<List<JsonObject>>

    @GET("collections/getCollection")
    fun getCollectionSalixLocal(
    ): Call<List<CollectionTicket>>

    @POST("routes/{id}/driver-route-email")
    fun driverRouteEmail(
        @Path("id") id: Number, @Body params: Any
    ): Call<Any>

    @POST("collections/{id}/getTickets")
    fun getCollectionTickets(
        @Path("id") id: Number, @Body params: Any
    ): Call<CollectionTicket>

    @POST("collections/setSaleQuantity")
    fun collectionIncreaseQuantitySalix(
        @Body params: SalixSaleQuantity
    ): Call<Any>

    @Multipart
    @POST("EntryDms/{id}/uploadFile")
    fun uploadEntryPhoto(
        @Path("id") id: Number,
        @Query("warehouseId") warehouseId: Number,
        @Query("companyId") companyId: Number,
        @Query("dmsTypeId") dmsTypeId: Number,
        @Query("reference") reference: String,
        @Query("description") description: String,
        @Query("hasFile") hasFile: Boolean,
        @Part file: MultipartBody.Part,
    ): Call<Any>

    @Multipart
    @POST("dms/uploadFile")
    fun imageUpload(
        @Query("warehouseId") warehouseId: Number,
        @Query("companyId") companyId: Number,
        @Query("dmsTypeId") dmsTypeId: Number,
        @Query("reference") reference: String,
        @Query("description") description: String,
        @Query("hasFile") hasFile: Boolean,
        @Part file: MultipartBody.Part,
    ): Call<Any>

    @Multipart
    @POST("/api/Tickets/saveSign")
    fun saveSign(
        @Part file: MultipartBody.Part?, @QueryMap(encoded = true) queryMap: Map<String?, String?>
    ): Call<Any>

    @POST("Entries/{id}/addFromBuy")
    fun addFromBuy(
        @Path("id") id: Number,
        @Query("item") item: Number,
        @Query("printedStickers") printedStickers: Number
    ): Call<EntrySalix>

    @GET("Departments")
    fun departmentGetHasMistake(
        @Query("filter") filter: String = """{"fields": {"id": true,"name": true},"where": {"hasToMistake": true}}"""
    ): Call<List<DepartmentMistake>>

    @DELETE("ExpeditionPallets/{id}")
    fun expeditionPalletDel(
        @Path("id") id: Number
    ): Call<Any>

    @DELETE("ExpeditionScans/{id}")
    fun expeditionScanDel(
        @Path("id") id: Number
    ): Call<Any>

    @DELETE("ItemShelvings/{id}")
    fun itemShelvingsDelete(
        @Path("id") id: Number
    ): Call<Any>

    @PATCH("Items/{itemFk}")
    fun updateItem(
        @Path("itemFk") itemFk: Int, @Body params: Any
    ): Call<Any>

    @POST("Items/setVisibleDiscard")
    fun setVisibleDiscard(
        @Body params: Any
    ): Call<Any>

    @POST("Shelvings/upsertWithWhere")
    fun updateShelvingPriority(
        @Query("where") where: Any, @Body params: Any
    ): Call<Any>

    //DE MOMENTO NO FUNCIONA, SE QUERÍA AÑADIR POR INSERTIGNORE
    @POST("Operators")
    fun operatorAdd(
        @Body params: OperatorAdd
    ): Call<Any>

    @POST("DeviceLogs")
    fun deviceLogInsert(
        @Body params: Any
    ): Call<Unit>

    @POST("RoadMapStops")
    fun roadMapStopAdd(
        @Body params: Any
    ): Call<Any>

    @GET("ItemPackingTypes")
    fun getItemPackingType(
        @Query("filter") filter: String = """{"where": {"isActive": true}}"""
    ): Call<List<ItemPackingType>>

    @GET("RoadmapStops")
    fun roadMapStopGet(
        @Query("filter") filter: String
    ): Call<List<ItemExpeditionTruckVO>>

    @GET("RoadMaps")
    fun roadmapTruckGet(
        @Query("filter") filter: String
    ): Call<List<RoadMapTruck>>

    @PATCH("RoadMaps/{id}")
    fun roadMapUpdate(
        @Path("id") id: Number, @Body params: Any
    ): Call<Any>

    @GET("RoadmapStops")
    fun getStopMapTruckList(
        @Query("filter") filter: String
    ): Call<List<RoadStopMapTruck>>

    @POST("Applications/expeditionPallet_List/execute-proc")
    fun getStopMapTruckPalletList(
        @Query("params") params: Any? = null, @Query("schema") schema: String = "vn"
    ): Call<List<StopMapTruckPallet>>

    @GET("RoadmapStops/getPalletMatchState")
    fun getPalletMatchState(
        @Query("truckFk") roadMapStopFk: Int, @Query("state") state: String
    ): Call<List<StopMapTruckPallet>>

    @POST("PackingSiteAdvanceds")
    fun ticketAdvancePackaging(
        @Body parms: PackingSiteSalix
    ): Call<Unit>

    @PUT("ItemBarCodes")
    fun barcodesEdit(
        @Body params: ItemBarCodeSalix
    ): Call<Any>

    @DELETE("ItemBarcodes/delete")
    fun barcodesDelete(
        @Query("barcode") barcode: String,
        @Query("itemFk") itemFk: Int,
    ): Call<Any>

    @GET("ItemBarCodes/{barCodeValue}/toItem")
    fun barcodesToItem(
        @Path("barCodeValue") barCodeValue: String
    ): Call<Int?>

    @GET("Suppliers")
    fun getSuppliers(
        @Query("filter") filter: String = """{"fields":{"id":true,"name":true},"order":"name ASC","where":{"isActive":1,"name":{"neq":null}}, "include":[{"relation":"contacts","scope":{"fields":["email"],"where":{"email":{"neq":null}}}}]}"""

    ): Call<List<Supplier>>

    @GET("Entries")
    fun getEntriesFromSupplier(
        @Query("filter") filter: String
    ): Call<List<EntrySalix>>

    @PATCH("Entries/{entryId}")
    fun entryUpdateObserv(
        @Path("entryId") entryId: Int, @Body entry: ObervationEntry
    ): Call<EntrySalix>

    @GET("Shelvings")
    fun shelvingsGet(
        @Query("filter") filter: String
    ): Call<List<ShelvingLogSalix>>

    @GET("Parkings")
    fun getParkings(
        @Query("filter") filter: String
    ): Call<List<JsonObject>>

    @GET("DeviceProductions")
    fun deviceProductionsGetName(
        @Query("filter") filter: String
    ): Call<List<DeviceId>>

    @GET("Suppliers/{supplierId}/getItemsPackaging")
    fun getItemsPackaging(
        @Path("supplierId") supplierId: Int, @Query("entry") entry: Int

    ): Call<List<ItemSupplier>>

    @POST("Entries/addFromPackaging")
    fun addFromPackaging(
        @Query("supplier") supplier: Number, @Query("isTravelReception") isTravelReception: Boolean

    ): Call<EntrySalix>

    @POST("notificationQueues")
    fun notificationQueues(
        @Body notificationQueue: NotificationQueue
    ): Call<Void>

    @POST("Images/upload")
    @Multipart
    fun uploadImage(
        @Query("collection") collection: String,
        @Query("id") id: Number,
        @Part filePart: MultipartBody.Part,
    ): Call<Any>

    @PATCH("Operators/{id}")
    fun updateOperator(
        @Path("id") id: Number, @Body params: Any
    ): Call<Unit>

    @GET("Operators/{id}")
    fun operatorGetData(
        @Path("id") id: Number, @Query("filter") filter: String
    ): Call<OperatorSalix>

    @GET("AccessTokenConfigs")
    fun getAccessTokenConfigs(
    ): Call<List<AccessConfigSalix>>

    @POST("vnusers/renewToken")
    fun renewToken(
    ): Call<RenewToken>

    @PATCH("ItemShelvings/{id}")
    fun itemShelvingUpdate(
        @Path("id") id: Number, @Body params: Any
    ): Call<ItemUbicador?>

    @GET("Buys/{id}")
    fun getInfoFromBuyId(
        @Path("id") id: Number
    ): Call<ItemBuy>

    @POST("ItemShelvings/update")
    fun itemShelvingsUpdate(
        @Query("where") where: Any, @Body params: Any
    ): Call<Any>

    @POST("TicketCollections/update")
    fun ticketCollectionUpdate(
        @Query("where") filter: Any, @Body params: Any
    ): Call<Unit>

    @GET("TicketCollections")
    fun getCollectionId(
        @Query("filter") filter: Any
    ): Call<List<JsonObject>>

    @POST("ItemShelvingSales/itemShelvingSaleSetQuantity")
    fun itemShelvingSaleSetQuantity(
        @Body params: Any
    ): Call<Any>

    @GET("ItemShelvingSales/{id}/exists")
    fun itemShelvingSaleExists(
        @Path("id") id: Number,
    ): Call<JsonObject>

    @PATCH("ItemShelvingSales/{id}")
    fun itemShelvingsReservedUpdate(
        @Path("id") id: Number, @Body params: Any
    ): Call<Any>

    @POST("ItemShelvingSales/itemShelvingSale_addByCollection")
    fun itemShelvingSaleAddByCollection(
        @Body params: Any,
    ): Call<Any>

    @POST("ItemShelvings/getInventory")
    fun getInventoryParking(
        @Query("parkingFrom") parkingFrom: String, @Query("parkingTo") parkingTo: String
    ): Call<List<ItemInventoryParking>>

    @PATCH("Routes/{id}")
    fun routeUpdate(
        @Path("id") id: Number,
        @Body route: RouteInfo,

        ): Call<Any>

    @GET("ExpeditionMistakeTypes")
    fun getExpeditionMistakeTypes(
    ): Call<List<MistakeType>>

    @POST("ExpeditionMistakes")
    fun expeditionMistakesAdd(
        @Body expeditionMistake: ExpeditionMistakeSalix
    ): Call<Any>

    @POST("ExpeditionStates/addExpeditionState")
    fun addExpeditionState(
        @Body params: Any
    ): Call<Unit>

    @GET("ExpeditionStates/findOne")
    fun findExpedition(
        @Query("filter") filter: String
    ): Call<Any>

    @GET("ExpeditionStateTypes/findOne")
    fun getExpeditionStateTypeId(
        @Query("filter") filter: String
    ): Call<Any>

    @POST("WorkerMistakes")
    fun workerMistakesAdd(
        @Body workerMistake: WorkerMistakeSalix
    ): Call<Any>

    @GET("WorkerMistakeTypes")
    fun workerMistakesTypes(
    ): Call<List<MistakeType>>

    @POST("SaleMistakes")
    fun saleMistakeAdd(
        @Body saleMistakeSalix: SaleMistakeSalix
    ): Call<Any>

    @GET("MistakeTypes")
    fun getMistakeTypes(
    ): Call<List<MistakeTypeVO>>

    @GET("Trains")
    fun getTrain(
    ): Call<List<Train>>

    @PATCH("SaleGroups/{id}")
    fun saleGroupUpdate(
        @Path("id") id: Number,
        @Body params: Any
    ): Call<Any>
}


