-- MariaDB dump 10.17  Distrib 10.4.14-MariaDB, for Win64 (AMD64)
--
-- Host: localhost    Database: tap2order
-- ------------------------------------------------------
-- Server version	10.4.14-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `activity_logs`
--

DROP TABLE IF EXISTS `activity_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activity_logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT NULL,
  `restaurant_id` int(10) unsigned DEFAULT NULL,
  `module` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `details` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_al_user` (`user_id`),
  KEY `idx_al_restaurant` (`restaurant_id`),
  KEY `idx_al_module` (`module`),
  KEY `idx_al_action` (`action`),
  KEY `idx_al_created` (`created_at`),
  CONSTRAINT `fk_al_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_al_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `activity_logs`
--

LOCK TABLES `activity_logs` WRITE;
/*!40000 ALTER TABLE `activity_logs` DISABLE KEYS */;
INSERT INTO `activity_logs` VALUES (1,1,NULL,'auth','login','User logged in successfully','127.0.0.1','TestScript/1.0','2026-07-12 09:45:43'),(2,1,NULL,'auth','logout','User logged out','127.0.0.1','TestScript/1.0','2026-07-12 09:45:43'),(3,1,NULL,'auth','login','User logged in successfully','127.0.0.1','TestScript/1.0','2026-07-12 09:45:43'),(4,1,NULL,'auth','logout','User logged out','127.0.0.1','TestScript/1.0','2026-07-12 09:45:43'),(5,1,NULL,'auth','login','User logged in successfully','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36','2026-07-12 10:06:49'),(6,1,NULL,'auth','login','User logged in successfully','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0','2026-07-12 10:07:26'),(7,1,NULL,'auth','login','User logged in successfully','::1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-07-12 10:10:22'),(8,1,NULL,'auth','login','User logged in successfully','::1','','2026-07-12 10:22:34'),(9,1,NULL,'auth','logout','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36','2026-07-12 10:50:59'),(10,1,NULL,'auth','login','User logged in successfully','::1','','2026-07-12 10:59:12'),(11,1,NULL,'auth','login','User logged in successfully','::1','','2026-07-12 11:06:31'),(12,1,NULL,'auth','logout','User logged out','::1','','2026-07-12 11:06:31'),(13,1,NULL,'auth','login','User logged in successfully','::1','','2026-07-12 11:10:40'),(14,1,NULL,'auth','logout','User logged out','::1','','2026-07-12 11:10:40'),(15,1,NULL,'auth','login','User logged in successfully','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36','2026-07-12 11:12:43'),(16,1,NULL,'auth','login','User logged in successfully','::1','','2026-07-12 11:23:43'),(17,1,NULL,'auth','logout','User logged out','::1','','2026-07-12 11:23:43'),(18,1,NULL,'auth','login','User logged in successfully','::1','','2026-07-12 11:25:37'),(19,1,NULL,'auth','logout','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36','2026-07-12 11:27:03'),(20,1,NULL,'auth','login','User logged in successfully','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36','2026-07-12 11:30:30'),(21,1,1,'restaurant','add','Created restaurant: Big Mama  Anuradapura','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36','2026-07-12 11:31:55'),(22,1,NULL,'auth','logout','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36','2026-07-12 11:32:07'),(23,2,1,'auth','login','User logged in successfully','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36','2026-07-12 11:32:19'),(24,1,NULL,'auth','logout','User logged out','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0','2026-07-12 11:39:17');
/*!40000 ALTER TABLE `activity_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `addon_groups`
--

DROP TABLE IF EXISTS `addon_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `addon_groups` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_required` tinyint(1) NOT NULL DEFAULT 0,
  `min_select` int(11) NOT NULL DEFAULT 0,
  `max_select` int(11) NOT NULL DEFAULT 10,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_ag_restaurant` (`restaurant_id`),
  KEY `idx_ag_is_demo` (`is_demo`),
  CONSTRAINT `fk_ag_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `addon_groups`
--

