{
  "name": "Growaify — Restaurant Order Intake & Daily Reports",
  "description": "WhatsApp order intake with automatic confirmation, kitchen ticket routing, and a daily sales report. Built by Growaify — growaify.com",
  "type": "GROWAIFY_SAMPLE",
  "notice": "هذه نسخة معاينة عامة — عقدتان فقط من أصل 9. النسخة الكاملة (بالمنطق والاتصالات كاملة) تُسلَّم بعد الشراء من https://growaify.com/templates/",
  "nodes_total_in_full_version": 9,
  "nodes": [
    {
      "parameters": {
        "updates": [
          "messages"
        ],
        "credentials": {}
      },
      "name": "WhatsApp Order Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "typeVersion": 1,
      "position": [
        -400,
        0
      ],
      "id": "b2c3d4e5-0001-4000-8000-000000000001"
    },
    {
      "parameters": {
        "jsCode": "// Parse order from natural message text\nconst msg = $input.first().json;\nconst text = (msg.message?.text?.body || msg.text?.body || '').trim();\nconst phone = msg.from || msg.metadata?.phone_number_id;\n\n// Simple order parser: '2 shawarma, 1 cola' style OR 'order: ...'\nconst lines = text.split('\\n').filter(l => l.trim());\nconst items = [];\nconst qtyRe = /^(\\d+)\\s*[x×]?\\s+(.+)$/i;\nfor (const l of lines) {\n  const m = l.match(qtyRe);\n  if (m) items.push({ qty: parseInt(m[1]), item: m[2].trim() });\n}\n\nreturn [{ json: {\n  phone,\n  raw_text: text,\n  is_order: items.length > 0 || /order|طلب|أطلب|ابغى/i.test(text),\n  items,\n  order_id: 'ORD-' + Date.now().toString(36).toUpperCase()\n} }];"
      },
      "name": "Parse Order",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -180,
        0
      ],
      "id": "b2c3d4e5-0002-4000-8000-000000000002"
    }
  ],
  "connections": {},
  "meta": {
    "growaify_template": "restaurant-orders",
    "sample": true,
    "buy": "https://growaify.com/templates/"
  }
}