From 2333e3b878963dc6da5b80d6395c561cf24b981b Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Wed, 26 Jun 2024 07:02:22 +0200 Subject: [PATCH] feat itemShelvingLog refs #7168 --- .../main/java/es/verdnatura/domain/SalixService.kt | 6 ++++++ .../fragment/ItemShelvingLogViewModel.kt | 11 +++++++++-- .../historicoshelving/model/ItemShelvingLog.kt | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/es/verdnatura/domain/SalixService.kt b/app/src/main/java/es/verdnatura/domain/SalixService.kt index 61c380d9..992307a5 100644 --- a/app/src/main/java/es/verdnatura/domain/SalixService.kt +++ b/app/src/main/java/es/verdnatura/domain/SalixService.kt @@ -675,6 +675,12 @@ interface SalixService { @Query("params") params: Any, ): Call> + //Tarea 7168 + @GET("Applications/itemShelvingLogs") + fun itemShelvingLogGet( + @Query("filter") filter: String, + ): Call> + @POST("Applications/itemshelving_getInfo/execute-proc") fun itemshelvingGetInfo( @Query("schema") schema: String = "vn", diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt index 79fa4f9d..e1d3b779 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt @@ -17,11 +17,18 @@ class ItemShelvingLogViewModel(val context: Context) : BaseViewModel(context) { val itemShelvingLogList: LiveData get() = _itemShelvingLogList - fun itemShelvingLogGet(vShelvingFK: String, records: Int = LIMITRECORDSSHELVINGLOG) { + fun itemShelvingLogGet(shelvingOrItem: String, records: Int = LIMITRECORDSSHELVINGLOG) { //tarea 7168 //salix.itemShelvingLogGet(params = listOf(vShelvingFK,records).formatWithQuotes()) - salix.itemShelvingLogGet(params = listOf(vShelvingFK).formatWithQuotes()) + salix.itemShelvingLogGet(filter = """ + |{"where":{"or": [ {"shelvingFk": "$shelvingOrItem"}, + |{"itemFk": "$shelvingOrItem"}]}, + |"limit":$records,"order":"created", + |"include": [ { "relation": "worker", "scope": { "fields": ["code"]}}, + |{ "relation": "item", "scope": { "fields": ["longName"]}}]} + |""".trimMargin()) + salix.itemShelvingLogGet(params = listOf(shelvingOrItem).formatWithQuotes()) .enqueue(object : SalixCallback>(context) { override fun onSuccess(response: Response>) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt index e2a1d83a..0e4d79f9 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt @@ -9,6 +9,8 @@ class ItemShelvingLog( var visible: Int? = null, var accion: String? = null, var code: String? = null, + //Tarea 7168 + //Falta crear campos anidados ) { var created: String = "" get() {