Compare commits

..

No commits in common. "f344721a9e7e696e5ec3a39c570ac1b8c4f2c43b" and "5bd41a9fd95848d0fcac2682afa459b7b0fde89e" have entirely different histories.

2 changed files with 68 additions and 102 deletions

View File

@ -34,6 +34,17 @@
]
]
},
"Item Lists1": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"Split Response Into Orders": {
"main": [
[
@ -43,9 +54,9 @@
"index": 0
},
{
"node": "Merge",
"node": "Code",
"type": "main",
"index": 1
"index": 0
}
]
]
@ -54,40 +65,7 @@
"main": [
[
{
"node": "Set Platform Ids",
"type": "main",
"index": 0
}
]
]
},
"Crypto": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Upsert Customer": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Crypto",
"node": "Item Lists1",
"type": "main",
"index": 0
}
@ -98,18 +76,18 @@
"main": [
[
{
"node": "Postgres",
"node": "Crypto",
"type": "main",
"index": 0
}
]
]
},
"Set Platform Ids": {
"Crypto": {
"main": [
[
{
"node": "IF",
"node": "Postgres",
"type": "main",
"index": 0
}
@ -261,7 +239,7 @@
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.3,
"position": [
2020,
1580,
-1320
],
"credentials": {
@ -323,8 +301,8 @@
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.3,
"position": [
300,
-1480
1300,
-1740
],
"credentials": {
"postgres": {
@ -350,7 +328,21 @@
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1760,
1320,
-1300
]
},
{
"parameters": {
"fieldToSplitOut": "OrderItems",
"options": {}
},
"id": "48b91734-2dec-494e-8a8b-d260e5a5ff40",
"name": "Item Lists1",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 3,
"position": [
1100,
-1300
]
},
@ -385,11 +377,10 @@
"columns": {
"mappingMode": "defineBelow",
"value": {
"order_id": "={{ $json.order_hash }}",
"order_ref": "={{ $json.OrderNumber }}",
"order_date": "={{ $json.CreatedAt.toDate().format(\"yyyyMMdd\") }}",
"customer_id": "={{ $json.Customer.Number }}",
"platform_id": "={{ \nswitch ($json[\"ApiAccountName\"]) {\n case 'Otto':\n $json.platform = 6;\n default:\n $json.platform = 1;\n}\n}}"
"order_id": 0,
"order_date": 0,
"customer_id": 0,
"platform_id": 0
},
"matchingColumns": [],
"schema": [
@ -437,15 +428,6 @@
"display": true,
"type": "number",
"canBeUsedToMatch": false
},
{
"id": "md5_hash",
"displayName": "md5_hash",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false
}
]
},
@ -456,8 +438,8 @@
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.3,
"position": [
1120,
-1320
840,
-1300
],
"credentials": {
"postgres": {
@ -466,6 +448,19 @@
}
}
},
{
"parameters": {
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.json.myNewField = 1;\n \n}\n\nreturn $input.all();"
},
"id": "ab86ad1c-fa6f-4683-9b51-70dbfdcc1540",
"name": "Code",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
260,
-1480
]
},
{
"parameters": {
"value": "={{ $json.OrderNumber.concat($json.CreatedAt.toDate().format(\"yyyy-MM-d\")) }}",
@ -477,50 +472,21 @@
"type": "n8n-nodes-base.crypto",
"typeVersion": 1,
"position": [
700,
-1320
480,
-1480
]
},
{
"parameters": {
"mode": "chooseBranch",
"output": "input2"
"value": "406-8723903-474272720220101"
},
"id": "8490a7f7-6f11-487b-8f81-4c97f56c638b",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 2.1,
"id": "ded21e90-3c0a-4122-87f7-a21a1ed4d998",
"name": "Crypto1",
"type": "n8n-nodes-base.crypto",
"typeVersion": 1,
"position": [
500,
-1320
]
},
{
"parameters": {
"language": "python",
"pythonCode": "# Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor item in _input.all():\n\tmatch item.json.Seller.BillbeeShopName:\n\t\tcase 'eBay':\n item.json.platform = 12\n\t\tcase 'lana-kk':\n item.json.platform = 1\n\t\tcase 'Amazon':\n item.json.platform = 2\n\t\tcase 'Weltkarten24':\n item.json.platform = 3\n\t\tcase 'KAUFLAND':\n item.json.platform = 5\n\t\tcase 'Wayfair':\n item.json.platform = 4\n\t\tcase 'Böttcher AG':\n item.json.platform = 7\n\t\tcase 'Juramondo':\n item.json.platform = 9\n\t\tcase 'wild.lanakk.com':\n item.json.platform = 8\n\t\tcase 'Etsy':\n item.json.platform = 10\n\t\tcase 'Otto':\n item.json.platform = 6\n\t\tcase 'weltkarte-kinder':\n item.json.platform = 11\n\t\tcase _:\n item.json.platform = 1\nreturn _input.all()\n"
},
"id": "2006b054-3147-4f8a-b8d1-6ce19554dfde",
"name": "Code",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
920,
-1320
]
},
{
"parameters": {
"fieldToSplitOut": "OrderItems",
"options": {}
},
"id": "48b91734-2dec-494e-8a8b-d260e5a5ff40",
"name": "Set Platform Ids",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 3,
"position": [
1320,
-1320
580,
-1220
]
}
],
@ -531,6 +497,6 @@
"staticData": null,
"tags": [],
"triggerCount": 0,
"updatedAt": "2023-12-12T09:52:19.000Z",
"versionId": "0e731bc6-faf1-4e5e-a83e-f8dabe7f704d"
"updatedAt": "2023-12-11T19:07:26.000Z",
"versionId": "617ecfde-b568-4cbc-8c1c-a8ee328a2882"
}

View File

@ -474,13 +474,13 @@
"staticData": {
"node:Gmail Trigger": {
"possibleDuplicates": [
"18c5d25096d07c29"
"18c59577d913a006"
],
"lastTimeChecked": 1702369757
"lastTimeChecked": 1702305954
}
},
"tags": [],
"triggerCount": 1,
"updatedAt": "2023-12-12T08:29:37.000Z",
"updatedAt": "2023-12-11T14:46:40.000Z",
"versionId": "d5336b9a-260a-4f88-862e-edbbb760acb2"
}