feat: refs#8082 TicketPickupResponse
This commit is contained in:
parent
103df4e31e
commit
b6115837ae
|
@ -5,8 +5,8 @@ import es.verdnatura.presentation.common.ExpeditionPrintOut
|
|||
import es.verdnatura.presentation.common.ItemBarCodeSalix
|
||||
import es.verdnatura.presentation.common.ItemShelving
|
||||
import es.verdnatura.presentation.common.PackingSiteSalix
|
||||
import es.verdnatura.presentation.common.PickupResponse
|
||||
import es.verdnatura.presentation.common.SaleTrackingSalix
|
||||
import es.verdnatura.presentation.common.TicketPickupResponse
|
||||
import es.verdnatura.presentation.common.TicketState
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
|
@ -638,7 +638,7 @@ interface SalixService {
|
|||
@GET("Tickets")
|
||||
fun ticketIsPickup(
|
||||
@Query("filter") filter: Any, @Query("schema") schema: String = "vn"
|
||||
): Call<List<PickupResponse>>
|
||||
): Call<List<TicketPickupResponse>>
|
||||
|
||||
@POST("Applications/workerMachinery_isRegistered/execute-func")
|
||||
fun workerMachineryIsRegistered(
|
||||
|
|
|
@ -101,14 +101,8 @@ data class ExpeditionPrintOut(
|
|||
val isChecked: Boolean
|
||||
)
|
||||
|
||||
data class PickupResponse(
|
||||
val routeFk: Int,
|
||||
val route: Route?
|
||||
)
|
||||
|
||||
data class Route(
|
||||
data class TicketPickupResponse(
|
||||
val id: Int,
|
||||
val agencyModeFk: Int,
|
||||
val agencyMode: AgencyMode?
|
||||
)
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ import es.verdnatura.presentation.base.BaseViewModel
|
|||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.common.PickupResponse
|
||||
import es.verdnatura.presentation.common.SaleTrackingReplaceSalix
|
||||
import es.verdnatura.presentation.common.TicketPickupResponse
|
||||
import es.verdnatura.presentation.common.TicketState
|
||||
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
|
@ -304,41 +304,37 @@ class CollectionCheckerViewModel(val context: Context) : BaseViewModel(context)
|
|||
fun ticketIsPickup(
|
||||
ticketFk: Number
|
||||
) {
|
||||
|
||||
salix.ticketIsPickup(
|
||||
"""{
|
||||
"where": {
|
||||
"id": $ticketFk
|
||||
},
|
||||
"fields": ["id", "routeFk"],
|
||||
"include": [
|
||||
{
|
||||
"relation": "route",
|
||||
"scope": {
|
||||
"fields": ["id", "agencyModeFk"],
|
||||
"where": {
|
||||
"id": $ticketFk
|
||||
},
|
||||
"fields": ["id", "agencyModeFk"],
|
||||
"include": [
|
||||
{
|
||||
"relation": "agencyMode",
|
||||
"scope": {
|
||||
"fields": ["id", "deliveryMethodFk", "code"],
|
||||
"where": {
|
||||
"code": { "inq": ["REC_ALG", "PICKUP"] }
|
||||
},
|
||||
"include": {
|
||||
"relation": "agencyMode",
|
||||
"scope": {
|
||||
"fields": ["id", "deliveryMethodFk","code"],
|
||||
"where": {"code": "REC_ALG"},
|
||||
"include": {
|
||||
"relation": "deliveryMethod",
|
||||
"scope": {
|
||||
"relation": "deliveryMethod",
|
||||
"scope": {
|
||||
"fields": ["id", "code"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}""".trim()
|
||||
|
||||
).enqueue(object : SalixCallback<List<PickupResponse>>(context) {
|
||||
override fun onSuccess(response: Response<List<PickupResponse>>) {
|
||||
}
|
||||
]
|
||||
}""".trim()
|
||||
).enqueue(object : SalixCallback<List<TicketPickupResponse>>(context) {
|
||||
override fun onSuccess(response: Response<List<TicketPickupResponse>>) {
|
||||
|
||||
_responseTicketIsPickup.value =
|
||||
response.body()
|
||||
?.firstOrNull()?.route?.agencyMode?.deliveryMethod?.code == "PICKUP"
|
||||
?.firstOrNull()?.agencyMode?.deliveryMethod?.code == "PICKUP"
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue