{
 "id": "restaurantdailys",
 "name": "AutomateRecipes \u2013 restaurant-daily-sales",
 "nodes": [
  {
   "parameters": {},
   "name": "Manual Trigger",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "id": "adeb6105-d936-42e3-90a7-b752f64e66b5"
  },
  {
   "parameters": {
    "url": "http://127.0.0.1:9000/square/payments",
    "options": {}
   },
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "name": "S1 GET mock/square/payments",
   "position": [
    220,
    0
   ],
   "id": "68d72102-7334-43af-9e37-7a5510c12e52"
  },
  {
   "parameters": {
    "jsCode": "const p=$input.first().json.payments;const tot=p.reduce((s,x)=>s+x.amount_money.amount,0)/100;if(tot!==85.5)throw new Error('bad total '+tot);return [{json:{service:'telegram/sendMessage',payload:{text:`Today: ${p.length} orders, ${tot.toFixed(2)} total`}}}];"
   },
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "name": "S2",
   "position": [
    440,
    0
   ],
   "id": "1c058285-d318-4a9b-8674-d7d6c7686b30"
  },
  {
   "parameters": {
    "method": "POST",
    "url": "=http://127.0.0.1:9000/{{ $json.service }}",
    "sendBody": true,
    "specifyBody": "json",
    "jsonBody": "={{ JSON.stringify($json.payload) }}",
    "options": {}
   },
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "name": "S3 POST mock (send)",
   "position": [
    660,
    0
   ],
   "id": "ae924ffc-0cf6-42f2-bb78-88397ed5170d"
  }
 ],
 "connections": {
  "Manual Trigger": {
   "main": [
    [
     {
      "node": "S1 GET mock/square/payments",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "S1 GET mock/square/payments": {
   "main": [
    [
     {
      "node": "S2",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "S2": {
   "main": [
    [
     {
      "node": "S3 POST mock (send)",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {},
 "active": false,
 "pinData": {},
 "meta": {
  "note": "Tested on n8n 1.70.3 with local mocks for: Square payments API, Telegram. Replace 'POST mock'/'GET mock' HTTP nodes with the real app nodes + credentials before production."
 }
}