LOCK TABLES `addon_groups` WRITE;
/*!40000 ALTER TABLE `addon_groups` DISABLE KEYS */;
/*!40000 ALTER TABLE `addon_groups` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `addons`
--

DROP TABLE IF EXISTS `addons`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `addons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `addon_group_id` int(10) unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_addons_restaurant` (`restaurant_id`),
  KEY `idx_addons_group` (`addon_group_id`),
  KEY `idx_addons_is_demo` (`is_demo`),
  CONSTRAINT `fk_addons_group` FOREIGN KEY (`addon_group_id`) REFERENCES `addon_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_addons_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `addons`
--

LOCK TABLES `addons` WRITE;
/*!40000 ALTER TABLE `addons` DISABLE KEYS */;
/*!40000 ALTER TABLE `addons` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `advertisements`
--

DROP TABLE IF EXISTS `advertisements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `advertisements` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `button_text` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `button_link` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `position` enum('top_banner','hero_slider','section_banner','popup','bottom_sticky','category_banner','checkout_banner') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'top_banner',
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `display_frequency` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'always',
  `popup_settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`popup_settings`)),
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_ads_restaurant` (`restaurant_id`),
  KEY `idx_ads_position` (`position`),
  KEY `idx_ads_active` (`is_active`),
  KEY `idx_ads_dates` (`start_date`,`end_date`),
  KEY `idx_ads_is_demo` (`is_demo`),
  CONSTRAINT `fk_ads_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `advertisements`
--

LOCK TABLES `advertisements` WRITE;
/*!40000 ALTER TABLE `advertisements` DISABLE KEYS */;
/*!40000 ALTER TABLE `advertisements` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `categories`
--

DROP TABLE IF EXISTS `categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categories` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_featured` tinyint(1) NOT NULL DEFAULT 0,
  `available_days` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Comma-separated: mon,tue,wed,...',
  `start_time` time DEFAULT NULL,
  `end_time` time DEFAULT NULL,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_categories_restaurant` (`restaurant_id`),
  KEY `idx_categories_status` (`status`),
  KEY `idx_categories_sort` (`sort_order`),
  KEY `idx_categories_is_demo` (`is_demo`),
  CONSTRAINT `fk_categories_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `categories`
--

LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_orders` int(10) unsigned NOT NULL DEFAULT 0,
  `total_spent` decimal(12,2) NOT NULL DEFAULT 0.00,
  `last_order_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_customers_restaurant` (`restaurant_id`),
  KEY `idx_customers_phone` (`phone`),
  KEY `idx_customers_email` (`email`),
  CONSTRAINT `fk_customers_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customers`
--

LOCK TABLES `customers` WRITE;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `enquiries`
--

DROP TABLE IF EXISTS `enquiries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `enquiries` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `restaurant_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preferred_plan` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('new','read','replied') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new',
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_enquiries_status` (`status`),
  KEY `idx_enquiries_is_demo` (`is_demo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `enquiries`
--

LOCK TABLES `enquiries` WRITE;
/*!40000 ALTER TABLE `enquiries` DISABLE KEYS */;
/*!40000 ALTER TABLE `enquiries` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `faqs`
--

DROP TABLE IF EXISTS `faqs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `faqs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `question` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `answer` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'general',
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_faqs_category` (`category`),
  KEY `idx_faqs_active` (`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `faqs`
--

LOCK TABLES `faqs` WRITE;
/*!40000 ALTER TABLE `faqs` DISABLE KEYS */;
INSERT INTO `faqs` VALUES (1,'What is Tap2Order?','Tap2Order is a smart QR menu and ordering platform that lets restaurants go digital. Customers can scan a QR code, browse your menu, and place orders directly from their phones.','general',1,1,'2026-07-12 09:17:34'),(2,'How do QR codes work?','Each table gets a unique QR code. When customers scan it with their phone camera, they are taken directly to your restaurant\'s digital menu. They can browse items, customize orders, and pay — all from their device.','general',2,1,'2026-07-12 09:17:34'),(3,'Is there a free trial?','Yes! We offer a 14-day free trial on all plans. No credit card required. You can explore all features before committing to a subscription.','billing',3,1,'2026-07-12 09:17:34'),(4,'Can I manage multiple branches?','Yes, depending on your plan. The Professional plan supports up to 3 branches, and the Enterprise plan offers unlimited branches with centralized management.','features',4,1,'2026-07-12 09:17:34'),(5,'Do customers need to install an app?','No! Tap2Order is completely web-based. Customers simply scan the QR code with their phone\'s camera and the menu opens in their browser. No app download required.','general',5,1,'2026-07-12 09:17:34'),(6,'What payment methods are supported?','We support cash on delivery, credit/debit cards, and various digital payment methods. The available options can be configured in your restaurant settings.','billing',6,1,'2026-07-12 09:17:34'),(7,'Can I customize the look and feel?','Absolutely! You can customize colors, fonts, layout, and branding to match your restaurant\'s identity. Enterprise customers also get white-label options.','features',7,1,'2026-07-12 09:17:34'),(8,'How do I get started?','Simply sign up for a free trial, add your menu items, generate QR codes for your tables, and you\'re ready to go! Our onboarding process takes just a few minutes.','general',8,1,'2026-07-12 09:17:34');
/*!40000 ALTER TABLE `faqs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `item_addon_groups`
--

DROP TABLE IF EXISTS `item_addon_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `item_addon_groups` (
  `menu_item_id` int(10) unsigned NOT NULL,
  `addon_group_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`menu_item_id`,`addon_group_id`),
  KEY `idx_iag_addon_group` (`addon_group_id`),
  CONSTRAINT `fk_iag_addon_group` FOREIGN KEY (`addon_group_id`) REFERENCES `addon_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_iag_menu_item` FOREIGN KEY (`menu_item_id`) REFERENCES `menu_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `item_addon_groups`
--

LOCK TABLES `item_addon_groups` WRITE;
/*!40000 ALTER TABLE `item_addon_groups` DISABLE KEYS */;
/*!40000 ALTER TABLE `item_addon_groups` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `item_variations`
--

DROP TABLE IF EXISTS `item_variations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `item_variations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `menu_item_id` int(10) unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_iv_restaurant` (`restaurant_id`),
  KEY `idx_iv_menu_item` (`menu_item_id`),
  KEY `idx_iv_is_demo` (`is_demo`),
  CONSTRAINT `fk_iv_menu_item` FOREIGN KEY (`menu_item_id`) REFERENCES `menu_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_iv_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `item_variations`
--

LOCK TABLES `item_variations` WRITE;
/*!40000 ALTER TABLE `item_variations` DISABLE KEYS */;
/*!40000 ALTER TABLE `item_variations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `login_attempts`
--

DROP TABLE IF EXISTS `login_attempts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `login_attempts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `attempted_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_login_attempts_email` (`email`),
  KEY `idx_login_attempts_attempted_at` (`attempted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `login_attempts`
--

LOCK TABLES `login_attempts` WRITE;
/*!40000 ALTER TABLE `login_attempts` DISABLE KEYS */;
INSERT INTO `login_attempts` VALUES (3,'nonexistent@example.com','127.0.0.1','2026-07-12 15:14:49'),(6,'nonexistent@example.com','127.0.0.1','2026-07-12 15:15:43');
/*!40000 ALTER TABLE `login_attempts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `menu_items`
--

DROP TABLE IF EXISTS `menu_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `menu_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `category_id` int(10) unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `short_description` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `full_description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `main_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gallery_images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`gallery_images`)),
  `regular_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `offer_price` decimal(10,2) DEFAULT NULL,
  `cost_price` decimal(10,2) DEFAULT NULL,
  `tax_setting` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'default',
  `prep_time` int(11) DEFAULT NULL COMMENT 'minutes',
  `calories` int(11) DEFAULT NULL,
  `ingredients` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `allergens` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_available` tinyint(1) NOT NULL DEFAULT 1,
  `stock_status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'in_stock',
  `stock_quantity` int(11) DEFAULT NULL,
  `is_featured` tinyint(1) NOT NULL DEFAULT 0,
  `is_new` tinyint(1) NOT NULL DEFAULT 0,
  `is_bestseller` tinyint(1) NOT NULL DEFAULT 0,
  `is_chefs_choice` tinyint(1) NOT NULL DEFAULT 0,
  `is_spicy` tinyint(1) NOT NULL DEFAULT 0,
  `is_vegetarian` tinyint(1) NOT NULL DEFAULT 0,
  `is_vegan` tinyint(1) NOT NULL DEFAULT 0,
  `is_halal` tinyint(1) NOT NULL DEFAULT 0,
  `is_gluten_free` tinyint(1) NOT NULL DEFAULT 0,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `view_count` int(10) unsigned NOT NULL DEFAULT 0,
  `order_count` int(10) unsigned NOT NULL DEFAULT 0,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_mi_restaurant` (`restaurant_id`),
  KEY `idx_mi_category` (`category_id`),
  KEY `idx_mi_status` (`is_available`),
  KEY `idx_mi_featured` (`is_featured`),
  KEY `idx_mi_sort` (`sort_order`),
  KEY `idx_mi_is_demo` (`is_demo`),
  CONSTRAINT `fk_mi_category` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_mi_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `menu_items`
--

LOCK TABLES `menu_items` WRITE;
/*!40000 ALTER TABLE `menu_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `menu_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `menu_view_logs`
--

DROP TABLE IF EXISTS `menu_view_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `menu_view_logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `category_id` int(10) unsigned DEFAULT NULL,
  `menu_item_id` int(10) unsigned DEFAULT NULL,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_type` enum('view','add_to_cart','checkout_start','order_placed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'view',
  `device_type` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_mvl_restaurant` (`restaurant_id`),
  KEY `idx_mvl_category` (`category_id`),
  KEY `idx_mvl_menu_item` (`menu_item_id`),
  KEY `idx_mvl_event` (`event_type`),
  KEY `idx_mvl_created` (`created_at`),
  CONSTRAINT `fk_mvl_category` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_mvl_menu_item` FOREIGN KEY (`menu_item_id`) REFERENCES `menu_items` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_mvl_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `menu_view_logs`
--

LOCK TABLES `menu_view_logs` WRITE;
/*!40000 ALTER TABLE `menu_view_logs` DISABLE KEYS */;
/*!40000 ALTER TABLE `menu_view_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `migrations`
--

DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `filename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `applied_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_migration_filename` (`filename`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `migrations`
--

LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'002_fix_password_resets_and_login_attempts.sql','2026-07-12 11:04:39');
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `notifications`
--

DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notifications` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT NULL,
  `restaurant_id` int(10) unsigned DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'info',
  `is_read` tinyint(1) NOT NULL DEFAULT 0,
  `url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_notif_user` (`user_id`),
  KEY `idx_notif_restaurant` (`restaurant_id`),
  KEY `idx_notif_read` (`is_read`),
  CONSTRAINT `fk_notif_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_notif_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `notifications`
--

LOCK TABLES `notifications` WRITE;
/*!40000 ALTER TABLE `notifications` DISABLE KEYS */;
/*!40000 ALTER TABLE `notifications` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `offer_categories`
--

DROP TABLE IF EXISTS `offer_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `offer_categories` (
  `offer_id` int(10) unsigned NOT NULL,
  `category_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`offer_id`,`category_id`),
  KEY `idx_oc_category` (`category_id`),
  CONSTRAINT `fk_oc_category` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_oc_offer` FOREIGN KEY (`offer_id`) REFERENCES `offers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `offer_categories`
--

LOCK TABLES `offer_categories` WRITE;
/*!40000 ALTER TABLE `offer_categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `offer_categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `offer_items`
--

DROP TABLE IF EXISTS `offer_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `offer_items` (
  `offer_id` int(10) unsigned NOT NULL,
  `menu_item_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`offer_id`,`menu_item_id`),
  KEY `idx_oi_menu_item` (`menu_item_id`),
  CONSTRAINT `fk_oi_menu_item` FOREIGN KEY (`menu_item_id`) REFERENCES `menu_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_oi_offer` FOREIGN KEY (`offer_id`) REFERENCES `offers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `offer_items`
--

LOCK TABLES `offer_items` WRITE;
/*!40000 ALTER TABLE `offer_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `offer_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `offers`
--

DROP TABLE IF EXISTS `offers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `offers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `offer_type` enum('percentage','fixed','bogo','combo','coupon') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percentage',
  `discount_value` decimal(10,2) NOT NULL DEFAULT 0.00,
  `coupon_code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `start_time` time DEFAULT NULL,
  `end_time` time DEFAULT NULL,
  `min_order` decimal(10,2) NOT NULL DEFAULT 0.00,
  `max_uses` int(11) DEFAULT NULL,
  `used_count` int(10) unsigned NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_offers_restaurant` (`restaurant_id`),
  KEY `idx_offers_active` (`is_active`),
  KEY `idx_offers_dates` (`start_date`,`end_date`),
  KEY `idx_offers_coupon` (`coupon_code`),
  KEY `idx_offers_is_demo` (`is_demo`),
  CONSTRAINT `fk_offers_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `offers`
--

LOCK TABLES `offers` WRITE;
/*!40000 ALTER TABLE `offers` DISABLE KEYS */;
/*!40000 ALTER TABLE `offers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `order_item_addons`
--

DROP TABLE IF EXISTS `order_item_addons`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order_item_addons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_item_id` int(10) unsigned NOT NULL,
  `addon_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `addon_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  PRIMARY KEY (`id`),
  KEY `idx_oia_order_item` (`order_item_id`),
  CONSTRAINT `fk_oia_order_item` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `order_item_addons`
--

LOCK TABLES `order_item_addons` WRITE;
/*!40000 ALTER TABLE `order_item_addons` DISABLE KEYS */;
/*!40000 ALTER TABLE `order_item_addons` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `order_status_history`
--

DROP TABLE IF EXISTS `order_status_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order_status_history` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` int(10) unsigned NOT NULL,
  `from_status` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `to_status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `changed_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_osh_order` (`order_id`),
  KEY `idx_osh_changed_by` (`changed_by`),
  CONSTRAINT `fk_osh_changed_by` FOREIGN KEY (`changed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_osh_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `order_status_history`
--

LOCK TABLES `order_status_history` WRITE;
/*!40000 ALTER TABLE `order_status_history` DISABLE KEYS */;
/*!40000 ALTER TABLE `order_status_history` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `orders`
--

DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orders` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `customer_id` int(10) unsigned DEFAULT NULL,
  `table_id` int(10) unsigned DEFAULT NULL,
  `order_number` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_type` enum('dine_in','takeaway','delivery') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'dine_in',
  `customer_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `order_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `discount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `tax` decimal(10,2) NOT NULL DEFAULT 0.00,
  `service_charge` decimal(10,2) NOT NULL DEFAULT 0.00,
  `delivery_charge` decimal(10,2) NOT NULL DEFAULT 0.00,
  `grand_total` decimal(12,2) NOT NULL DEFAULT 0.00,
  `payment_method` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_status` enum('pending','paid','partial','failed','refunded') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `order_status` enum('new','confirmed','preparing','ready','served','completed','cancelled','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new',
  `cancellation_reason` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_orders_number` (`restaurant_id`,`order_number`),
  KEY `idx_orders_customer` (`customer_id`),
  KEY `idx_orders_table` (`table_id`),
  KEY `idx_orders_order_status` (`order_status`),
  KEY `idx_orders_payment_status` (`payment_status`),
  KEY `idx_orders_order_type` (`order_type`),
  KEY `idx_orders_created` (`created_at`),
  KEY `idx_orders_is_demo` (`is_demo`),
  CONSTRAINT `fk_orders_customer` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_orders_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_orders_table` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `orders`
--

LOCK TABLES `orders` WRITE;
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_resets`
--

DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_resets` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expires_at` datetime DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_pr_email` (`email`),
  KEY `idx_pr_token` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `password_resets`
--

LOCK TABLES `password_resets` WRITE;
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payments`
--

DROP TABLE IF EXISTS `payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` int(10) unsigned NOT NULL,
  `restaurant_id` int(10) unsigned NOT NULL,
  `amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `payment_method` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_ref` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','paid','failed','refunded') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_payments_order` (`order_id`),
  KEY `idx_payments_restaurant` (`restaurant_id`),
  KEY `idx_payments_status` (`status`),
  CONSTRAINT `fk_payments_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_payments_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payments`
--

LOCK TABLES `payments` WRITE;
/*!40000 ALTER TABLE `payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `payments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `permissions`
--

DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permissions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `module` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_permissions_name` (`name`),
  KEY `idx_permissions_module` (`module`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `permissions`
--

LOCK TABLES `permissions` WRITE;
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
INSERT INTO `permissions` VALUES (1,'dashboard.view','dashboard','View dashboard','2026-07-12 09:17:34'),(2,'dashboard.analytics','dashboard','View analytics','2026-07-12 09:17:34'),(3,'restaurant.view','restaurant','View restaurant details','2026-07-12 09:17:34'),(4,'restaurant.edit','restaurant','Edit restaurant settings','2026-07-12 09:17:34'),(5,'restaurant.manage','restaurant','Manage restaurant (full)','2026-07-12 09:17:34'),(6,'menu.view','menu','View menu items','2026-07-12 09:17:34'),(7,'menu.create','menu','Create menu items','2026-07-12 09:17:34'),(8,'menu.edit','menu','Edit menu items','2026-07-12 09:17:34'),(9,'menu.delete','menu','Delete menu items','2026-07-12 09:17:34'),(10,'menu.manage_categories','menu','Manage categories','2026-07-12 09:17:34'),(11,'menu.manage_addons','menu','Manage addons','2026-07-12 09:17:34'),(12,'menu.manage_variations','menu','Manage variations','2026-07-12 09:17:34'),(13,'orders.view','orders','View orders','2026-07-12 09:17:34'),(14,'orders.create','orders','Create orders','2026-07-12 09:17:34'),(15,'orders.edit_status','orders','Edit order status','2026-07-12 09:17:34'),(16,'orders.cancel','orders','Cancel orders','2026-07-12 09:17:34'),(17,'orders.delete','orders','Delete orders','2026-07-12 09:17:34'),(18,'tables.view','tables','View tables','2026-07-12 09:17:34'),(19,'tables.manage','tables','Manage tables','2026-07-12 09:17:34'),(20,'payments.view','payments','View payments','2026-07-12 09:17:34'),(21,'payments.process','payments','Process payments','2026-07-12 09:17:34'),(22,'payments.refund','payments','Refund payments','2026-07-12 09:17:34'),(23,'customers.view','customers','View customers','2026-07-12 09:17:34'),(24,'customers.manage','customers','Manage customers','2026-07-12 09:17:34'),(25,'offers.view','offers','View offers','2026-07-12 09:17:34'),(26,'offers.manage','offers','Manage offers','2026-07-12 09:17:34'),(27,'advertisements.view','advertisements','View advertisements','2026-07-12 09:17:34'),(28,'advertisements.manage','advertisements','Manage advertisements','2026-07-12 09:17:34'),(29,'reports.view','reports','View reports','2026-07-12 09:17:34'),(30,'reports.export','reports','Export reports','2026-07-12 09:17:34'),(31,'users.view','users','View users','2026-07-12 09:17:34'),(32,'users.manage','users','Manage staff users','2026-07-12 09:17:34'),(33,'settings.view','settings','View settings','2026-07-12 09:17:34'),(34,'settings.edit','settings','Edit settings','2026-07-12 09:17:34'),(35,'notifications.view','notifications','View notifications','2026-07-12 09:17:34'),(36,'notifications.manage','notifications','Manage notifications','2026-07-12 09:17:34'),(37,'system.settings','system','Manage system settings','2026-07-12 09:17:34'),(38,'system.plans','system','Manage subscription plans','2026-07-12 09:17:34'),(39,'system.restaurants','system','Manage all restaurants','2026-07-12 09:17:34'),(40,'system.users','system','Manage all users','2026-07-12 09:17:34'),(41,'system.logs','system','View system logs','2026-07-12 09:17:34'),(42,'system.website','system','Manage website settings','2026-07-12 09:17:34');
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pricing_plans`
--

DROP TABLE IF EXISTS `pricing_plans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pricing_plans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `plan_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `monthly_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `annual_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `features` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`features`)),
  `is_recommended` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pricing_plans`
--

LOCK TABLES `pricing_plans` WRITE;
/*!40000 ALTER TABLE `pricing_plans` DISABLE KEYS */;
INSERT INTO `pricing_plans` VALUES (1,'Basic',29.00,290.00,'Perfect for small restaurants just getting started.','[\"Digital Menu\",\"QR Codes\",\"Up to 50 Items\",\"3 Staff Members\",\"10 Tables\",\"1 Branch\",\"Basic Analytics\",\"Email Support\"]',0,1,1,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(2,'Professional',79.00,790.00,'Ideal for growing restaurants needing more features.','[\"Digital Menu\",\"QR Codes\",\"Online Ordering\",\"Up to 200 Items\",\"10 Staff Members\",\"50 Tables\",\"3 Branches\",\"Advanced Analytics\",\"Table Management\",\"Payment Tracking\",\"Offers & Coupons\",\"Priority Support\"]',1,1,2,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(3,'Enterprise',199.00,1990.00,'Complete solution for restaurant chains.','[\"Unlimited Everything\",\"White Label\",\"Custom Branding\",\"API Access\",\"Dedicated Support\",\"Multi-Branch Management\",\"Advanced Reports\",\"All Features Included\"]',0,1,3,'2026-07-12 09:17:34','2026-07-12 09:17:34');
/*!40000 ALTER TABLE `pricing_plans` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `qr_codes`
--

DROP TABLE IF EXISTS `qr_codes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `qr_codes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `table_id` int(10) unsigned DEFAULT NULL,
  `code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('restaurant','table') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'restaurant',
  `logo_watermark` tinyint(1) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_qr_code` (`code`),
  KEY `idx_qr_restaurant` (`restaurant_id`),
  KEY `idx_qr_table` (`table_id`),
  CONSTRAINT `fk_qr_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_qr_table` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `qr_codes`
--

LOCK TABLES `qr_codes` WRITE;
/*!40000 ALTER TABLE `qr_codes` DISABLE KEYS */;
/*!40000 ALTER TABLE `qr_codes` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `qr_scan_logs`
--

DROP TABLE IF EXISTS `qr_scan_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `qr_scan_logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `table_id` int(10) unsigned DEFAULT NULL,
  `qr_code_id` int(10) unsigned DEFAULT NULL,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_type` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scanned_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_qsl_restaurant` (`restaurant_id`),
  KEY `idx_qsl_table` (`table_id`),
  KEY `idx_qsl_qr_code` (`qr_code_id`),
  KEY `idx_qsl_scanned` (`scanned_at`),
  CONSTRAINT `fk_qsl_qr_code` FOREIGN KEY (`qr_code_id`) REFERENCES `qr_codes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_qsl_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_qsl_table` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `qr_scan_logs`
--

LOCK TABLES `qr_scan_logs` WRITE;
/*!40000 ALTER TABLE `qr_scan_logs` DISABLE KEYS */;
/*!40000 ALTER TABLE `qr_scan_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `restaurant_settings`
--

DROP TABLE IF EXISTS `restaurant_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `restaurant_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `google_maps_link` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `facebook_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `instagram_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `twitter_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `min_order` decimal(10,2) NOT NULL DEFAULT 0.00,
  `tax_percent` decimal(5,2) NOT NULL DEFAULT 0.00,
  `service_charge_percent` decimal(5,2) NOT NULL DEFAULT 0.00,
  `delivery_charge` decimal(10,2) NOT NULL DEFAULT 0.00,
  `prep_time_minutes` int(11) NOT NULL DEFAULT 15,
  `dine_in_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `takeaway_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `delivery_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `menu_mode` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'standard',
  `order_acceptance` tinyint(1) NOT NULL DEFAULT 1,
  `online_offline` tinyint(1) NOT NULL DEFAULT 1,
  `primary_color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT '#E63946',
  `secondary_color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT '#1D3557',
  `font_preference` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'Poppins',
  `menu_layout` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'grid',
  `item_card_style` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'classic',
  `footer_message` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_notice` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `wifi_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `wifi_password` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `terms` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `allergy_notice` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `order_prefix` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'ORD',
  `order_start_number` int(11) NOT NULL DEFAULT 1000,
  `refresh_interval` int(11) NOT NULL DEFAULT 30,
  `sound_notification` tinyint(1) NOT NULL DEFAULT 1,
  `opening_hours` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`opening_hours`)),
  `closed_days` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`closed_days`)),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_rs_restaurant` (`restaurant_id`),
  CONSTRAINT `fk_rs_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `restaurant_settings`
--

LOCK TABLES `restaurant_settings` WRITE;
/*!40000 ALTER TABLE `restaurant_settings` DISABLE KEYS */;
INSERT INTO `restaurant_settings` VALUES (1,1,NULL,NULL,NULL,NULL,0.00,0.00,0.00,0.00,15,1,1,0,'standard',1,1,'#E63946','#1D3557','Poppins','grid','classic',NULL,NULL,NULL,NULL,NULL,NULL,'ORD',1000,30,1,NULL,NULL,'2026-07-12 11:31:55','2026-07-12 11:31:55');
/*!40000 ALTER TABLE `restaurant_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `restaurants`
--

DROP TABLE IF EXISTS `restaurants`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `restaurants` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `whatsapp` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `timezone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'UTC',
  `logo` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `plan_id` int(10) unsigned DEFAULT NULL,
  `trial_start` date DEFAULT NULL,
  `trial_end` date DEFAULT NULL,
  `subscription_start` date DEFAULT NULL,
  `subscription_end` date DEFAULT NULL,
  `status` enum('trial','active','suspended','expired','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'trial',
  `operating_mode` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1=view_only, 2=ordering',
  `max_menu_items` int(11) NOT NULL DEFAULT 50,
  `max_staff` int(11) NOT NULL DEFAULT 3,
  `max_tables` int(11) NOT NULL DEFAULT 10,
  `max_branches` int(11) NOT NULL DEFAULT 1,
  `domain` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_restaurants_slug` (`slug`),
  UNIQUE KEY `uk_restaurants_code` (`code`),
  KEY `idx_restaurants_plan` (`plan_id`),
  KEY `idx_restaurants_status` (`status`),
  KEY `idx_restaurants_is_demo` (`is_demo`),
  KEY `idx_restaurants_is_active` (`is_active`),
  CONSTRAINT `fk_restaurants_plan` FOREIGN KEY (`plan_id`) REFERENCES `subscription_plans` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `restaurants`
--

LOCK TABLES `restaurants` WRITE;
/*!40000 ALTER TABLE `restaurants` DISABLE KEYS */;
INSERT INTO `restaurants` VALUES (1,'Big Mama  Anuradapura','big-mama-anuradapura','FVIFIF','Amidu RAjapaksha','','','','','','','USD','UTC',NULL,NULL,'',NULL,'2026-07-12','2026-07-26',NULL,NULL,'trial',1,50,3,10,1,'',0,1,'2026-07-12 11:31:55','2026-07-12 11:31:55');
/*!40000 ALTER TABLE `restaurants` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `role_permissions`
--

DROP TABLE IF EXISTS `role_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role_permissions` (
  `role_id` int(10) unsigned NOT NULL,
  `permission_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`permission_id`),
  KEY `idx_rp_permission` (`permission_id`),
  CONSTRAINT `fk_rp_permission` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_rp_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `role_permissions`
--

LOCK TABLES `role_permissions` WRITE;
/*!40000 ALTER TABLE `role_permissions` DISABLE KEYS */;
INSERT INTO `role_permissions` VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,13),(1,14),(1,15),(1,16),(1,17),(1,18),(1,19),(1,20),(1,21),(1,22),(1,23),(1,24),(1,25),(1,26),(1,27),(1,28),(1,29),(1,30),(1,31),(1,32),(1,33),(1,34),(1,35),(1,36),(1,37),(1,38),(1,39),(1,40),(1,41),(1,42),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),(2,7),(2,8),(2,9),(2,10),(2,11),(2,12),(2,13),(2,14),(2,15),(2,16),(2,17),(2,18),(2,19),(2,20),(2,21),(2,22),(2,23),(2,24),(2,25),(2,26),(2,27),(2,28),(2,29),(2,30),(2,35),(2,36),(3,1),(3,2),(3,3),(3,6),(3,7),(3,8),(3,13),(3,14),(3,15),(3,16),(3,18),(3,19),(3,20),(3,21),(3,23),(3,24),(3,25),(3,29),(3,35),(4,1),(4,6),(4,13),(4,14),(4,15),(4,18),(4,20),(4,21),(4,23),(4,35),(5,1),(5,6),(5,13),(5,15),(5,35),(6,1),(6,6),(6,13),(6,14),(6,15),(6,18),(6,19),(6,23),(6,35);
/*!40000 ALTER TABLE `role_permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `permissions` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_roles_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `roles`
--

LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,'super_admin','Full system access with all permissions','[\"*\"]','2026-07-12 09:17:34','2026-07-12 09:42:34'),(2,'restaurant_admin','Restaurant owner with full restaurant access','[\"orders.edit_status\",\"payments.refund\",\"reports.view\",\"advertisements.manage\",\"menu.delete\",\"menu.manage_addons\",\"restaurant.manage\",\"menu.create\",\"payments.view\",\"tables.manage\",\"advertisements.view\",\"menu.edit\",\"menu.manage_categories\",\"restaurant.view\",\"customers.view\",\"dashboard.view\",\"payments.process\",\"customers.manage\",\"dashboard.analytics\",\"menu.manage_variations\",\"notifications.manage\",\"offers.manage\",\"orders.create\",\"orders.cancel\",\"orders.delete\",\"orders.view\",\"reports.export\",\"tables.view\",\"menu.view\",\"notifications.view\",\"offers.view\",\"restaurant.edit\"]','2026-07-12 09:17:34','2026-07-12 09:42:34'),(3,'restaurant_manager','Restaurant manager with operational access','[\"restaurant.view\",\"customers.view\",\"dashboard.view\",\"payments.process\",\"customers.manage\",\"dashboard.analytics\",\"orders.create\",\"orders.cancel\",\"orders.view\",\"tables.view\",\"menu.view\",\"notifications.view\",\"offers.view\",\"orders.edit_status\",\"reports.view\",\"menu.create\",\"payments.view\",\"tables.manage\",\"menu.edit\"]','2026-07-12 09:17:34','2026-07-12 09:42:34'),(4,'cashier','Cashier with order and payment access','[\"orders.view\",\"tables.view\",\"menu.view\",\"notifications.view\",\"orders.edit_status\",\"payments.view\",\"customers.view\",\"dashboard.view\",\"payments.process\",\"orders.create\"]','2026-07-12 09:17:34','2026-07-12 09:42:34'),(5,'kitchen_staff','Kitchen staff with order viewing access','[\"dashboard.view\",\"orders.view\",\"menu.view\",\"notifications.view\",\"orders.edit_status\"]','2026-07-12 09:17:34','2026-07-12 09:42:34'),(6,'waiter','Waiter with table and order management access','[\"orders.view\",\"customers.view\",\"menu.view\",\"notifications.view\",\"orders.create\",\"orders.edit_status\",\"tables.manage\",\"tables.view\",\"dashboard.view\"]','2026-07-12 09:17:34','2026-07-12 09:42:34');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `subscription_plans`
--

DROP TABLE IF EXISTS `subscription_plans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subscription_plans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `monthly_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `annual_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `max_menu_items` int(11) NOT NULL DEFAULT 50,
  `max_staff` int(11) NOT NULL DEFAULT 3,
  `max_tables` int(11) NOT NULL DEFAULT 10,
  `max_branches` int(11) NOT NULL DEFAULT 1,
  `features` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`features`)),
  `is_recommended` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_sp_slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `subscription_plans`
--

LOCK TABLES `subscription_plans` WRITE;
/*!40000 ALTER TABLE `subscription_plans` DISABLE KEYS */;
INSERT INTO `subscription_plans` VALUES (1,'Basic','basic','Perfect for small restaurants just getting started with digital menus.',29.00,290.00,50,3,10,1,'[\"Digital Menu\",\"QR Codes\",\"Basic Analytics\",\"Email Support\",\"1 Branch\"]',0,1,1,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(2,'Professional','professional','Ideal for growing restaurants that need advanced ordering features.',79.00,790.00,200,10,50,3,'[\"Digital Menu\",\"QR Codes\",\"Online Ordering\",\"Advanced Analytics\",\"Table Management\",\"Payment Tracking\",\"Priority Support\",\"3 Branches\",\"Offers & Coupons\",\"Advertisements\"]',1,1,2,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(3,'Enterprise','enterprise','Complete solution for restaurant chains and large operations.',199.00,1990.00,-1,-1,-1,-1,'[\"Unlimited Menu Items\",\"Unlimited Staff\",\"Unlimited Tables\",\"Unlimited Branches\",\"White Label Domain\",\"Custom Branding\",\"API Access\",\"Dedicated Support\",\"Multi-Branch Management\",\"Advanced Reports\",\"All Features Included\"]',0,1,3,'2026-07-12 09:17:34','2026-07-12 09:17:34');
/*!40000 ALTER TABLE `subscription_plans` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `system_settings`
--

DROP TABLE IF EXISTS `system_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `system_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `setting_value` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `setting_type` enum('text','image','color','json','boolean','integer') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text',
  `group_name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'general',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_ss_key` (`setting_key`),
  KEY `idx_ss_group` (`group_name`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `system_settings`
--

LOCK TABLES `system_settings` WRITE;
/*!40000 ALTER TABLE `system_settings` DISABLE KEYS */;
INSERT INTO `system_settings` VALUES (1,'platform_name','Tap2Order','text','general','2026-07-12 09:17:34','2026-07-12 09:22:00'),(2,'platform_version','1.0.0','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(3,'platform_url','http://localhost','text','general','2026-07-12 09:17:34','2026-07-12 09:22:00'),(4,'admin_email','admin@tap2order.local','text','general','2026-07-12 09:17:34','2026-07-12 09:22:00'),(5,'support_email','support@tap2order.com','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(6,'default_currency','USD','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(7,'default_timezone','UTC','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(8,'trial_days','14','integer','subscription','2026-07-12 09:17:34','2026-07-12 09:17:34'),(9,'max_trial_extensions','2','integer','subscription','2026-07-12 09:17:34','2026-07-12 09:17:34'),(10,'demo_mode','0','boolean','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(11,'maintenance_mode','0','boolean','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(12,'registration_enabled','1','boolean','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(13,'email_verification','0','boolean','auth','2026-07-12 09:17:34','2026-07-12 09:17:34'),(14,'sms_verification','0','boolean','auth','2026-07-12 09:17:34','2026-07-12 09:17:34'),(15,'smtp_host','','text','mail','2026-07-12 09:17:34','2026-07-12 09:17:34'),(16,'smtp_port','587','integer','mail','2026-07-12 09:17:34','2026-07-12 09:17:34'),(17,'smtp_username','','text','mail','2026-07-12 09:17:34','2026-07-12 09:17:34'),(18,'smtp_password','','text','mail','2026-07-12 09:17:34','2026-07-12 09:17:34'),(19,'smtp_encryption','tls','text','mail','2026-07-12 09:17:34','2026-07-12 09:17:34'),(20,'smtp_from_email','noreply@tap2order.com','text','mail','2026-07-12 09:17:34','2026-07-12 09:17:34'),(21,'smtp_from_name','Tap2Order','text','mail','2026-07-12 09:17:34','2026-07-12 09:17:34'),(22,'order_notification_email','1','boolean','notifications','2026-07-12 09:17:34','2026-07-12 09:17:34'),(23,'order_notification_sms','0','boolean','notifications','2026-07-12 09:17:34','2026-07-12 09:17:34'),(24,'order_notification_sound','1','boolean','notifications','2026-07-12 09:17:34','2026-07-12 09:17:34'),(25,'max_upload_size','5','integer','uploads','2026-07-12 09:17:34','2026-07-12 09:17:34'),(26,'allowed_file_types','jpg,jpeg,png,gif,webp,svg','text','uploads','2026-07-12 09:17:34','2026-07-12 09:17:34'),(27,'auto_backup_enabled','1','boolean','system','2026-07-12 09:17:34','2026-07-12 09:17:34'),(28,'backup_frequency','daily','text','system','2026-07-12 09:17:34','2026-07-12 09:17:34'),(29,'log_retention_days','90','integer','system','2026-07-12 09:17:34','2026-07-12 09:17:34'),(30,'tax_name','Tax','text','orders','2026-07-12 09:17:34','2026-07-12 09:17:34'),(31,'currency_symbol','$','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(32,'currency_position','before','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(33,'date_format','Y-m-d','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(34,'time_format','H:i','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34');
/*!40000 ALTER TABLE `system_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tables`
--

DROP TABLE IF EXISTS `tables`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tables` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `restaurant_id` int(10) unsigned NOT NULL,
  `table_number` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `table_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `capacity` int(11) NOT NULL DEFAULT 4,
  `area` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('available','occupied','ordered','preparing','ready','bill_requested','reserved','cleaning') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'available',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_tables_restaurant` (`restaurant_id`),
  KEY `idx_tables_status` (`status`),
  KEY `idx_tables_is_demo` (`is_demo`),
  CONSTRAINT `fk_tables_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tables`
--

LOCK TABLES `tables` WRITE;
/*!40000 ALTER TABLE `tables` DISABLE KEYS */;
/*!40000 ALTER TABLE `tables` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `testimonials`
--

DROP TABLE IF EXISTS `testimonials`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `testimonials` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `restaurant_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rating` tinyint(3) unsigned NOT NULL DEFAULT 5,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_testimonials_active` (`is_active`),
  KEY `idx_testimonials_sort` (`sort_order`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `testimonials`
--

LOCK TABLES `testimonials` WRITE;
/*!40000 ALTER TABLE `testimonials` DISABLE KEYS */;
INSERT INTO `testimonials` VALUES (1,'Marco Rossi','Bella Italia','Owner','Tap2Order transformed our restaurant. We went from paper menus to a sleek digital experience in just one day. Our customers love it and orders have increased by 35%!',NULL,5,1,1,'2026-07-12 09:17:34'),(2,'Sarah Chen','Dragon Palace','Manager','The best investment we made this year. Table management and online ordering have streamlined our operations completely. Support team is fantastic too.',NULL,5,1,2,'2026-07-12 09:17:34'),(3,'Ahmed Hassan','Spice Garden','Owner','Very easy to set up and use. Our customers appreciate the modern touch, and we save so much on printing costs. The analytics are incredibly helpful.',NULL,5,1,3,'2026-07-12 09:17:34'),(4,'Emily Johnson','The Green Fork','Chef & Owner','As a small restaurant owner, I was worried about going digital. Tap2Order made it so simple and affordable. Now I can focus on what I love - cooking great food!',NULL,4,1,4,'2026-07-12 09:17:34'),(5,'Carlos Mendez','Casa Mexicana','Manager','The QR code ordering system is a game changer. Customers scan, order, and pay without waiting. Our turnover rate has improved significantly.',NULL,5,1,5,'2026-07-12 09:17:34'),(6,'Priya Sharma','Tandoori Nights','Owner','Switched from our old POS system to Tap2Order and never looked back. The digital menu is beautiful and our international customers find it so much easier to order now.',NULL,5,1,6,'2026-07-12 09:17:34'),(7,'David Kim','Seoul Kitchen','Operations Director','Multi-branch management is seamless. We run 5 locations and Tap2Order gives us a unified view of everything. Highly recommended for restaurant chains.',NULL,5,1,7,'2026-07-12 09:17:34');
/*!40000 ALTER TABLE `testimonials` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `role_id` int(10) unsigned NOT NULL,
  `restaurant_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `last_login` timestamp NULL DEFAULT NULL,
  `last_login_ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_login_ua` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `login_attempts` int(10) unsigned NOT NULL DEFAULT 0,
  `is_demo` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_users_email` (`email`),
  KEY `idx_users_role` (`role_id`),
  KEY `idx_users_restaurant` (`restaurant_id`),
  KEY `idx_users_status` (`status`),
  KEY `idx_users_is_demo` (`is_demo`),
  CONSTRAINT `fk_users_restaurant` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurants` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_users_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,1,NULL,'Super Admin','admin@tap2order.local','$2y$10$XqfMfdl/HHjCksj0ZbV3k.Op7ci3ASP5cXHkG9A/ks4TQ.yhStGLa',NULL,NULL,'active','2026-07-12 11:30:30','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36',0,0,'2026-07-12 09:17:34','2026-07-12 11:30:30'),(2,2,1,'Big Mama','bigmama@tap2order.local','$2y$10$Or/2EWngsYSbrtBxToyfm.Un7KkQmnJcvD45/ZRcGV4MZaRmivIBi',NULL,NULL,'active','2026-07-12 11:32:19','::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36',0,0,'2026-07-12 11:31:55','2026-07-12 11:32:19');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `website_sections`
--

DROP TABLE IF EXISTS `website_sections`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `website_sections` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `section_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subtitle` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_ws_section_key` (`section_key`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `website_sections`
--

LOCK TABLES `website_sections` WRITE;
/*!40000 ALTER TABLE `website_sections` DISABLE KEYS */;
INSERT INTO `website_sections` VALUES (1,'hero','Transform Your Restaurant with Smart QR Menus','Go digital in minutes. Let customers scan, browse & order from their phones.',NULL,NULL,1,1,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(2,'features','Everything You Need to Go Digital','Powerful features designed specifically for modern restaurants.',NULL,NULL,1,2,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(3,'how_it_works','How It Works','Get started in 3 simple steps',NULL,NULL,1,3,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(4,'pricing','Simple, Transparent Pricing','Choose the plan that fits your restaurant.',NULL,NULL,1,4,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(5,'testimonials','Loved by Restaurant Owners','See what our customers have to say',NULL,NULL,1,5,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(6,'cta','Ready to Go Digital?','Join thousands of restaurants already using Tap2Order.',NULL,NULL,1,6,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(7,'faq','Frequently Asked Questions','Find answers to common questions',NULL,NULL,1,7,'2026-07-12 09:17:34','2026-07-12 09:17:34'),(8,'footer','Tap2Order','The smart QR menu and ordering platform for modern restaurants.',NULL,NULL,1,8,'2026-07-12 09:17:34','2026-07-12 09:17:34');
/*!40000 ALTER TABLE `website_sections` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `website_settings`
--

DROP TABLE IF EXISTS `website_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `website_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `setting_value` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `setting_type` enum('text','image','color','json') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text',
  `group_name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'general',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_ws_key` (`setting_key`),
  KEY `idx_ws_group` (`group_name`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `website_settings`
--

LOCK TABLES `website_settings` WRITE;
/*!40000 ALTER TABLE `website_settings` DISABLE KEYS */;
INSERT INTO `website_settings` VALUES (1,'site_name','Tap2Order','text','general','2026-07-12 09:17:34','2026-07-12 09:22:00'),(2,'site_tagline','Smart QR Menu & Ordering Platform for Restaurants','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(3,'site_description','Transform your restaurant with Tap2Order - the all-in-one QR menu and ordering platform. Go digital in minutes.','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(4,'site_logo','uploads/logo/site_logo_1783848120.png','image','general','2026-07-12 09:17:34','2026-07-12 09:22:00'),(5,'site_favicon','assets/images/favicon.ico','image','general','2026-07-12 09:17:34','2026-07-12 09:17:34'),(6,'contact_email','support@tap2order.com','text','contact','2026-07-12 09:17:34','2026-07-12 11:02:51'),(7,'contact_phone','077 336 1788','text','contact','2026-07-12 09:17:34','2026-07-12 11:02:50'),(8,'contact_whatsapp','0773361788','text','contact','2026-07-12 09:17:34','2026-07-12 11:02:51'),(9,'contact_address','123 Business Ave, Tech City, TC 10001','text','contact','2026-07-12 09:17:34','2026-07-12 09:17:34'),(10,'social_facebook','https://facebook.com/tap2order','text','social','2026-07-12 09:17:34','2026-07-12 09:17:34'),(11,'social_instagram','https://instagram.com/tap2order','text','social','2026-07-12 09:17:34','2026-07-12 09:17:34'),(12,'social_twitter','https://twitter.com/tap2order','text','social','2026-07-12 09:17:34','2026-07-12 09:17:34'),(13,'social_linkedin','https://linkedin.com/company/tap2order','text','social','2026-07-12 09:17:34','2026-07-12 09:17:34'),(14,'social_youtube','https://youtube.com/@tap2order','text','social','2026-07-12 09:17:34','2026-07-12 09:17:34'),(15,'primary_color','#E63946','color','appearance','2026-07-12 09:17:34','2026-07-12 09:17:34'),(16,'secondary_color','#1D3557','color','appearance','2026-07-12 09:17:34','2026-07-12 09:17:34'),(17,'accent_color','#F1FAEE','color','appearance','2026-07-12 09:17:34','2026-07-12 09:17:34'),(18,'meta_title','Tap2Order - QR Menu & Ordering Platform for Restaurants','text','seo','2026-07-12 09:17:34','2026-07-12 09:17:34'),(19,'meta_description','Transform your restaurant with smart QR menus and online ordering. Tap2Order makes it easy to go digital.','text','seo','2026-07-12 09:17:34','2026-07-12 09:17:34'),(20,'meta_keywords','QR menu, restaurant ordering, digital menu, online ordering, restaurant platform','text','seo','2026-07-12 09:17:34','2026-07-12 09:17:34'),(21,'google_analytics_id','','text','analytics','2026-07-12 09:17:34','2026-07-12 09:17:34'),(22,'facebook_pixel_id','','text','analytics','2026-07-12 09:17:34','2026-07-12 09:17:34'),(23,'terms_page_url','/pages/terms','text','legal','2026-07-12 09:17:34','2026-07-12 09:17:34'),(24,'privacy_page_url','/pages/privacy','text','legal','2026-07-12 09:17:34','2026-07-12 09:17:34'),(25,'copyright_text','© 2026 Tap2Order. All rights reserved.','text','general','2026-07-12 09:17:34','2026-07-12 09:17:34');
/*!40000 ALTER TABLE `website_settings` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-07-12 17:45:28
