Skip to content

Instantly share code, notes, and snippets.

@diegodfsd
Last active October 26, 2018 23:58
Show Gist options
  • Save diegodfsd/c45050af065e89bb44d55a3f1373c6d3 to your computer and use it in GitHub Desktop.
Save diegodfsd/c45050af065e89bb44d55a3f1373c6d3 to your computer and use it in GitHub Desktop.
Exemplos de request para criar rule
{
"name": "Rule four",
"description": "description",
"conditions": [
{
"operator": "LessOrEqualsThan",
"type": "Weight",
"value": 1000
},
{
"operator": "GreaterOrEqualsThan",
"type": "Width",
"value": 50
}
],
"actions": [
{
"condition": "Twice",
"type": "RedirectTo",
"outputId": 1
},
{
"condition": "Always",
"type": "RedirectTo",
"outputId": 4
}
]
}
{
"name": "Rule one",
"description": "description",
"conditions": [
{
"type": "LessOrEqualsThan",
"value": 1000
},
{
"type": "BarcodeSize",
"value": 10,
"operator": "GreaterThan"
}
],
"actions": [
{
"condition": "Always",
"type": "RedirectTo",
"outputId": 1
}
]
}
{
"name": "Rule three",
"description": "description",
"conditions": [
{
"type": "LessOrEqualsThan",
"value": 1000 // 1kg
},
{
"type": "GreaterOrEqualsThan",
"value": 50 //50cm
}
],
"actions": [
{
"condition": "Twice",
"type": "RedirectTo",
"outputId": 1
},
{
"condition": "Always",
"type": "RedirectTo",
"outputId": 4
}
]
}
{
"name": "Rule two",
"description": "description",
"conditions": [
{
"type": "BarcodeSize",
"value": 10,
"operator": "GreaterThan"
},
{
"type": "Barcode",
"value": "SP",
"startIndex": 5,
"length": 4
}
],
"actions": [
{
"condition": "Once",
"type": "RedirectTo",
"outputId": 1
},
{
"condition": "Always",
"type": "RedirectTo",
"outputId": 4
}
]
}
@diegodfsd
Copy link
Author

Enquanto montava esse exemplo surgiu a ideia de informar o typo de parametro explicitamente e nao implicitamente como hoje. Da forma que esta, se nao for uma condicao barcode ela é uma condição que vai tratar Height, Weight, Width, Depth e etc, mas nao fica claro para quem esta montando a condicao o que ela esta verificando.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment