... | ... | @@ -134,23 +134,22 @@ https://baas.kinvey.com/appdata/{{app-key}}/product |
|
|
}
|
|
|
]
|
|
|
|
|
|
## Assortment
|
|
|
## Available Assortment
|
|
|
|
|
|
### POST
|
|
|
https://baas.kinvey.com/appdata/{{app-key}}/assortment
|
|
|
https://baas.kinvey.com/appdata/{{app-key}}/availableAssortment
|
|
|
|
|
|
#### body
|
|
|
|
|
|
{
|
|
|
"id_producer" : "5b0087f9e7944c29fda4658d",
|
|
|
"canceled" : "false",
|
|
|
"available":
|
|
|
[
|
|
|
"products": [
|
|
|
{
|
|
|
"name": "Maçã Vermelha",
|
|
|
"measurement": "kg",
|
|
|
"quantity" : "150",
|
|
|
"price" : "5,5",
|
|
|
"price" : "5.5",
|
|
|
"image": {
|
|
|
"_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/2da6265e-39db-4291-8ba8-530b7cd70892/maca.jpg"
|
|
|
}
|
... | ... | @@ -159,30 +158,32 @@ https://baas.kinvey.com/appdata/{{app-key}}/assortment |
|
|
"name": "Abacate",
|
|
|
"measurement": "un",
|
|
|
"quantity" : "200",
|
|
|
"price" : "10,3",
|
|
|
"price" : "5.5",
|
|
|
"image": {
|
|
|
"_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/403097ff-78f2-4463-9ca0-0251e3f78fa3/abacate.jpg"
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
|
|
|
### GET AVAILABLE
|
|
|
https://baas.kinvey.com/appdata/{{app-key}}/assortment?query={"id_producer":"{{idusuario}}"}&fields=available,canceled
|
|
|
### GET
|
|
|
https://baas.kinvey.com/appdata/{{app-key}}/availableAssortment?query={"id_producer":"idusuario"}
|
|
|
|
|
|
Obs: Os valores {{idusuario}} e {{app-key}} devem ser substituídos pelos dados que se deseja obter na operação.
|
|
|
|
|
|
#### Exemplo de retorno
|
|
|
[
|
|
|
|
|
|
[
|
|
|
{
|
|
|
"_id": "5b049c319720683ab826a1ab",
|
|
|
"_id": "5b131473978f6b254a4e9c79",
|
|
|
"id_producer": "5b0087f9e7944c29fda4658d",
|
|
|
"canceled": "false",
|
|
|
"available": [
|
|
|
"products": [
|
|
|
{
|
|
|
"name": "Maçã Vermelha",
|
|
|
"measurement": "kg",
|
|
|
"quantity": "150",
|
|
|
"price": "5,5",
|
|
|
"price": "5",
|
|
|
"image": {
|
|
|
"_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/2da6265e-39db-4291-8ba8-530b7cd70892/maca.jpg"
|
|
|
}
|
... | ... | @@ -191,7 +192,7 @@ Obs: Os valores {{idusuario}} e {{app-key}} devem ser substituídos pelos dados |
|
|
"name": "Abacate",
|
|
|
"measurement": "un",
|
|
|
"quantity": "200",
|
|
|
"price": "10,3",
|
|
|
"price": "5.5",
|
|
|
"image": {
|
|
|
"_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/403097ff-78f2-4463-9ca0-0251e3f78fa3/abacate.jpg"
|
|
|
}
|
... | ... | @@ -199,10 +200,13 @@ Obs: Os valores {{idusuario}} e {{app-key}} devem ser substituídos pelos dados |
|
|
],
|
|
|
"_acl": {
|
|
|
"creator": "5b0087f9e7944c29fda4658d"
|
|
|
},
|
|
|
"_kmd": {
|
|
|
"lmt": "2018-06-02T22:04:35.967Z",
|
|
|
"ect": "2018-06-02T22:04:35.967Z"
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
|
|
|
]
|
|
|
|
|
|
### GET REQUIRED
|
|
|
https://baas.kinvey.com/appdata/{{app-key}}/assortment?query={"id_producer":"{{id-usuario}}"}&fields=required,canceled
|
... | ... | |