Files
zen/test-data/graphs/warehouse-storage-location.json
bcrevar-gorulesandStefan 4a59f222db feat: add snapshot tests (#385)
* first draft

* mock time; update snapshots

* fix

* Node.js test fix

---------

Co-authored-by: Stefan <stefan@gorules.io>
2025-08-20 16:30:28 +02:00

345 lines
8.4 KiB
JSON

{
"tests": [
{
"input": {
"product": {
"id": "PRD-12345",
"name": "Gaming Laptop XZ5000",
"dimensions": {
"length": 40,
"width": 30,
"height": 10,
"unit": "cm"
},
"weight": {
"value": 3.5,
"unit": "kg"
},
"monthlyUnits": 2500,
"turnoverRate": 0.65,
"picksPerDay": 12,
"fragilityScore": 4,
"specialHandling": false,
"hazardous": false
}
},
"output": {
"allocatedLocation": "prime-picking-area-pallet-rack-bottom",
"allocation": {
"priority": 3,
"storageType": "pallet-rack-bottom",
"warehouseZone": "prime-picking-area"
},
"classification": {
"fastMoving": true,
"volumeCategory": "medium-volume"
},
"pickingEfficiencyScore": 7,
"product": {
"dimensions": {
"height": 10,
"length": 40,
"unit": "cm",
"width": 30
},
"fragilityScore": 4,
"hazardous": false,
"id": "PRD-12345",
"monthlyUnits": 2500,
"name": "Gaming Laptop XZ5000",
"picksPerDay": 12,
"specialHandling": false,
"turnoverRate": 0.65,
"weight": {
"unit": "kg",
"value": 3.5
}
},
"recommendedQuantity": 1250,
"replenishmentFrequency": "weekly"
}
}
],
"nodes": [
{
"type": "inputNode",
"content": {
"schema": ""
},
"id": "input",
"name": "request",
"position": {
"x": 110,
"y": 114
}
},
{
"type": "decisionTableNode",
"content": {
"hitPolicy": "first",
"rules": [
{
"_id": "rule1",
"i1": "> 5000",
"i2": "> 0.8",
"i3": "> 15",
"o1": "'high-volume'",
"o2": "true"
},
{
"_id": "rule2",
"i1": "> 1000",
"i2": "> 0.5",
"i3": "> 10",
"o1": "'medium-volume'",
"o2": "true"
},
{
"_id": "rule3",
"i1": "> 1000",
"i2": "< 0.5",
"i3": "< 10",
"o1": "'medium-volume'",
"o2": "false"
},
{
"_id": "rule4",
"i1": "< 1000",
"i2": "> 0.7",
"i3": "> 8",
"o1": "'low-volume-fast'",
"o2": "true"
},
{
"_id": "rule5",
"i1": "",
"i2": "",
"i3": "",
"o1": "'low-volume-standard'",
"o2": "false"
}
],
"inputs": [
{
"id": "i1",
"name": "Monthly Units",
"field": "product.monthlyUnits"
},
{
"id": "i2",
"name": "Turnover Rate",
"field": "product.turnoverRate"
},
{
"id": "i3",
"name": "Picks Per Day",
"field": "product.picksPerDay"
}
],
"outputs": [
{
"id": "o1",
"name": "Volume Category",
"field": "classification.volumeCategory"
},
{
"id": "o2",
"name": "Fast Moving",
"field": "classification.fastMoving"
}
],
"passThrough": true,
"inputField": null,
"outputPath": null,
"executionMode": "single"
},
"id": "productClassification",
"name": "classifyProduct",
"position": {
"x": 430,
"y": 114
}
},
{
"type": "decisionTableNode",
"content": {
"hitPolicy": "first",
"rules": [
{
"_id": "rule1",
"i1": "'high-volume'",
"i2": "true",
"i3": "> 3",
"o1": "'floor-level'",
"o2": "'prime-picking-area'",
"o3": "1"
},
{
"_id": "rule2",
"i1": "'high-volume'",
"i2": "true",
"i3": "< 3",
"o1": "'pallet-rack-bottom'",
"o2": "'prime-picking-area'",
"o3": "2"
},
{
"_id": "rule3",
"i1": "'medium-volume'",
"i2": "true",
"i3": "> 2",
"o1": "'pallet-rack-bottom'",
"o2": "'prime-picking-area'",
"o3": "3"
},
{
"_id": "rule4",
"i1": "'medium-volume'",
"i2": "false",
"i3": "> 2",
"o1": "'pallet-rack-middle'",
"o2": "'standard-picking-area'",
"o3": "4"
},
{
"_id": "rule5",
"i1": "'medium-volume'",
"i2": "false",
"i3": "< 2",
"o1": "'pallet-rack-upper'",
"o2": "'standard-picking-area'",
"o3": "5"
},
{
"_id": "rule6",
"i1": "'low-volume-fast'",
"i2": "true",
"i3": "",
"o1": "'bin-shelving-middle'",
"o2": "'standard-picking-area'",
"o3": "6"
},
{
"_id": "rule7",
"i1": "'low-volume-standard'",
"i2": "false",
"i3": "< 1",
"o1": "'bin-shelving-upper'",
"o2": "'overflow-area'",
"o3": "7"
},
{
"_id": "rule8",
"i1": "",
"i2": "",
"i3": "",
"o1": "'bin-shelving-standard'",
"o2": "'standard-picking-area'",
"o3": "8"
}
],
"inputs": [
{
"id": "i1",
"name": "Volume Category",
"field": "classification.volumeCategory"
},
{
"id": "i2",
"name": "Fast Moving",
"field": "classification.fastMoving"
},
{
"id": "i3",
"name": "Fragility",
"field": "product.fragilityScore"
}
],
"outputs": [
{
"id": "o1",
"name": "Storage Type",
"field": "allocation.storageType"
},
{
"id": "o2",
"name": "Warehouse Zone",
"field": "allocation.warehouseZone"
},
{
"id": "o3",
"name": "Priority",
"field": "allocation.priority"
}
],
"passThrough": true,
"inputField": null,
"outputPath": null,
"executionMode": "single"
},
"id": "locationAssignment",
"name": "assignLocation",
"position": {
"x": 750,
"y": 114
}
},
{
"type": "expressionNode",
"content": {
"expressions": [
{
"id": "expr1",
"key": "allocatedLocation",
"value": "allocation.warehouseZone + '-' + allocation.storageType"
},
{
"id": "expr2",
"key": "pickingEfficiencyScore",
"value": "classification.fastMoving ? 10 - allocation.priority : 5 - allocation.priority"
},
{
"id": "expr3",
"key": "recommendedQuantity",
"value": "product.monthlyUnits / 2"
},
{
"id": "expr4",
"key": "replenishmentFrequency",
"value": "product.turnoverRate > 0.7 ? 'daily' : product.turnoverRate > 0.4 ? 'weekly' : 'monthly'"
}
],
"passThrough": true,
"inputField": null,
"outputPath": null,
"executionMode": "single"
},
"id": "finalAllocation",
"name": "finalizeAllocation",
"position": {
"x": 1070,
"y": 114
}
}
],
"edges": [
{
"id": "edge1",
"sourceId": "input",
"targetId": "productClassification",
"type": "edge"
},
{
"id": "edge2",
"sourceId": "productClassification",
"targetId": "locationAssignment",
"type": "edge"
},
{
"id": "edge3",
"sourceId": "locationAssignment",
"targetId": "finalAllocation",
"type": "edge"
}
]
}