package es.verdnatura.domain

import com.google.gson.JsonObject
import es.verdnatura.presentation.common.ItemBarCodeSalix
import es.verdnatura.presentation.common.TicketState
import es.verdnatura.presentation.common.packingSiteSalix
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.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.collection.SalixSaleQuantity
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
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.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.DataUserSalix
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.OperatorSalix
import es.verdnatura.presentation.view.feature.login.model.RenewToken
import es.verdnatura.presentation.view.feature.login.model.SalixGrupo
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalix
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.Supplier
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
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.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
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.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.WorkerFromMistake
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerMistakeSalix
import okhttp3.MultipartBody
import retrofit2.Call
import retrofit2.http.*

interface SalixService {

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

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

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

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

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

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

    @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<String>

    @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>>

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

    @POST("Applications/itemTrash/execute-proc")
    fun itemTrash(
        @Query("params") params: Any? = null,
        @Query("schema") schema: String = "vn"
    ): 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")//REVISADA
    fun expeditionPalletGetPallet(
        @Query("expeditionFk") expeditionFk: Number,
    ): Call<ItemExpeditionTruckVO>

    @GET("Operators/getPrinter")//NO SALIX
    fun getprinters():
            Call<List<Printers>>
    @GET("Collections/getSalesFromTicketOrCollection")//REVISADA
    fun collectionGetTickets(
        @Query("collectionOrTicketFk") collectionOrTicketFk: Number,
        @Query("sectorFk") sectorFk: Number,
        @Query("printFk") printFk: Number,
        @Query("source") source: String,

    ):
            Call<CollectionVO>

    @POST("almacennew/SaleTrackings/mark")//REVISADA
    fun saleTrackingMark(
        @Body vararg params: Any?
    ):
            Call<Any>
    @GET("Sales/getFromSectorCollection")//NO SALIX
    fun sectorCollectionGetSale(
        @Query("sectorFk") sectorFk: Int,
        @Query("sectorCollectionFk") sectorCollectionFk: Int,
    ):
            Call<List<PreSacadorItemVO>>
    @POST("Collections/addItem")//REVISADA
    fun collectionAddItem(
        @Body params: Any
    ):
            Call<Any>

    @POST("Collections/assignCollection")//NO SALIX
    fun collectionAssign(
    ):
            Call<Int>

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

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

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

    @POST("ItemShelvings/makeMulti")//REVISADA
    fun itemShelvingMakeMulti(
        @Body params: Any
    ):
            Call<Any>

    @POST("MachineWorkers/updateInTime")//REVISADA
    fun machineWorkerUpdateInTime(
        @Query("plate") plate: Any
    ):
            Call<Any>

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

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


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

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

    @GET("Items/card")//NO SALIX
    fun getCard(
        @Query("itemFk") itemFk: 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_setSaleGroup/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>

    @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/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/itemShelvingTransfer/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>

    @POST("Applications/itemShelvingLog_get/execute-proc")
    fun itemShelvingLogGet(
        @Query("schema") schema: String = "vn",
        @Query("params") params: Any,
    ): 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/expedition_scan/execute-proc")
    fun expeditionScan(
        @Query("schema") schema: String = "srt",
        @Query("params") params: Any,
    ): Call<Unit>

    @POST("Applications/expedition_getState/execute-proc")
    fun expedition_getState(
        @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 buffer_setTypeByName(
        @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>

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

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

    @Multipart
    @POST("Entries/{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<Any>

    @POST("tickets/{idTicket}/transferSales") //-->saleMove en Silex
    fun transferSalesSalix(
        @Path("idTicket") idTicket: String, @Body params: listSaleSalix
    ): Call<Any>

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

    @GET("Workers/findOne?")
    fun worker_isF11Allowed(
        @Query("filter") filter: String
    ): Call<JsonObject>

    @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>

    @GET("Workers/{idWorker}/sip")
    fun sip_getExtension(
        @Path("idWorker") idWorker: Int,
    ): Call<Any>

    @PATCH("Items/{itemFk}")
    fun update_ItemPackingType(
        @Path("itemFk") itemFk: String,
        @Body params: Any
    ): 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/add")
    fun operatorAdd(
    ): Call<Any>

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

    @POST("ExpeditionTrucks")
    fun expeditionTrucksInsert(
        @Body params: Any
    ): Call<Any>

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

    @GET("ExpeditionTrucks")
    fun expeditionTruckGet(
        @Query("filter") filter: String
    ): Call<List<ItemExpeditionTruckVO>>

    @POST("PackingSiteAdvanceds")
    fun ticket_advancePackaging(
        @Body parms: packingSiteSalix
    ): Call<Unit>

    @PUT("ItemBarCodes")//REVISADA
    fun barcodes_edit(
        @Body params: ItemBarCodeSalix
    ): Call<Any>

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

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

    @GET("Suppliers")//REVISADA
    fun getSuppliers(
        //@Body params:JSONObject=JSONObject("""filter"={"fields":{"id":true,"name":true},"include":[{"relation":"contacts","scope":{"fields":["email"],"order":"id DESC","limit":1,"where":{"email":{"neq":null}}}}]}""")
        /* @Query("filter") filter:String="{\"fields\":{\"id\":true,\"name\":true},\"include\":[{\"relation\":\"contacts\"," +
                 "\"scope\":{" +
                 "\"fields\":[\"email\"],\"order\":\"id DESC\",\"limit\":1," +
                 "\"where\":{ \"email\":{\"neq\":null } }}}]})"*/

    ): Call<List<Supplier>>

    @PUT("Entries")//REVISADA
    fun Entries(
        @Body entry: EntrySalix
    ): Call<EntrySalix>

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

    @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: Int, @Query("isTravelReception") isTravelReception: Boolean

    ): Call<EntrySalix>

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

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

    @GET("Operators/{id}")
    fun operator_getData(
        @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<Any>

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

    @POST("TicketCollections/update")
    fun ticketCollectionUpdate(
        @Query("where") filter: Any,//revisar si con Any vale, update generalmente pongo json (ejemplo: itemShelvingReset)
        @Body params: Any
    ): Call<Unit>

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

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

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

    @POST("ItemShelvingSales/itemShelvingSale_addBySale")
    fun itemShelvingSale_addBySale(
        @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>

    @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>>
}

interface SalixServiceSend {

    @POST("chats/send")
    fun sendGroup(
        @Body params: SalixGrupo
    ): Call<Boolean>

}

