diff --git a/admin/ads.php b/admin/ads.php index 69a4d96..d107372 100644 --- a/admin/ads.php +++ b/admin/ads.php @@ -1,5 +1,6 @@ '); - printWindow.document.write(''); - printWindow.document.write(content); - printWindow.document.write(''); - printWindow.document.close(); - setTimeout(() => { - printWindow.print(); - printWindow.close(); - }, 500); + const img = document.querySelector('#qrcode img'); + if (!img) return; + + const win = window.open('', '_blank'); + win.document.write(''); + win.document.write('

' + document.getElementById('qrTableNumber').innerText + '

'); + win.document.write(''); + win.document.write('

Scan to Order

'); + win.document.write(''); + win.document.close(); + win.print(); + win.close(); } diff --git a/admin/user_groups.php b/admin/user_groups.php index 0752dfa..87e4282 100644 --- a/admin/user_groups.php +++ b/admin/user_groups.php @@ -1,5 +1,6 @@ { const statusClass = table.is_occupied ? "btn-outline-danger" : "btn-outline-success"; col.innerHTML = ` @@ -516,7 +516,7 @@ document.addEventListener('DOMContentLoaded', () => { price: parseFloat(product.price), base_price: parseFloat(product.price), hasVariants: false, quantity: 1, variant_id: null, variant_name: null, is_loyalty: parseInt(product.is_loyalty) === 1, - vat_percent: parseFloat(product.vat_percent || 0) + vat_percent: parseFloat(product.vat_percent || settings.vat_rate || 0) }); } }; @@ -540,7 +540,7 @@ document.addEventListener('DOMContentLoaded', () => { price: finalPrice, base_price: parseFloat(product.price), hasVariants: true, quantity: 1, variant_id: v.id, variant_name: v.name, is_loyalty: parseInt(product.is_loyalty) === 1, - vat_percent: parseFloat(product.vat_percent || 0) + vat_percent: parseFloat(product.vat_percent || settings.vat_rate || 0) }); variantSelectionModal.hide(); }; @@ -587,7 +587,8 @@ document.addEventListener('DOMContentLoaded', () => { cartItemsContainer.innerHTML = `

${_t('cart_empty')}

`; if (cartSubtotal) cartSubtotal.innerText = formatCurrency(0); if (cartVatAmount) cartVatAmount.innerText = formatCurrency(0); - if (cartVatRow) cartVatRow.classList.add('d-none'); + // Always show VAT row even if 0 + if (cartVatRow) cartVatRow.classList.remove('d-none'); if (cartTotalPrice) cartTotalPrice.innerText = formatCurrency(0); if (quickOrderBtn) { quickOrderBtn.disabled = true; quickOrderBtn.innerText = _t('quick_pay'); } if (placeOrderBtn) { placeOrderBtn.disabled = true; placeOrderBtn.innerText = _t('save_bill'); } @@ -629,10 +630,8 @@ document.addEventListener('DOMContentLoaded', () => { if (cartSubtotal) cartSubtotal.innerText = formatCurrency(subtotal); if (cartVatAmount) cartVatAmount.innerText = formatCurrency(totalVat); - if (cartVatRow) { - if (totalVat > 0) cartVatRow.classList.remove('d-none'); - else cartVatRow.classList.add('d-none'); - } + // Always show VAT row + if (cartVatRow) cartVatRow.classList.remove('d-none'); if (cartVatInput) cartVatInput.value = totalVat.toFixed(3); const total = subtotal + totalVat; @@ -805,6 +804,8 @@ document.addEventListener('DOMContentLoaded', () => { const loyaltyHtml = data.loyaltyRedeemed ? `
* Loyalty Reward Applied *
` : ''; const logoHtml = settings.logo_url ? `` : ''; + + const vatRate = settings.vat_rate || 0; const html = ` @@ -860,7 +861,7 @@ document.addEventListener('DOMContentLoaded', () => {
- ${Math.abs(data.vat) > 0 ? `` : ''} +
Subtotal / ${tr['Subtotal']}${formatCurrency(data.subtotal)}
VAT / ${tr['VAT']}${formatCurrency(Math.abs(data.vat))}
VAT (${vatRate}%) / ${tr['VAT']}${formatCurrency(Math.abs(data.vat))}
TOTAL / ${tr['TOTAL']}${formatCurrency(data.total)}
@@ -889,4 +890,4 @@ document.addEventListener('DOMContentLoaded', () => { const modal = new bootstrap.Modal(document.getElementById('qrRatingModal')); modal.show(); }; -}); \ No newline at end of file +}); diff --git a/db/migrate.php b/db/migrate.php new file mode 100644 index 0000000..1e8e992 --- /dev/null +++ b/db/migrate.php @@ -0,0 +1,45 @@ +exec("CREATE TABLE IF NOT EXISTS migrations ( + id INT AUTO_INCREMENT PRIMARY KEY, + migration_name VARCHAR(255) NOT NULL UNIQUE, + applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +)"); + +$migrations_folder = array_diff(scandir(__DIR__ . '/migrations'), ['.', '..']); +sort($migrations_folder); + +$applied_migrations = $pdo->query("SELECT migration_name FROM migrations")->fetchAll(PDO::FETCH_COLUMN); + +foreach ($migrations_folder as $migration) { + if (!in_array($migration, $applied_migrations)) { + echo "Applying migration: $migration\n"; + $sql = file_get_contents(__DIR__ . '/migrations/' . $migration); + + try { + if (!empty(trim($sql))) { + $pdo->exec($sql); + } + $stmt = $pdo->prepare("INSERT INTO migrations (migration_name) VALUES (?)"); + $stmt->execute([$migration]); + echo "Successfully applied $migration\n"; + } catch (Exception $e) { + echo "Error applying $migration: " . $e->getMessage() . "\n"; + // If it's a "Duplicate column name" error, we can assume it was applied manually and just record it + if (strpos($e->getMessage(), 'Duplicate column name') !== false || strpos($e->getMessage(), 'already exists') !== false) { + echo "Column/Table already exists, recording as applied.\n"; + $stmt = $pdo->prepare("INSERT INTO migrations (migration_name) VALUES (?)"); + $stmt->execute([$migration]); + } else { + // For other errors, we might want to stop or continue + echo "Stopping migrations due to error.\n"; + break; + } + } + } +} +echo "Migration process finished.\n"; + diff --git a/includes/lang.php b/includes/lang.php index 250d029..a5f23a3 100644 --- a/includes/lang.php +++ b/includes/lang.php @@ -108,6 +108,7 @@ function t($key, $lang = null) { 'orders' => 'Orders', 'kitchen' => 'Kitchen', 'switch' => 'Switch', + 'are_you_sure' => 'Are you sure?', ] ]; diff --git a/pos.php b/pos.php index 63aaad3..0071038 100644 --- a/pos.php +++ b/pos.php @@ -75,6 +75,8 @@ $loyalty_settings = $loyalty_stmt->fetch(PDO::FETCH_ASSOC); if (!$loyalty_settings) { $loyalty_settings = ['is_enabled' => 0, 'points_per_order' => 0, 'points_for_free_meal' => 0]; } + +$vat_rate = (float)($settings['vat_rate'] ?? 0); ?> @@ -327,7 +329,7 @@ if (!$loyalty_settings) {
- VAT + VAT (%)
diff --git a/storage/backups/backup_2026-02-26_18-54-32.sql b/storage/backups/backup_2026-02-26_18-54-32.sql new file mode 100644 index 0000000..7977c46 --- /dev/null +++ b/storage/backups/backup_2026-02-26_18-54-32.sql @@ -0,0 +1,1269 @@ +/*M!999999\- enable the sandbox mode */ +-- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64) +-- +-- Host: 127.0.0.1 Database: app_38682 +-- ------------------------------------------------------ +-- Server version 10.11.14-MariaDB-0+deb12u2 + +/*!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 `ads_images` +-- + +DROP TABLE IF EXISTS `ads_images`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `ads_images` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `image_path` varchar(255) NOT NULL, + `title` varchar(255) DEFAULT NULL, + `sort_order` int(11) DEFAULT 0, + `is_active` tinyint(1) DEFAULT 1, + `display_layout` enum('both','split','fullscreen') DEFAULT 'both', + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ads_images` +-- + +LOCK TABLES `ads_images` WRITE; +/*!40000 ALTER TABLE `ads_images` DISABLE KEYS */; +INSERT INTO `ads_images` VALUES +(1,'assets/images/ads/ad_699bf2574849b.jpeg','Summer Special',0,1,'both','2026-02-23 19:48:29'), +(2,'assets/images/ads/ad_699bf270e9a69.jpeg','New Burger Launch',0,1,'both','2026-02-23 19:48:29'); +/*!40000 ALTER TABLE `ads_images` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `areas` +-- + +DROP TABLE IF EXISTS `areas`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `areas` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `outlet_id` int(11) DEFAULT NULL, + `name` varchar(255) NOT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + KEY `outlet_id` (`outlet_id`), + CONSTRAINT `areas_ibfk_1` FOREIGN KEY (`outlet_id`) REFERENCES `outlets` (`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 `areas` +-- + +LOCK TABLES `areas` WRITE; +/*!40000 ALTER TABLE `areas` DISABLE KEYS */; +INSERT INTO `areas` VALUES +(1,1,'Main Dining Area','2026-02-23 19:48:28',0), +(2,1,'Patio','2026-02-23 19:48:28',0), +(3,2,'Indoor Section','2026-02-23 19:48:28',0); +/*!40000 ALTER TABLE `areas` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `attendance_logs` +-- + +DROP TABLE IF EXISTS `attendance_logs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `attendance_logs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) DEFAULT NULL, + `employee_id` varchar(50) DEFAULT NULL, + `log_timestamp` datetime DEFAULT NULL, + `log_type` enum('IN','OUT','OTHER') DEFAULT 'IN', + `device_id` varchar(100) DEFAULT NULL, + `ip_address` varchar(45) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `user_id` (`user_id`), + CONSTRAINT `attendance_logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `attendance_logs` +-- + +LOCK TABLES `attendance_logs` WRITE; +/*!40000 ALTER TABLE `attendance_logs` DISABLE KEYS */; +/*!40000 ALTER TABLE `attendance_logs` 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 = utf8mb4 */; +CREATE TABLE `categories` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `name_ar` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `sort_order` int(11) DEFAULT 0, + `image_url` varchar(255) DEFAULT NULL, + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 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 */; +INSERT INTO `categories` VALUES +(1,'Burgers',NULL,NULL,1,NULL,0), +(2,'Sides',NULL,NULL,2,NULL,0), +(3,'Drinks',NULL,NULL,3,NULL,0), +(4,'Desserts',NULL,NULL,4,NULL,0), +(5,'Salads',NULL,NULL,5,NULL,0), +(6,'Pasta',NULL,NULL,6,NULL,1); +/*!40000 ALTER TABLE `categories` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `company_settings` +-- + +DROP TABLE IF EXISTS `company_settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `company_settings` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `company_name` varchar(255) NOT NULL DEFAULT 'My Restaurant', + `address` text DEFAULT NULL, + `phone` varchar(50) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `vat_rate` decimal(5,2) DEFAULT 0.00, + `currency_symbol` varchar(10) DEFAULT '$', + `currency_decimals` int(11) DEFAULT 2, + `logo_url` varchar(255) DEFAULT NULL, + `favicon_url` varchar(255) DEFAULT NULL, + `ctr_number` varchar(50) DEFAULT NULL, + `vat_number` varchar(50) DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `auto_backup_enabled` tinyint(1) DEFAULT 0, + `last_auto_backup` timestamp NULL DEFAULT NULL, + `commission_enabled` tinyint(1) DEFAULT 0, + `currency_position` enum('before','after') DEFAULT 'after', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `company_settings` +-- + +LOCK TABLES `company_settings` WRITE; +/*!40000 ALTER TABLE `company_settings` DISABLE KEYS */; +INSERT INTO `company_settings` VALUES +(1,'Al-Bidar Cafe','al -hamra','99359472','aalabry@gmail.com',5.00,'OMR',3,'assets/images/company/logo_699d0d4e79490.png','assets/images/company/favicon_699d0d4e7a2f6.png','','OM99888','2026-02-26 17:16:47',0,'2026-02-24 05:08:07',0,'after'); +/*!40000 ALTER TABLE `company_settings` 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 = utf8mb4 */; +CREATE TABLE `customers` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `phone` varchar(20) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `points` int(11) DEFAULT 0, + `loyalty_redemptions_count` int(11) DEFAULT 0, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `address` text DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phone` (`phone`) +) ENGINE=InnoDB AUTO_INCREMENT=10 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 */; +INSERT INTO `customers` VALUES +(1,'John Doe','5551234','john@example.com',50,0,'2026-02-23 19:48:28',NULL), +(2,'Jane Smith','5555678','jane@example.com',120,0,'2026-02-23 19:48:28',NULL), +(3,'Michael Brown','5558765','michael@example.com',15,0,'2026-02-23 19:48:28',NULL), +(4,'Emily Davis','5554321','emily@example.com',85,0,'2026-02-23 19:48:28',NULL), +(5,'Chris Wilson','5551111','chris@example.com',0,0,'2026-02-23 19:48:28',NULL), +(6,'Sarah Miller','5552222','sarah@example.com',200,0,'2026-02-23 19:48:28',NULL), +(7,'David Taylor','5553333','david@example.com',30,0,'2026-02-23 19:48:28',NULL), +(8,'moosa','99359472','laura@example.com',105,3,'2026-02-23 19:48:28',''), +(9,'Salim','66666666',NULL,10,0,'2026-02-24 17:58:16',NULL); +/*!40000 ALTER TABLE `customers` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `expense_categories` +-- + +DROP TABLE IF EXISTS `expense_categories`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `expense_categories` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `name_ar` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `expense_categories` +-- + +LOCK TABLES `expense_categories` WRITE; +/*!40000 ALTER TABLE `expense_categories` DISABLE KEYS */; +INSERT INTO `expense_categories` VALUES +(1,'Utilities',NULL,'Electricity, Water, Gas','2026-02-23 19:48:29',0), +(2,'Rent',NULL,'Monthly outlet rent','2026-02-23 19:48:29',0), +(3,'Supplies',NULL,'Cleaning and office supplies','2026-02-23 19:48:29',0), +(4,'Marketing',NULL,'Advertisements and promotions','2026-02-23 19:48:29',0); +/*!40000 ALTER TABLE `expense_categories` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `expenses` +-- + +DROP TABLE IF EXISTS `expenses`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `expenses` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `category_id` int(11) NOT NULL, + `outlet_id` int(11) NOT NULL, + `amount` decimal(10,2) NOT NULL, + `description` text DEFAULT NULL, + `expense_date` date NOT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `category_id` (`category_id`), + KEY `outlet_id` (`outlet_id`), + CONSTRAINT `expenses_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `expense_categories` (`id`), + CONSTRAINT `expenses_ibfk_2` FOREIGN KEY (`outlet_id`) REFERENCES `outlets` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `expenses` +-- + +LOCK TABLES `expenses` WRITE; +/*!40000 ALTER TABLE `expenses` DISABLE KEYS */; +INSERT INTO `expenses` VALUES +(1,3,2,194.31,'Sample expense for 2026-02-20','2026-02-20','2026-02-23 19:48:29'), +(2,3,4,467.60,'Sample expense for 2026-01-28','2026-01-28','2026-02-23 19:48:29'), +(3,3,2,470.68,'Sample expense for 2026-02-18','2026-02-18','2026-02-23 19:48:29'), +(4,4,1,377.27,'Sample expense for 2026-02-14','2026-02-14','2026-02-23 19:48:29'), +(5,2,3,92.16,'Sample expense for 2026-02-08','2026-02-08','2026-02-23 19:48:29'), +(6,3,3,250.49,'Sample expense for 2026-02-02','2026-02-02','2026-02-23 19:48:29'), +(7,3,4,423.19,'Sample expense for 2026-02-13','2026-02-13','2026-02-23 19:48:29'), +(8,3,3,247.94,'Sample expense for 2026-02-15','2026-02-15','2026-02-23 19:48:29'), +(9,1,2,244.02,'Sample expense for 2026-01-30','2026-01-30','2026-02-23 19:48:29'), +(10,4,3,228.07,'Sample expense for 2026-02-21','2026-02-21','2026-02-23 19:48:29'), +(11,1,3,398.84,'Sample expense for 2026-02-13','2026-02-13','2026-02-23 19:48:29'), +(12,1,3,450.92,'Sample expense for 2026-02-20','2026-02-20','2026-02-23 19:48:29'), +(13,1,2,379.73,'Sample expense for 2026-02-05','2026-02-05','2026-02-23 19:48:29'), +(14,2,2,440.60,'Sample expense for 2026-01-29','2026-01-29','2026-02-23 19:48:29'), +(15,3,2,185.03,'Sample expense for 2026-01-27','2026-01-27','2026-02-23 19:48:29'); +/*!40000 ALTER TABLE `expenses` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `integration_settings` +-- + +DROP TABLE IF EXISTS `integration_settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `integration_settings` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `provider` varchar(50) NOT NULL, + `setting_key` varchar(100) NOT NULL, + `setting_value` text DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `unique_provider_key` (`provider`,`setting_key`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `integration_settings` +-- + +LOCK TABLES `integration_settings` WRITE; +/*!40000 ALTER TABLE `integration_settings` DISABLE KEYS */; +INSERT INTO `integration_settings` VALUES +(1,'wablas','domain','https://deu.wablas.com/','2026-02-24 02:31:26'), +(2,'wablas','token','xOSMYzXiM9uABP0zcoALzlGJjKsRBaLCS2paBAE2kyECNNJkCQbgMW8','2026-02-24 02:31:26'), +(3,'wablas','secret_key','ZBtnBwfm','2026-02-24 02:31:26'), +(4,'wablas','order_template','Dear *{customer_name}*,\r\n\r\nThank you for dining with *{company_name}*! 🍽️\r\n\r\n*Order Details:*\r\n{order_details}\r\n\r\nTotal: *{total_amount}* OMR\r\n\r\nYou\'ve earned *{points_earned} points* with this order.\r\n💰 *Current Balance: {new_balance} points*','2026-02-24 02:31:26'), +(5,'wablas','is_enabled','0','2026-02-24 02:31:26'); +/*!40000 ALTER TABLE `integration_settings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `loyalty_points_history` +-- + +DROP TABLE IF EXISTS `loyalty_points_history`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `loyalty_points_history` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `customer_id` int(11) NOT NULL, + `order_id` int(11) DEFAULT NULL, + `points_change` int(11) NOT NULL, + `reason` varchar(255) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `customer_id` (`customer_id`), + KEY `order_id` (`order_id`), + CONSTRAINT `loyalty_points_history_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE, + CONSTRAINT `loyalty_points_history_ibfk_2` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `loyalty_points_history` +-- + +LOCK TABLES `loyalty_points_history` WRITE; +/*!40000 ALTER TABLE `loyalty_points_history` DISABLE KEYS */; +INSERT INTO `loyalty_points_history` VALUES +(1,8,63,10,'Earned from Order','2026-02-24 17:53:23'), +(2,9,64,10,'Earned from Order','2026-02-24 18:01:20'), +(3,8,68,30,'Earned from Products','2026-02-25 19:03:00'), +(4,8,69,20,'Earned from Products','2026-02-25 19:03:33'), +(5,8,70,30,'Earned from Products','2026-02-25 19:07:21'), +(6,8,71,-70,'Redeemed Free Product','2026-02-25 19:12:01'), +(7,8,71,10,'Earned from Products','2026-02-25 19:12:01'), +(8,8,72,20,'Earned from Products','2026-02-25 19:19:48'), +(9,8,73,30,'Earned from Products','2026-02-25 19:20:11'), +(10,8,74,-70,'Redeemed Free Product(s)','2026-02-25 19:20:58'), +(11,8,75,60,'Earned from Products','2026-02-25 19:30:47'), +(12,8,76,20,'Earned from Products','2026-02-25 19:50:09'); +/*!40000 ALTER TABLE `loyalty_points_history` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `loyalty_settings` +-- + +DROP TABLE IF EXISTS `loyalty_settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `loyalty_settings` ( + `id` int(11) NOT NULL, + `points_per_order` int(11) DEFAULT 10, + `points_for_free_meal` int(11) DEFAULT 70, + `is_enabled` tinyint(1) DEFAULT 1, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `loyalty_settings` +-- + +LOCK TABLES `loyalty_settings` WRITE; +/*!40000 ALTER TABLE `loyalty_settings` DISABLE KEYS */; +INSERT INTO `loyalty_settings` VALUES +(1,10,70,1); +/*!40000 ALTER TABLE `loyalty_settings` 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 = utf8mb4 */; +CREATE TABLE `migrations` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `migration_name` varchar(255) NOT NULL, + `applied_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `migration_name` (`migration_name`) +) ENGINE=InnoDB AUTO_INCREMENT=24 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,'001_add_payments.sql','2026-02-23 19:40:07'), +(2,'003_add_payment_type_to_orders.sql','2026-02-23 19:40:07'), +(3,'004_seed_payment_types.sql','2026-02-23 19:40:07'), +(4,'006_integration_settings.sql','2026-02-23 19:40:07'), +(5,'007_add_loyalty_payment_type.sql','2026-02-23 19:40:07'), +(6,'008_user_system.sql','2026-02-23 19:40:07'), +(7,'009_user_outlets.sql','2026-02-23 19:40:07'), +(8,'010_ads_images.sql','2026-02-23 19:40:07'), +(9,'011_add_user_id_to_orders.sql','2026-02-23 19:40:07'), +(10,'012_expenses_schema.sql','2026-02-23 19:40:07'), +(11,'013_product_promotions.sql','2026-02-23 19:40:07'), +(12,'015_add_redemptions_to_customers.sql','2026-02-23 19:40:07'), +(13,'016_add_profile_pic_to_users.sql','2026-02-23 19:40:07'), +(14,'017_attendance_system.sql','2026-02-23 19:40:07'), +(15,'018_add_cost_price_to_products.sql','2026-02-23 19:40:07'), +(16,'019_purchase_module.sql','2026-02-23 19:40:07'), +(17,'020_staff_ratings.sql','2026-02-23 19:40:07'), +(18,'021_add_is_ratable_to_users.sql','2026-02-23 19:40:07'), +(19,'022_service_ratings.sql','2026-02-23 19:40:07'), +(20,'002_add_customer_id_to_orders.sql','2026-02-23 19:40:26'), +(21,'005_loyalty_schema.sql','2026-02-23 19:40:26'), +(22,'014_loyalty_toggle.sql','2026-02-23 19:40:26'), +(23,'023_add_image_url_to_categories.sql','2026-02-23 19:40:26'); +/*!40000 ALTER TABLE `migrations` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `order_items` +-- + +DROP TABLE IF EXISTS `order_items`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `order_items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `order_id` int(11) DEFAULT NULL, + `product_id` int(11) DEFAULT NULL, + `product_name` varchar(255) DEFAULT NULL, + `variant_id` int(11) DEFAULT NULL, + `variant_name` varchar(255) DEFAULT NULL, + `quantity` int(11) NOT NULL, + `unit_price` decimal(10,2) NOT NULL, + `vat_percent` decimal(5,2) DEFAULT 0.00, + `vat_amount` decimal(10,3) DEFAULT 0.000, + PRIMARY KEY (`id`), + KEY `order_id` (`order_id`), + KEY `order_items_ibfk_2` (`product_id`), + CONSTRAINT `order_items_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`), + CONSTRAINT `order_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB AUTO_INCREMENT=173 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `order_items` +-- + +LOCK TABLES `order_items` WRITE; +/*!40000 ALTER TABLE `order_items` DISABLE KEYS */; +INSERT INTO `order_items` VALUES +(1,1,4,'Craft Cola',NULL,NULL,2,3.50,0.00,0.000), +(2,2,12,'Spaghetti Carbonara',NULL,NULL,2,13.99,0.00,0.000), +(3,3,3,'Truffle Fries',NULL,NULL,1,5.99,0.00,0.000), +(4,4,2,'Veggie Delight',NULL,NULL,3,11.50,0.00,0.000), +(5,4,3,'Truffle Fries',NULL,NULL,3,5.99,0.00,0.000), +(6,5,13,'Penne Arrabbiata',NULL,NULL,2,12.50,0.00,0.000), +(7,5,9,'NY Cheesecake',NULL,NULL,3,6.99,0.00,0.000), +(8,5,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(9,6,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(10,7,13,'Penne Arrabbiata',NULL,NULL,2,12.50,0.00,0.000), +(11,8,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(12,8,10,'Caesar Salad',NULL,NULL,3,9.50,0.00,0.000), +(13,8,4,'Craft Cola',NULL,NULL,2,3.50,0.00,0.000), +(14,8,3,'Truffle Fries',NULL,NULL,3,5.99,0.00,0.000), +(15,9,10,'Caesar Salad',NULL,NULL,3,9.50,0.00,0.000), +(16,10,5,'Double Bacon Burger',NULL,NULL,2,15.99,0.00,0.000), +(17,10,1,'Signature Burger',NULL,NULL,3,12.99,0.00,0.000), +(18,11,3,'Truffle Fries',NULL,NULL,2,5.99,0.00,0.000), +(19,11,1,'Signature Burger',NULL,NULL,3,12.99,0.00,0.000), +(20,11,6,'Sweet Potato Fries',NULL,NULL,3,6.50,0.00,0.000), +(21,11,11,'Greek Salad',NULL,NULL,3,10.50,0.00,0.000), +(22,12,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(23,12,4,'Craft Cola',NULL,NULL,3,3.50,0.00,0.000), +(24,12,5,'Double Bacon Burger',NULL,NULL,3,15.99,0.00,0.000), +(25,13,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(26,13,8,'Chocolate Lava Cake',NULL,NULL,2,7.99,0.00,0.000), +(27,13,2,'Veggie Delight',NULL,NULL,3,11.50,0.00,0.000), +(28,13,1,'Signature Burger',NULL,NULL,3,12.99,0.00,0.000), +(29,14,2,'Veggie Delight',NULL,NULL,2,11.50,0.00,0.000), +(30,14,10,'Caesar Salad',NULL,NULL,3,9.50,0.00,0.000), +(31,14,8,'Chocolate Lava Cake',NULL,NULL,1,7.99,0.00,0.000), +(32,15,12,'Spaghetti Carbonara',NULL,NULL,1,13.99,0.00,0.000), +(33,15,9,'NY Cheesecake',NULL,NULL,3,6.99,0.00,0.000), +(34,15,6,'Sweet Potato Fries',NULL,NULL,3,6.50,0.00,0.000), +(35,15,10,'Caesar Salad',NULL,NULL,2,9.50,0.00,0.000), +(36,16,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(37,17,12,'Spaghetti Carbonara',NULL,NULL,2,13.99,0.00,0.000), +(38,17,6,'Sweet Potato Fries',NULL,NULL,2,6.50,0.00,0.000), +(39,17,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(40,18,1,'Signature Burger',NULL,NULL,1,12.99,0.00,0.000), +(41,18,5,'Double Bacon Burger',NULL,NULL,3,15.99,0.00,0.000), +(42,18,10,'Caesar Salad',NULL,NULL,1,9.50,0.00,0.000), +(43,18,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(44,19,2,'Veggie Delight',NULL,NULL,1,11.50,0.00,0.000), +(45,20,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(46,21,3,'Truffle Fries',NULL,NULL,3,5.99,0.00,0.000), +(47,21,1,'Signature Burger',NULL,NULL,3,12.99,0.00,0.000), +(48,22,9,'NY Cheesecake',NULL,NULL,3,6.99,0.00,0.000), +(49,22,1,'Signature Burger',NULL,NULL,3,12.99,0.00,0.000), +(50,22,11,'Greek Salad',NULL,NULL,3,10.50,0.00,0.000), +(51,22,5,'Double Bacon Burger',NULL,NULL,2,15.99,0.00,0.000), +(52,23,13,'Penne Arrabbiata',NULL,NULL,2,12.50,0.00,0.000), +(53,23,11,'Greek Salad',NULL,NULL,3,10.50,0.00,0.000), +(54,23,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(55,23,6,'Sweet Potato Fries',NULL,NULL,3,6.50,0.00,0.000), +(56,24,6,'Sweet Potato Fries',NULL,NULL,3,6.50,0.00,0.000), +(57,24,13,'Penne Arrabbiata',NULL,NULL,2,12.50,0.00,0.000), +(58,25,1,'Signature Burger',NULL,NULL,3,12.99,0.00,0.000), +(59,25,5,'Double Bacon Burger',NULL,NULL,3,15.99,0.00,0.000), +(60,25,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(61,25,2,'Veggie Delight',NULL,NULL,1,11.50,0.00,0.000), +(62,26,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(63,26,10,'Caesar Salad',NULL,NULL,1,9.50,0.00,0.000), +(64,27,9,'NY Cheesecake',NULL,NULL,2,6.99,0.00,0.000), +(65,27,4,'Craft Cola',NULL,NULL,1,3.50,0.00,0.000), +(66,28,8,'Chocolate Lava Cake',NULL,NULL,2,7.99,0.00,0.000), +(67,28,10,'Caesar Salad',NULL,NULL,3,9.50,0.00,0.000), +(68,28,5,'Double Bacon Burger',NULL,NULL,1,15.99,0.00,0.000), +(69,29,7,'Lemon Iced Tea',NULL,NULL,2,3.99,0.00,0.000), +(70,29,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(71,29,6,'Sweet Potato Fries',NULL,NULL,2,6.50,0.00,0.000), +(72,30,9,'NY Cheesecake',NULL,NULL,2,6.99,0.00,0.000), +(73,30,10,'Caesar Salad',NULL,NULL,2,9.50,0.00,0.000), +(74,30,12,'Spaghetti Carbonara',NULL,NULL,3,13.99,0.00,0.000), +(75,31,8,'Chocolate Lava Cake',NULL,NULL,1,7.99,0.00,0.000), +(76,31,1,'Signature Burger',NULL,NULL,3,12.99,0.00,0.000), +(77,31,13,'Penne Arrabbiata',NULL,NULL,2,12.50,0.00,0.000), +(78,32,1,'Signature Burger',NULL,NULL,2,12.99,0.00,0.000), +(79,32,3,'Truffle Fries',NULL,NULL,3,5.99,0.00,0.000), +(80,33,5,'Double Bacon Burger',NULL,NULL,3,15.99,0.00,0.000), +(81,34,11,'Greek Salad',NULL,NULL,2,10.50,0.00,0.000), +(82,34,5,'Double Bacon Burger',NULL,NULL,1,15.99,0.00,0.000), +(83,34,10,'Caesar Salad',NULL,NULL,1,9.50,0.00,0.000), +(84,35,2,'Veggie Delight',NULL,NULL,3,11.50,0.00,0.000), +(85,35,7,'Lemon Iced Tea',NULL,NULL,1,3.99,0.00,0.000), +(86,36,1,'Signature Burger',NULL,NULL,2,12.99,0.00,0.000), +(87,36,11,'Greek Salad',NULL,NULL,2,10.50,0.00,0.000), +(88,36,13,'Penne Arrabbiata',NULL,NULL,2,12.50,0.00,0.000), +(89,36,6,'Sweet Potato Fries',NULL,NULL,3,6.50,0.00,0.000), +(90,37,5,'Double Bacon Burger',NULL,NULL,3,15.99,0.00,0.000), +(91,37,2,'Veggie Delight',NULL,NULL,2,11.50,0.00,0.000), +(92,37,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(93,38,4,'Craft Cola',NULL,NULL,3,3.50,0.00,0.000), +(94,38,10,'Caesar Salad',NULL,NULL,2,9.50,0.00,0.000), +(95,38,2,'Veggie Delight',NULL,NULL,3,11.50,0.00,0.000), +(96,38,3,'Truffle Fries',NULL,NULL,1,5.99,0.00,0.000), +(97,39,5,'Double Bacon Burger',NULL,NULL,2,15.99,0.00,0.000), +(98,40,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(99,41,4,'Craft Cola',NULL,NULL,1,3.50,0.00,0.000), +(100,41,6,'Sweet Potato Fries',NULL,NULL,1,6.50,0.00,0.000), +(101,42,12,'Spaghetti Carbonara',NULL,NULL,2,13.99,0.00,0.000), +(102,43,3,'Truffle Fries',NULL,NULL,1,5.99,0.00,0.000), +(103,43,11,'Greek Salad',NULL,NULL,2,10.50,0.00,0.000), +(104,43,6,'Sweet Potato Fries',NULL,NULL,3,6.50,0.00,0.000), +(105,43,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(106,44,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(107,45,8,'Chocolate Lava Cake',NULL,NULL,3,7.99,0.00,0.000), +(108,46,11,'Greek Salad',NULL,NULL,3,10.50,0.00,0.000), +(109,46,13,'Penne Arrabbiata',NULL,NULL,3,12.50,0.00,0.000), +(110,47,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(111,48,6,'Sweet Potato Fries',NULL,NULL,1,6.50,0.00,0.000), +(112,49,2,'Veggie Delight',NULL,NULL,2,11.50,0.00,0.000), +(113,50,3,'Truffle Fries',NULL,NULL,3,5.99,0.00,0.000), +(114,50,6,'Sweet Potato Fries',NULL,NULL,1,6.50,0.00,0.000), +(115,51,6,'Sweet Potato Fries',NULL,NULL,1,6.50,0.00,0.000), +(116,51,3,'Truffle Fries',NULL,NULL,1,5.99,0.00,0.000), +(117,51,5,'Double Bacon Burger',NULL,NULL,1,15.99,0.00,0.000), +(118,52,3,'Truffle Fries',NULL,NULL,1,5.99,0.00,0.000), +(119,52,5,'Double Bacon Burger',NULL,NULL,1,15.99,0.00,0.000), +(120,52,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(121,53,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(122,53,8,'Chocolate Lava Cake',NULL,NULL,1,7.99,0.00,0.000), +(123,54,1,'Signature Burger',NULL,NULL,1,12.99,0.00,0.000), +(124,55,5,'Double Bacon Burger',NULL,NULL,1,15.99,0.00,0.000), +(125,55,1,'Signature Burger',NULL,NULL,1,12.99,0.00,0.000), +(126,56,10,'Caesar Salad',NULL,NULL,1,9.50,0.00,0.000), +(127,56,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(128,56,8,'Chocolate Lava Cake',NULL,NULL,1,7.99,0.00,0.000), +(129,56,7,'Lemon Iced Tea',NULL,NULL,1,3.99,0.00,0.000), +(130,56,4,'Craft Cola',NULL,NULL,1,3.50,0.00,0.000), +(131,56,11,'Greek Salad',NULL,NULL,1,10.50,0.00,0.000), +(132,56,12,'Spaghetti Carbonara',NULL,NULL,1,13.99,0.00,0.000), +(133,56,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(134,57,3,'Truffle Fries',NULL,NULL,1,5.99,0.00,0.000), +(135,57,6,'Sweet Potato Fries',NULL,NULL,1,6.50,0.00,0.000), +(136,58,6,'Sweet Potato Fries',NULL,NULL,1,6.50,0.00,0.000), +(137,59,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(138,59,12,'Spaghetti Carbonara',NULL,NULL,1,13.99,0.00,0.000), +(139,60,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(140,61,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(141,62,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(142,63,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(143,64,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(144,64,12,'Spaghetti Carbonara',NULL,NULL,1,13.99,0.00,0.000), +(145,65,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(146,65,12,'Spaghetti Carbonara',NULL,NULL,1,13.99,0.00,0.000), +(147,66,12,'Spaghetti Carbonara',NULL,NULL,1,13.99,0.00,0.000), +(148,66,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(149,67,1,'Signature Burger',NULL,NULL,2,12.99,0.00,0.000), +(150,67,2,'Veggie Delight',NULL,NULL,2,11.50,0.00,0.000), +(151,68,10,'Caesar Salad',NULL,NULL,2,9.50,0.00,0.000), +(152,68,8,'Chocolate Lava Cake',NULL,NULL,1,7.99,0.00,0.000), +(153,69,10,'Caesar Salad',NULL,NULL,2,9.50,0.00,0.000), +(154,69,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(155,70,10,'Caesar Salad',NULL,NULL,2,9.50,0.00,0.000), +(156,70,8,'Chocolate Lava Cake',NULL,NULL,1,7.99,0.00,0.000), +(157,71,10,'Caesar Salad',NULL,NULL,1,9.50,0.00,0.000), +(158,71,10,'Caesar Salad',NULL,NULL,1,0.00,0.00,0.000), +(159,72,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(160,72,8,'Chocolate Lava Cake',NULL,NULL,2,7.99,0.00,0.000), +(161,73,10,'Caesar Salad',NULL,NULL,3,9.50,0.00,0.000), +(162,74,6,'Sweet Potato Fries',NULL,NULL,1,6.50,0.00,0.000), +(163,74,10,'Caesar Salad',NULL,NULL,1,0.00,0.00,0.000), +(164,75,10,'Caesar Salad',NULL,NULL,6,9.50,0.00,0.000), +(165,76,8,'Chocolate Lava Cake',NULL,NULL,1,7.99,0.00,0.000), +(166,76,9,'NY Cheesecake',NULL,NULL,1,6.99,0.00,0.000), +(167,76,10,'Caesar Salad',NULL,NULL,1,9.50,0.00,0.000), +(168,76,6,'Sweet Potato Fries',NULL,NULL,1,6.50,0.00,0.000), +(169,77,13,'Penne Arrabbiata',NULL,NULL,1,12.50,0.00,0.000), +(170,77,8,'Chocolate Lava Cake',NULL,NULL,1,7.99,0.00,0.000), +(171,77,12,'Spaghetti Carbonara',NULL,NULL,1,13.99,0.00,0.000), +(172,78,10,'Caesar Salad',NULL,NULL,1,9.50,5.00,0.475); +/*!40000 ALTER TABLE `order_items` 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 = utf8mb4 */; +CREATE TABLE `orders` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `outlet_id` int(11) DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + `customer_id` int(11) DEFAULT NULL, + `table_id` int(11) DEFAULT NULL, + `table_number` varchar(50) DEFAULT NULL, + `order_type` enum('dine-in','delivery','drive-thru','takeaway') DEFAULT 'dine-in', + `status` enum('pending','preparing','ready','completed','cancelled') DEFAULT 'pending', + `payment_type_id` int(11) DEFAULT NULL, + `total_amount` decimal(10,2) NOT NULL, + `discount` decimal(10,2) DEFAULT 0.00, + `vat` decimal(10,3) DEFAULT 0.000, + `customer_name` varchar(255) DEFAULT NULL, + `customer_phone` varchar(50) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `commission_amount` decimal(10,2) DEFAULT 0.00, + PRIMARY KEY (`id`), + KEY `outlet_id` (`outlet_id`), + KEY `user_id` (`user_id`), + KEY `table_id` (`table_id`), + KEY `fk_orders_customer` (`customer_id`), + CONSTRAINT `fk_orders_customer` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL, + CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`outlet_id`) REFERENCES `outlets` (`id`), + CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL, + CONSTRAINT `orders_ibfk_3` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL, + CONSTRAINT `orders_ibfk_4` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=79 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 */; +INSERT INTO `orders` VALUES +(1,1,2,4,3,NULL,'takeaway','completed',1,7.00,0.00,0.000,NULL,NULL,'2026-02-17 12:56:39',0.00), +(2,2,3,NULL,3,NULL,'takeaway','cancelled',NULL,27.98,0.00,0.000,NULL,NULL,'2026-02-15 11:27:36',0.00), +(3,4,1,NULL,NULL,NULL,'delivery','preparing',NULL,5.99,0.00,0.000,NULL,NULL,'2026-01-26 21:23:42',0.00), +(4,1,2,7,1,NULL,'delivery','completed',NULL,52.47,0.00,0.000,NULL,NULL,'2026-01-29 12:30:10',0.00), +(5,1,2,NULL,4,NULL,'takeaway','completed',2,69.94,0.00,0.000,NULL,NULL,'2026-02-09 21:53:42',0.00), +(6,1,1,5,5,NULL,'delivery','completed',NULL,6.99,0.00,0.000,NULL,NULL,'2026-02-13 17:44:22',0.00), +(7,1,1,NULL,5,NULL,'delivery','completed',2,25.00,0.00,0.000,NULL,NULL,'2026-02-10 18:30:26',0.00), +(8,1,3,1,4,NULL,'takeaway','completed',1,60.46,0.00,0.000,NULL,NULL,'2026-01-27 12:58:30',0.00), +(9,1,2,8,4,NULL,'takeaway','completed',1,28.50,0.00,0.000,NULL,NULL,'2026-01-31 17:43:40',0.00), +(10,3,1,7,NULL,NULL,'dine-in','preparing',NULL,70.95,0.00,0.000,NULL,NULL,'2026-01-27 14:36:19',0.00), +(11,2,2,NULL,4,NULL,'takeaway','completed',1,101.95,0.00,0.000,NULL,NULL,'2026-02-09 15:56:54',0.00), +(12,4,2,NULL,NULL,NULL,'dine-in','pending',NULL,82.44,0.00,0.000,NULL,NULL,'2026-02-13 13:53:50',0.00), +(13,4,1,4,NULL,NULL,'delivery','ready',NULL,96.44,0.00,0.000,NULL,NULL,'2026-02-23 19:27:40',0.00), +(14,2,1,6,3,NULL,'dine-in','preparing',NULL,59.49,0.00,0.000,NULL,NULL,'2026-01-24 16:30:19',0.00), +(15,1,1,7,4,NULL,'dine-in','completed',2,73.46,0.00,0.000,NULL,NULL,'2026-02-16 22:12:57',0.00), +(16,4,3,6,NULL,NULL,'takeaway','completed',2,23.97,0.00,0.000,NULL,NULL,'2026-02-21 17:46:14',0.00), +(17,2,2,2,4,NULL,'dine-in','cancelled',NULL,53.48,0.00,0.000,NULL,NULL,'2026-02-09 22:58:34',0.00), +(18,2,3,NULL,3,NULL,'dine-in','ready',NULL,94.43,0.00,0.000,NULL,NULL,'2026-02-09 17:22:45',0.00), +(19,2,1,6,3,NULL,'takeaway','completed',1,11.50,0.00,0.000,NULL,NULL,'2026-01-30 15:04:40',0.00), +(20,1,3,1,7,NULL,'delivery','completed',NULL,6.99,0.00,0.000,NULL,NULL,'2026-02-21 22:58:03',0.00), +(21,1,2,1,2,NULL,'delivery','completed',2,56.94,0.00,0.000,NULL,NULL,'2026-02-16 20:55:36',0.00), +(22,1,3,NULL,7,NULL,'dine-in','completed',NULL,123.42,0.00,0.000,NULL,NULL,'2026-02-13 19:42:01',0.00), +(23,3,2,1,NULL,NULL,'delivery','completed',1,99.97,0.00,0.000,NULL,NULL,'2026-02-18 19:01:06',0.00), +(24,1,2,NULL,6,NULL,'dine-in','completed',NULL,44.50,0.00,0.000,NULL,NULL,'2026-02-04 21:44:38',0.00), +(25,2,1,4,4,NULL,'takeaway','completed',2,122.41,0.00,0.000,NULL,NULL,'2026-02-16 21:35:44',0.00), +(26,4,1,7,NULL,NULL,'delivery','cancelled',NULL,16.49,0.00,0.000,NULL,NULL,'2026-02-18 21:55:05',0.00), +(27,2,3,6,2,NULL,'delivery','completed',2,17.48,0.00,0.000,NULL,NULL,'2026-01-29 21:14:52',0.00), +(28,1,2,3,3,NULL,'takeaway','completed',NULL,60.47,0.00,0.000,NULL,NULL,'2026-02-12 18:52:11',0.00), +(29,3,2,7,NULL,NULL,'delivery','preparing',NULL,27.97,0.00,0.000,NULL,NULL,'2026-02-02 15:06:49',0.00), +(30,1,1,2,4,NULL,'delivery','completed',2,74.95,0.00,0.000,NULL,NULL,'2026-02-11 13:15:33',0.00), +(31,2,2,3,2,NULL,'delivery','completed',2,71.96,0.00,0.000,NULL,NULL,'2026-02-05 15:04:26',0.00), +(32,1,3,2,4,NULL,'takeaway','completed',NULL,43.95,0.00,0.000,NULL,NULL,'2026-02-11 21:21:43',0.00), +(33,2,2,2,6,NULL,'delivery','cancelled',NULL,47.97,0.00,0.000,NULL,NULL,'2026-02-12 20:10:48',0.00), +(34,3,3,NULL,NULL,NULL,'dine-in','completed',1,46.49,0.00,0.000,NULL,NULL,'2026-02-11 14:51:35',0.00), +(35,3,3,5,NULL,NULL,'delivery','completed',1,38.49,0.00,0.000,NULL,NULL,'2026-02-20 17:08:32',0.00), +(36,3,1,4,NULL,NULL,'delivery','completed',1,91.48,0.00,0.000,NULL,NULL,'2026-02-01 16:21:38',0.00), +(37,3,1,NULL,NULL,NULL,'delivery','pending',NULL,94.94,0.00,0.000,NULL,NULL,'2026-02-08 18:31:06',0.00), +(38,3,1,5,NULL,NULL,'dine-in','completed',1,69.99,0.00,0.000,NULL,NULL,'2026-02-04 13:01:09',0.00), +(39,2,3,3,6,NULL,'delivery','preparing',NULL,31.98,0.00,0.000,NULL,NULL,'2026-02-16 13:13:22',0.00), +(40,3,3,6,NULL,NULL,'takeaway','pending',NULL,23.97,0.00,0.000,NULL,NULL,'2026-02-01 17:33:38',0.00), +(41,2,1,5,4,NULL,'takeaway','ready',NULL,10.00,0.00,0.000,NULL,NULL,'2026-01-31 14:49:13',0.00), +(42,3,3,2,NULL,NULL,'delivery','completed',2,27.98,0.00,0.000,NULL,NULL,'2026-01-28 11:38:11',0.00), +(43,2,2,8,3,NULL,'dine-in','pending',NULL,70.46,0.00,0.000,NULL,NULL,'2026-02-21 13:27:55',0.00), +(44,4,1,2,NULL,NULL,'delivery','cancelled',NULL,12.50,0.00,0.000,NULL,NULL,'2026-02-18 12:47:10',0.00), +(45,1,1,NULL,3,NULL,'delivery','completed',1,23.97,0.00,0.000,NULL,NULL,'2026-01-30 11:43:19',0.00), +(46,3,2,2,NULL,NULL,'takeaway','cancelled',NULL,69.00,0.00,0.000,NULL,NULL,'2026-01-25 22:14:08',0.00), +(47,4,1,NULL,NULL,NULL,'dine-in','completed',1,12.50,0.00,0.000,NULL,NULL,'2026-02-19 18:31:12',0.00), +(48,4,2,NULL,NULL,NULL,'takeaway','completed',1,6.50,0.00,0.000,NULL,NULL,'2026-02-21 18:02:45',0.00), +(49,2,1,NULL,7,NULL,'dine-in','pending',NULL,23.00,0.00,0.000,NULL,NULL,'2026-02-02 18:23:13',0.00), +(50,3,3,NULL,NULL,NULL,'delivery','cancelled',NULL,24.47,0.00,0.000,NULL,NULL,'2026-01-28 12:13:05',0.00), +(51,1,1,8,NULL,NULL,'takeaway','completed',1,28.48,0.00,0.000,'moosa','99359472','2026-02-24 02:28:17',0.00), +(52,1,1,NULL,NULL,NULL,'takeaway','completed',1,28.97,0.00,0.000,NULL,NULL,'2026-02-24 02:39:42',0.00), +(53,1,1,NULL,NULL,NULL,'takeaway','completed',1,14.98,0.00,0.000,NULL,NULL,'2026-02-24 02:40:36',0.00), +(54,1,1,NULL,NULL,NULL,'takeaway','completed',1,12.99,0.00,0.000,NULL,NULL,'2026-02-24 02:48:59',0.00), +(55,1,1,NULL,NULL,NULL,'takeaway','completed',1,28.98,0.00,0.000,NULL,NULL,'2026-02-24 02:49:23',0.00), +(56,1,1,8,NULL,NULL,'takeaway','pending',1,72.41,3.45,0.000,'moosa','99359472','2026-02-24 05:24:18',0.00), +(57,1,1,8,NULL,NULL,'takeaway','pending',1,13.11,0.62,0.000,'moosa','99359472','2026-02-24 05:24:38',0.00), +(58,1,1,8,NULL,NULL,'takeaway','pending',3,0.00,-6.50,0.000,'moosa','99359472','2026-02-24 05:25:00',0.00), +(59,1,1,NULL,NULL,NULL,'takeaway','pending',NULL,27.81,1.32,0.000,NULL,NULL,'2026-02-24 17:19:28',0.00), +(60,1,1,NULL,NULL,NULL,'takeaway','pending',NULL,13.13,0.63,0.000,NULL,NULL,'2026-02-24 17:32:43',0.00), +(61,1,1,NULL,NULL,NULL,'takeaway','pending',NULL,13.13,0.63,0.000,NULL,NULL,'2026-02-24 17:36:49',0.00), +(62,1,1,NULL,NULL,NULL,'takeaway','pending',NULL,13.13,0.63,0.000,NULL,NULL,'2026-02-24 17:37:29',0.00), +(63,1,1,8,1,'Table 1','dine-in','pending',1,13.13,0.63,0.000,'moosa','99359472','2026-02-24 17:53:23',0.00), +(64,1,1,9,1,'Table 1','dine-in','pending',1,27.81,1.32,0.000,'Salim','66666666','2026-02-24 18:01:20',0.00), +(65,1,1,NULL,NULL,NULL,'takeaway','pending',1,27.81,1.32,0.000,NULL,NULL,'2026-02-25 02:22:25',0.00), +(66,1,1,NULL,1,'Table 1','dine-in','pending',1,27.81,1.32,0.000,NULL,NULL,'2026-02-25 02:30:19',0.00), +(67,1,1,8,NULL,NULL,'takeaway','pending',1,51.43,2.45,0.000,'moosa','99359472','2026-02-25 18:30:15',0.00), +(68,1,1,8,NULL,NULL,'takeaway','pending',1,28.34,1.35,0.000,'moosa','99359472','2026-02-25 19:03:00',0.00), +(69,1,1,8,NULL,NULL,'takeaway','pending',1,27.29,1.30,0.000,'moosa','99359472','2026-02-25 19:03:33',0.00), +(70,1,1,8,NULL,NULL,'takeaway','pending',1,28.34,1.35,0.000,'moosa','99359472','2026-02-25 19:07:21',0.00), +(71,1,1,8,NULL,NULL,'takeaway','pending',3,10.45,0.95,0.000,'moosa','99359472','2026-02-25 19:12:01',0.00), +(72,1,1,8,NULL,NULL,'takeaway','pending',1,29.90,1.42,0.000,'moosa','99359472','2026-02-25 19:19:48',0.00), +(73,1,1,8,NULL,NULL,'takeaway','pending',1,29.93,1.43,0.000,'moosa','99359472','2026-02-25 19:20:11',0.00), +(74,1,1,8,NULL,NULL,'takeaway','pending',3,7.30,0.80,0.000,'moosa','99359472','2026-02-25 19:20:58',0.00), +(75,1,1,8,NULL,NULL,'takeaway','pending',1,59.85,2.85,0.000,'moosa','99359472','2026-02-25 19:30:47',0.00), +(76,1,1,8,NULL,NULL,'takeaway','pending',1,32.53,1.55,0.000,'moosa','99359472','2026-02-25 19:50:09',0.00), +(77,1,1,NULL,NULL,NULL,'takeaway','pending',1,34.48,0.00,0.000,NULL,NULL,'2026-02-26 15:19:06',0.00), +(78,1,1,NULL,NULL,NULL,'takeaway','pending',1,9.98,0.00,0.475,NULL,NULL,'2026-02-26 15:20:30',0.00); +/*!40000 ALTER TABLE `orders` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `outlets` +-- + +DROP TABLE IF EXISTS `outlets`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `outlets` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `name_ar` varchar(255) DEFAULT NULL, + `address` text DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `outlets` +-- + +LOCK TABLES `outlets` WRITE; +/*!40000 ALTER TABLE `outlets` DISABLE KEYS */; +INSERT INTO `outlets` VALUES +(1,'Main Downtown',NULL,'123 Main St','2026-02-23 18:56:57',0), +(2,'Westside Hub',NULL,'456 West Blvd','2026-02-23 18:56:57',0), +(3,'North Point Mall',NULL,'789 North Ave','2026-02-23 19:48:28',0), +(4,'South Beach',NULL,'321 Coastal Rd','2026-02-23 19:48:28',0); +/*!40000 ALTER TABLE `outlets` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `payment_types` +-- + +DROP TABLE IF EXISTS `payment_types`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `payment_types` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `type` enum('cash','card','api','bank') DEFAULT 'cash', + `api_provider` varchar(50) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `payment_types` +-- + +LOCK TABLES `payment_types` WRITE; +/*!40000 ALTER TABLE `payment_types` DISABLE KEYS */; +INSERT INTO `payment_types` VALUES +(1,'Cash','cash',NULL,1,'2026-02-23 19:40:07',0), +(2,'Credit Card','card',NULL,1,'2026-02-23 19:40:07',0), +(3,'Loyalty Redeem','cash',NULL,0,'2026-02-23 19:40:07',0), +(4,'Bank Transfer','bank',NULL,1,'2026-02-24 08:12:38',0); +/*!40000 ALTER TABLE `payment_types` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `product_variants` +-- + +DROP TABLE IF EXISTS `product_variants`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `product_variants` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `product_id` int(11) DEFAULT NULL, + `name` varchar(255) NOT NULL, + `name_ar` varchar(255) DEFAULT NULL, + `price_adjustment` decimal(10,2) DEFAULT 0.00, + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + KEY `product_id` (`product_id`), + CONSTRAINT `product_variants_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `product_variants` +-- + +LOCK TABLES `product_variants` WRITE; +/*!40000 ALTER TABLE `product_variants` DISABLE KEYS */; +/*!40000 ALTER TABLE `product_variants` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `products` +-- + +DROP TABLE IF EXISTS `products`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `products` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `category_id` int(11) DEFAULT NULL, + `name` varchar(255) NOT NULL, + `name_ar` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `price` decimal(10,2) NOT NULL, + `vat_percent` decimal(5,2) DEFAULT 0.00, + `cost_price` decimal(10,2) DEFAULT 0.00, + `stock_quantity` int(11) DEFAULT 0, + `image_url` varchar(255) DEFAULT NULL, + `promo_discount_percent` decimal(5,2) DEFAULT NULL, + `promo_date_from` date DEFAULT NULL, + `promo_date_to` date DEFAULT NULL, + `is_deleted` tinyint(1) DEFAULT 0, + `is_loyalty` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + KEY `category_id` (`category_id`), + CONSTRAINT `products_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `products` +-- + +LOCK TABLES `products` WRITE; +/*!40000 ALTER TABLE `products` DISABLE KEYS */; +INSERT INTO `products` VALUES +(1,1,'Signature Burger',NULL,'Juicy beef patty with special sauce',12.99,0.00,0.00,-4,NULL,NULL,NULL,NULL,0,0), +(2,1,'Veggie Delight',NULL,'Plant-based patty with fresh avocado',11.50,0.00,0.00,-2,NULL,NULL,NULL,NULL,0,0), +(3,2,'Truffle Fries',NULL,'Crispy fries with truffle oil and parmesan',5.99,0.00,0.00,-3,NULL,NULL,NULL,NULL,0,0), +(4,3,'Craft Cola','','House-made sparkling cola',3.50,0.00,0.00,-1,NULL,NULL,NULL,NULL,0,NULL), +(5,1,'Double Bacon Burger',NULL,'Double patty with crispy bacon and cheddar',15.99,0.00,6.50,97,NULL,NULL,NULL,NULL,0,0), +(6,2,'Sweet Potato Fries',NULL,'Waffle cut sweet potato fries with maple dip',6.50,0.00,2.00,195,NULL,NULL,NULL,NULL,0,0), +(7,3,'Lemon Iced Tea',NULL,'Freshly brewed black tea with lemon and honey',3.99,0.00,0.50,499,NULL,NULL,NULL,NULL,0,0), +(8,4,'Chocolate Lava Cake','','Warm chocolate cake with a gooey center',7.99,5.00,3.00,43,NULL,NULL,NULL,NULL,0,1), +(9,4,'NY Cheesecake',NULL,'Classic creamy cheesecake with strawberry topping',6.99,0.00,2.50,55,NULL,NULL,NULL,NULL,0,0), +(10,5,'Caesar Salad','','Romaine lettuce with parmesan, croutons and dressing',9.50,5.00,3.50,59,NULL,NULL,NULL,NULL,0,1), +(11,5,'Greek Salad',NULL,'Cucumber, tomato, onion, olives and feta cheese',10.50,0.00,4.00,69,NULL,NULL,NULL,NULL,0,0), +(12,3,'Spaghetti Carbonara','سباغيتي كاربونارا','Pasta with eggs, cheese, guanciale and black pepper',13.99,0.00,5.50,84,'assets/images/products/prod_699dab0588305.jpg',NULL,NULL,NULL,0,0), +(13,1,'Penne Arrabbiata','بيني أرابياتا','Spicy pasta with tomato sauce, garlic and chili',12.50,0.00,4.50,89,'assets/images/products/prod_699da7aa10ada.jpg',NULL,NULL,NULL,0,0); +/*!40000 ALTER TABLE `products` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `purchase_items` +-- + +DROP TABLE IF EXISTS `purchase_items`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `purchase_items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `purchase_id` int(11) NOT NULL, + `product_id` int(11) NOT NULL, + `quantity` int(11) NOT NULL, + `cost_price` decimal(10,2) NOT NULL, + `total_price` decimal(10,2) NOT NULL, + PRIMARY KEY (`id`), + KEY `purchase_id` (`purchase_id`), + KEY `product_id` (`product_id`), + CONSTRAINT `purchase_items_ibfk_1` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`) ON DELETE CASCADE, + CONSTRAINT `purchase_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `purchase_items` +-- + +LOCK TABLES `purchase_items` WRITE; +/*!40000 ALTER TABLE `purchase_items` DISABLE KEYS */; +INSERT INTO `purchase_items` VALUES +(1,1,11,36,4.00,144.00), +(2,2,1,27,0.00,0.00), +(3,2,4,29,0.00,0.00), +(4,2,8,29,3.00,87.00), +(5,3,8,26,3.00,78.00), +(6,3,4,35,0.00,0.00), +(7,4,5,31,6.50,201.50), +(8,4,7,19,0.50,9.50), +(9,5,9,32,2.50,80.00), +(10,5,11,14,4.00,56.00); +/*!40000 ALTER TABLE `purchase_items` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `purchases` +-- + +DROP TABLE IF EXISTS `purchases`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `purchases` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `supplier_id` int(11) DEFAULT NULL, + `purchase_date` date NOT NULL, + `total_amount` decimal(10,2) DEFAULT 0.00, + `status` enum('pending','completed','cancelled') DEFAULT 'pending', + `notes` text DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `supplier_id` (`supplier_id`), + CONSTRAINT `purchases_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `purchases` +-- + +LOCK TABLES `purchases` WRITE; +/*!40000 ALTER TABLE `purchases` DISABLE KEYS */; +INSERT INTO `purchases` VALUES +(1,3,'2026-02-11',144.00,'completed',NULL,'2026-02-23 19:48:29'), +(2,1,'2026-02-17',87.00,'completed',NULL,'2026-02-23 19:48:29'), +(3,1,'2026-02-15',78.00,'completed',NULL,'2026-02-23 19:48:29'), +(4,3,'2026-02-11',211.00,'completed',NULL,'2026-02-23 19:48:29'), +(5,2,'2026-02-09',136.00,'completed',NULL,'2026-02-23 19:48:29'); +/*!40000 ALTER TABLE `purchases` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `service_ratings` +-- + +DROP TABLE IF EXISTS `service_ratings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `service_ratings` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `rating` int(11) NOT NULL CHECK (`rating` >= 1 and `rating` <= 5), + `comment` text DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `service_ratings` +-- + +LOCK TABLES `service_ratings` WRITE; +/*!40000 ALTER TABLE `service_ratings` DISABLE KEYS */; +INSERT INTO `service_ratings` VALUES +(1,5,'Excellent service and great food!','2026-02-23 19:48:29'), +(2,4,'Burger was amazing, but wait time was a bit long.','2026-02-23 19:48:29'), +(3,5,'Best pizza in town!','2026-02-23 19:48:29'), +(4,3,'Okay, but nothing special.','2026-02-23 19:48:29'), +(5,5,'خدمات جلية ممتازة','2026-02-24 08:29:23'), +(6,5,'Test','2026-02-24 18:30:28'), +(7,4,'tett','2026-02-25 18:18:30'); +/*!40000 ALTER TABLE `service_ratings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `staff_ratings` +-- + +DROP TABLE IF EXISTS `staff_ratings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `staff_ratings` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `rating` int(11) NOT NULL CHECK (`rating` >= 1 and `rating` <= 5), + `comment` text DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `user_id` (`user_id`), + CONSTRAINT `staff_ratings_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `staff_ratings` +-- + +LOCK TABLES `staff_ratings` WRITE; +/*!40000 ALTER TABLE `staff_ratings` DISABLE KEYS */; +/*!40000 ALTER TABLE `staff_ratings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `suppliers` +-- + +DROP TABLE IF EXISTS `suppliers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `suppliers` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `contact_person` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `phone` varchar(50) DEFAULT NULL, + `address` text DEFAULT NULL, + `vat_no` varchar(50) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `is_deleted` tinyint(1) DEFAULT 0, + 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 `suppliers` +-- + +LOCK TABLES `suppliers` WRITE; +/*!40000 ALTER TABLE `suppliers` DISABLE KEYS */; +INSERT INTO `suppliers` VALUES +(1,'Fresh Farms Ltd','Farmer Joe',NULL,'555-9999',NULL,NULL,'2026-02-23 19:48:29',0), +(2,'Beverage Co','Drink Distributor',NULL,'555-8888',NULL,NULL,'2026-02-23 19:48:29',0), +(3,'Kitchen Supplies Inc','Cookware Expert','','555-7777','','','2026-02-23 19:48:29',0); +/*!40000 ALTER TABLE `suppliers` 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 = utf8mb4 */; +CREATE TABLE `tables` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `area_id` int(11) DEFAULT NULL, + `table_number` varchar(50) NOT NULL, + `capacity` int(11) DEFAULT 4, + `status` enum('available','occupied','reserved','inactive') DEFAULT 'available', + `created_at` timestamp NULL DEFAULT current_timestamp(), + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + KEY `area_id` (`area_id`), + CONSTRAINT `tables_ibfk_1` FOREIGN KEY (`area_id`) REFERENCES `areas` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=8 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 */; +INSERT INTO `tables` VALUES +(1,1,'Table 1',4,'available','2026-02-23 19:48:28',0), +(2,1,'Table 2',4,'available','2026-02-23 19:48:28',0), +(3,1,'Table 3',6,'available','2026-02-23 19:48:28',0), +(4,2,'Patio 1',2,'available','2026-02-23 19:48:28',0), +(5,2,'Patio 2',2,'available','2026-02-23 19:48:28',0), +(6,3,'Booth A',4,'available','2026-02-23 19:48:28',0), +(7,3,'Booth B',4,'available','2026-02-23 19:48:28',0); +/*!40000 ALTER TABLE `tables` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `user_groups` +-- + +DROP TABLE IF EXISTS `user_groups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `user_groups` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `permissions` text DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `user_groups` +-- + +LOCK TABLES `user_groups` WRITE; +/*!40000 ALTER TABLE `user_groups` DISABLE KEYS */; +INSERT INTO `user_groups` VALUES +(1,'Administrator','all','2026-02-23 18:56:57',0), +(2,'Administrator','all','2026-02-23 19:40:07',0), +(3,'Manager','dashboard_view,orders_view,orders_add,orders_edit,orders_del,products_view,products_add,products_edit,products_del,reports_view','2026-02-23 19:40:07',0), +(4,'Cashier','pos_view,pos_add,pos_del,kitchen_view,kitchen_add,kitchen_del,products_view,categories_view','2026-02-23 19:40:07',0), +(5,'Waiter','pos_view,pos_add,pos_del','2026-02-23 19:40:07',0); +/*!40000 ALTER TABLE `user_groups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `user_outlets` +-- + +DROP TABLE IF EXISTS `user_outlets`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `user_outlets` ( + `user_id` int(11) NOT NULL, + `outlet_id` int(11) NOT NULL, + PRIMARY KEY (`user_id`,`outlet_id`), + KEY `outlet_id` (`outlet_id`), + CONSTRAINT `user_outlets_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, + CONSTRAINT `user_outlets_ibfk_2` FOREIGN KEY (`outlet_id`) REFERENCES `outlets` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `user_outlets` +-- + +LOCK TABLES `user_outlets` WRITE; +/*!40000 ALTER TABLE `user_outlets` DISABLE KEYS */; +INSERT INTO `user_outlets` VALUES +(1,1), +(1,2), +(1,3), +(1,4), +(2,1), +(3,2); +/*!40000 ALTER TABLE `user_outlets` 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 = utf8mb4 */; +CREATE TABLE `users` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `group_id` int(11) DEFAULT NULL, + `username` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `full_name` varchar(255) DEFAULT NULL, + `full_name_ar` varchar(255) DEFAULT NULL, + `employee_id` varchar(50) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `profile_pic` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `is_ratable` tinyint(1) DEFAULT 0, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `commission_rate` decimal(5,2) DEFAULT 0.00, + `is_deleted` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`), + UNIQUE KEY `employee_id` (`employee_id`), + UNIQUE KEY `email` (`email`), + KEY `group_id` (`group_id`), + CONSTRAINT `users_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `user_groups` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB AUTO_INCREMENT=4 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,'admin','$2y$10$52ZJ3bcFXYY8B7pcWL/9LeY90Fd3M1eAIolOGG.XpXa50zBmwFSuS','Super Admin','',NULL,'aalabry@gmail.com','assets/images/users/user_1_699d76ecd9c95.jpg',1,0,'2026-02-23 18:56:57',0.00,0), +(2,2,'cashier1','$2y$10$2.LYIJUOfkoiqkjtLtPe3uMLAAF6o4WmjinqXAuuWt72EYeQ8ZMQG','Alice Cashier','أليس كاشير',NULL,'',NULL,1,0,'2026-02-23 19:48:28',0.00,0), +(3,3,'waiter1','$2y$10$2.LYIJUOfkoiqkjtLtPe3uMLAAF6o4WmjinqXAuuWt72EYeQ8ZMQG','Bob Waiter',NULL,NULL,NULL,NULL,1,0,'2026-02-23 19:48:28',0.00,0); +/*!40000 ALTER TABLE `users` 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-02-26 18:54:33