-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.8.0.6908
-- --------------------------------------------------------



-- Dumping database structure for coffee
CREATE DATABASE IF NOT EXISTS `coffee` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `coffee`;

-- Dumping data for table coffee.cache_locks: ~0 rows (approximately)

-- Dumping structure for table coffee.categories
CREATE TABLE IF NOT EXISTS `categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.categories: ~5 rows (approximately)
INSERT INTO `categories` (`id`, `name`, `description`, `image`, `is_active`, `created_at`, `updated_at`) VALUES
	(1, 'مشروبات ساخنة', 'قهوة، شاي، وغيرها من المشروبات الساخنة', NULL, 0, '2025-06-30 03:26:04', '2025-06-30 05:12:10'),
	(2, 'مشروبات باردة', 'عصائر، مشروبات مثلجة، وغيرها', NULL, 1, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(3, 'حلويات', 'كيك، كوكيز، وحلويات متنوعة', NULL, 1, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(4, 'وجبات خفيفة', 'سندويشات، سلطات، ووجبات خفيفة', NULL, 1, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(5, 'تجربه', NULL, NULL, 0, '2025-06-30 05:08:51', '2025-06-30 05:08:51');

-- Dumping structure for table coffee.external_orders
CREATE TABLE IF NOT EXISTS `external_orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `car_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `qr_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('active','completed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `external_orders_qr_code_unique` (`qr_code`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.external_orders: ~0 rows (approximately)
INSERT INTO `external_orders` (`id`, `car_number`, `qr_code`, `status`, `notes`, `created_at`, `updated_at`) VALUES
	(1, '154', 'HHpnpdaeat', 'active', NULL, '2025-07-03 22:00:05', '2025-07-03 22:00:05');

-- Dumping structure for table coffee.failed_jobs
CREATE TABLE IF NOT EXISTS `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.failed_jobs: ~0 rows (approximately)

-- Dumping structure for table coffee.jobs
CREATE TABLE IF NOT EXISTS `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.jobs: ~0 rows (approximately)

-- Dumping structure for table coffee.job_batches
CREATE TABLE IF NOT EXISTS `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.job_batches: ~0 rows (approximately)

-- Dumping structure for table coffee.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.migrations: ~14 rows (approximately)
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
	(1, '0001_01_01_000000_create_users_table', 1),
	(2, '0001_01_01_000001_create_cache_table', 1),
	(3, '0001_01_01_000002_create_jobs_table', 1),
	(4, '2023_07_01_000001_create_categories_table', 1),
	(5, '2023_07_01_000001_create_printers_table', 1),
	(6, '2023_07_01_000002_create_products_table', 1),
	(7, '2023_07_01_000003_create_tables_table', 1),
	(8, '2023_07_01_000005_create_orders_table', 1),
	(9, '2023_07_01_000006_create_order_items_table', 1),
	(10, '2023_07_01_000007_create_payments_table', 1),
	(11, '2023_07_01_000008_create_settings_table', 1),
	(12, '2025_07_03_000000_create_print_jobs_table', 2),
	(13, '2025_07_03_192904_add_assistance_fields_to_tables_table', 2),
	(14, '2025_07_03_195634_add_assistance_fields_to_tables_table_fix', 3),
	(15, '2025_07_03_222913_add_meta_to_orders_table', 4),
	(16, '2025_07_03_231523_add_role_to_users_table', 4),
	(17, '2025_07_03_231636_create_user_roles_table', 4),
	(18, '2025_07_04_000000_create_external_orders_table', 5),
	(19, '2025_07_04_011917_modify_table_id_in_orders_table', 6),
	(20, '2025_07_04_000001_add_assistance_columns_to_orders_table', 7);

-- Dumping structure for table coffee.orders
CREATE TABLE IF NOT EXISTS `orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `table_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `customer_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','preparing','completed','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `total_amount` decimal(10,2) NOT NULL,
  `discount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `tax` decimal(10,2) NOT NULL DEFAULT '0.00',
  `final_amount` decimal(10,2) NOT NULL,
  `payment_status` enum('pending','partially_paid','paid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `needs_assistance` tinyint(1) NOT NULL DEFAULT '0',
  `assistance_requested_at` timestamp NULL DEFAULT NULL,
  `assistance_completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `external_order_id` bigint unsigned DEFAULT NULL,
  `is_external_order` tinyint(1) NOT NULL DEFAULT '0',
  `car_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `orders_user_id_foreign` (`user_id`),
  KEY `orders_external_order_id_foreign` (`external_order_id`),
  KEY `orders_table_id_foreign` (`table_id`),
  CONSTRAINT `orders_external_order_id_foreign` FOREIGN KEY (`external_order_id`) REFERENCES `external_orders` (`id`) ON DELETE SET NULL,
  CONSTRAINT `orders_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE RESTRICT,
  CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.orders: ~4 rows (approximately)
INSERT INTO `orders` (`id`, `table_id`, `user_id`, `customer_name`, `status`, `total_amount`, `discount`, `tax`, `final_amount`, `payment_status`, `notes`, `needs_assistance`, `assistance_requested_at`, `assistance_completed_at`, `created_at`, `updated_at`, `external_order_id`, `is_external_order`, `car_number`) VALUES
	(1, 1, 1, NULL, 'completed', 5.00, 0.00, 0.00, 5.00, 'paid', NULL, 0, NULL, NULL, '2025-06-30 03:31:24', '2025-06-30 04:17:12', NULL, 0, NULL),
	(2, 2, 1, NULL, 'completed', 12.00, 0.00, 0.00, 12.00, 'paid', NULL, 0, NULL, NULL, '2025-06-30 04:22:05', '2025-06-30 04:22:52', NULL, 0, NULL),
	(3, 1, 1, NULL, 'completed', 12.00, 0.00, 0.00, 12.00, 'paid', NULL, 0, NULL, NULL, '2025-06-30 04:23:15', '2025-06-30 06:13:05', NULL, 0, NULL),
	(4, 3, 1, NULL, 'completed', 28.00, 0.00, 0.00, 28.00, 'paid', NULL, 0, NULL, NULL, '2025-06-30 06:16:03', '2025-06-30 06:56:47', NULL, 0, NULL),
	(5, 1, 1, 'عميل', 'completed', 61.00, 0.00, 0.00, 61.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 18:37:46', '2025-07-03 21:36:02', NULL, 0, NULL),
	(6, 1, 1, 'عميل', 'completed', 38.00, 0.00, 0.00, 38.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 19:09:05', '2025-07-03 21:35:48', NULL, 0, NULL),
	(7, 1, 1, 'عميل', 'completed', 62.00, 0.00, 0.00, 62.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 19:19:05', '2025-07-03 21:35:37', NULL, 0, NULL),
	(8, 1, 1, 'عميل', 'completed', 32.00, 0.00, 0.00, 32.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 19:25:54', '2025-07-03 21:35:03', NULL, 0, NULL),
	(9, 1, 1, 'عميل', 'completed', 24.00, 0.00, 0.00, 24.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 19:33:04', '2025-07-03 21:34:30', NULL, 0, NULL),
	(10, 1, 1, 'عميل', 'completed', 38.00, 0.00, 0.00, 38.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 19:33:59', '2025-07-03 21:34:21', NULL, 0, NULL),
	(11, 1, 1, 'عميل', 'completed', 14.00, 0.00, 0.00, 14.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 19:45:15', '2025-07-03 21:33:57', NULL, 0, NULL),
	(12, 1, 1, 'عميل', 'completed', 8.00, 0.00, 0.00, 8.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 19:55:47', '2025-07-03 20:59:04', NULL, 0, NULL),
	(13, 2, 2, NULL, 'completed', 12.00, 0.00, 0.00, 12.00, 'paid', NULL, 0, NULL, NULL, '2025-07-03 21:12:15', '2025-07-03 21:13:03', NULL, 0, NULL),
	(14, 1, 2, NULL, 'completed', 24.00, 0.00, 0.00, 24.00, 'paid', NULL, 0, NULL, NULL, '2025-07-03 21:22:51', '2025-07-03 21:26:36', NULL, 0, NULL),
	(15, 1, 1, 'عميل', 'completed', 24.00, 0.00, 0.00, 24.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 21:37:28', '2025-07-03 21:44:59', NULL, 0, NULL),
	(16, 8, 1, NULL, 'completed', 31.00, 0.00, 0.00, 31.00, 'paid', NULL, 0, NULL, NULL, '2025-07-03 21:51:35', '2025-07-03 21:52:57', NULL, 0, NULL),
	(17, NULL, 1, NULL, 'pending', 0.00, 0.00, 0.00, 0.00, 'pending', 'طلب خارجي - رقم السيارة: ww', 0, NULL, NULL, '2025-07-03 22:21:04', '2025-07-03 22:21:04', NULL, 1, 'ww'),
	(18, NULL, 1, NULL, 'pending', 0.00, 0.00, 0.00, 0.00, 'pending', 'طلب خارجي - رقم السيارة: ww', 0, NULL, NULL, '2025-07-03 22:21:50', '2025-07-03 22:21:50', NULL, 1, 'ww'),
	(19, NULL, 1, NULL, 'pending', 0.00, 0.00, 0.00, 0.00, 'pending', 'طلب خارجي - رقم السيارة: ww', 0, NULL, NULL, '2025-07-03 22:22:32', '2025-07-03 22:22:32', NULL, 1, 'ww'),
	(20, NULL, 1, NULL, 'pending', 0.00, 0.00, 0.00, 0.00, 'pending', 'طلب خارجي - رقم السيارة: ww', 0, NULL, NULL, '2025-07-03 22:22:46', '2025-07-03 22:22:46', NULL, 1, 'ww'),
	(21, NULL, 1, NULL, 'pending', 0.00, 0.00, 0.00, 0.00, 'pending', 'طلب خارجي - رقم السيارة: ww', 0, NULL, NULL, '2025-07-03 22:22:55', '2025-07-03 22:22:55', NULL, 1, 'ww'),
	(22, NULL, 1, NULL, 'completed', 14.00, 0.00, 0.00, 14.00, 'paid', 'طلب خارجي - رقم السيارة: ww', 0, NULL, NULL, '2025-07-03 22:23:26', '2025-07-03 22:28:17', NULL, 1, 'ww'),
	(23, NULL, 1, NULL, 'completed', 23.00, 0.00, 0.00, 23.00, 'paid', 'طلب خارجي - رقم السيارة: 222', 1, '2025-07-03 22:40:42', NULL, '2025-07-03 22:30:02', '2025-07-03 22:40:42', NULL, 1, '222'),
	(24, 1, 1, 'عميل', 'completed', 24.00, 0.00, 0.00, 24.00, 'paid', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 22:32:55', '2025-07-03 22:34:03', NULL, 0, NULL),
	(25, NULL, 1, NULL, 'completed', 7.00, 0.00, 0.00, 7.00, 'paid', 'طلب خارجي - رقم السيارة: 3434', 0, '2025-07-03 22:41:30', '2025-07-03 22:42:25', '2025-07-03 22:41:28', '2025-07-03 22:42:53', NULL, 1, '3434'),
	(26, 1, 1, 'عميل', 'cancelled', 24.00, 0.00, 0.00, 24.00, 'pending', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 22:43:46', '2025-07-03 22:44:49', NULL, 0, NULL),
	(27, 1, 1, 'عميل', 'pending', 24.00, 0.00, 0.00, 24.00, 'pending', 'طلب من العميل مباشرة', 0, NULL, NULL, '2025-07-03 22:46:29', '2025-07-03 22:46:29', NULL, 0, NULL);

-- Dumping structure for table coffee.order_items
CREATE TABLE IF NOT EXISTS `order_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `product_id` bigint unsigned NOT NULL,
  `quantity` int NOT NULL,
  `unit_price` decimal(10,2) NOT NULL,
  `total_price` decimal(10,2) NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `status` enum('pending','preparing','ready','served','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_items_order_id_foreign` (`order_id`),
  KEY `order_items_product_id_foreign` (`product_id`),
  CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.order_items: ~6 rows (approximately)
INSERT INTO `order_items` (`id`, `order_id`, `product_id`, `quantity`, `unit_price`, `total_price`, `notes`, `status`, `created_at`, `updated_at`) VALUES
	(1, 1, 1, 1, 5.00, 5.00, NULL, 'served', '2025-06-30 03:31:24', '2025-06-30 04:21:44'),
	(2, 2, 3, 1, 12.00, 12.00, NULL, 'served', '2025-06-30 04:22:05', '2025-06-30 04:22:40'),
	(3, 3, 3, 1, 12.00, 12.00, NULL, 'served', '2025-06-30 04:23:15', '2025-06-30 04:23:48'),
	(7, 4, 4, 1, 12.00, 12.00, NULL, 'served', '2025-06-30 06:55:21', '2025-06-30 06:56:42'),
	(8, 4, 3, 1, 12.00, 12.00, NULL, 'served', '2025-06-30 06:55:21', '2025-06-30 06:56:45'),
	(9, 4, 5, 1, 4.00, 4.00, NULL, 'served', '2025-06-30 06:55:21', '2025-06-30 06:56:47'),
	(10, 5, 3, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 18:37:46', '2025-07-03 18:52:21'),
	(11, 5, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 18:38:59', '2025-07-03 18:52:30'),
	(12, 5, 3, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 18:39:20', '2025-07-03 18:56:14'),
	(13, 5, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 18:40:16', '2025-07-03 18:56:18'),
	(14, 5, 5, 1, 4.00, 4.00, NULL, 'served', '2025-07-03 18:42:07', '2025-07-03 18:57:06'),
	(15, 5, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 18:45:25', '2025-07-03 18:57:09'),
	(16, 6, 4, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 19:09:05', '2025-07-03 19:25:37'),
	(17, 6, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 19:13:07', '2025-07-03 19:25:39'),
	(18, 6, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 19:13:19', '2025-07-03 19:25:42'),
	(19, 7, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 19:19:05', '2025-07-03 19:25:32'),
	(20, 7, 3, 2, 12.00, 24.00, NULL, 'served', '2025-07-03 19:19:05', '2025-07-03 19:25:34'),
	(21, 8, 6, 1, 10.00, 10.00, NULL, 'served', '2025-07-03 19:25:54', '2025-07-03 19:32:26'),
	(22, 8, 3, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 19:27:13', '2025-07-03 19:32:37'),
	(23, 9, 3, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 19:33:04', '2025-07-03 19:33:29'),
	(24, 10, 3, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 19:33:59', '2025-07-03 19:41:18'),
	(25, 10, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 19:33:59', '2025-07-03 19:41:18'),
	(26, 11, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 19:45:15', '2025-07-03 19:46:15'),
	(27, 12, 5, 1, 4.00, 4.00, NULL, 'served', '2025-07-03 19:55:47', '2025-07-03 19:56:37'),
	(28, 13, 4, 1, 12.00, 12.00, NULL, 'pending', '2025-07-03 21:12:15', '2025-07-03 21:12:15'),
	(29, 14, 4, 1, 12.00, 12.00, NULL, 'pending', '2025-07-03 21:22:51', '2025-07-03 21:22:51'),
	(30, 14, 3, 1, 12.00, 12.00, NULL, 'pending', '2025-07-03 21:26:36', '2025-07-03 21:26:36'),
	(31, 15, 3, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 21:37:28', '2025-07-03 21:44:59'),
	(32, 16, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 21:51:35', '2025-07-03 21:52:57'),
	(33, 16, 3, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 21:51:35', '2025-07-03 21:52:57'),
	(34, 16, 4, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 21:51:35', '2025-07-03 21:52:57'),
	(35, 22, 2, 2, 7.00, 14.00, NULL, 'served', '2025-07-03 22:23:26', '2025-07-03 22:26:48'),
	(36, 23, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 22:30:02', '2025-07-03 22:31:46'),
	(37, 23, 5, 1, 4.00, 4.00, NULL, 'served', '2025-07-03 22:30:02', '2025-07-03 22:31:46'),
	(38, 23, 4, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 22:30:02', '2025-07-03 22:31:46'),
	(39, 24, 3, 1, 12.00, 12.00, NULL, 'served', '2025-07-03 22:32:55', '2025-07-03 22:34:03'),
	(40, 25, 2, 1, 7.00, 7.00, NULL, 'served', '2025-07-03 22:41:28', '2025-07-03 22:42:45'),
	(41, 26, 3, 1, 12.00, 12.00, NULL, 'cancelled', '2025-07-03 22:43:46', '2025-07-03 22:44:49'),
	(42, 27, 3, 1, 12.00, 12.00, NULL, 'pending', '2025-07-03 22:46:29', '2025-07-03 22:46:29');

-- Dumping data for table coffee.password_reset_tokens: ~0 rows (approximately)

-- Dumping structure for table coffee.payments
CREATE TABLE IF NOT EXISTS `payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `payment_method` enum('cash','credit_card','debit_card','mobile_payment') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash',
  `payment_status` enum('completed','failed','refunded') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'completed',
  `transaction_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `user_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payments_order_id_foreign` (`order_id`),
  KEY `payments_user_id_foreign` (`user_id`),
  CONSTRAINT `payments_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE RESTRICT,
  CONSTRAINT `payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.payments: ~4 rows (approximately)
INSERT INTO `payments` (`id`, `order_id`, `amount`, `payment_method`, `payment_status`, `transaction_id`, `notes`, `user_id`, `created_at`, `updated_at`) VALUES
	(1, 1, 5.00, 'cash', 'completed', NULL, NULL, 1, '2025-06-30 04:17:12', '2025-06-30 04:17:12'),
	(2, 2, 12.00, 'cash', 'completed', NULL, NULL, 1, '2025-06-30 04:22:52', '2025-06-30 04:22:52'),
	(3, 3, 12.00, 'cash', 'completed', NULL, NULL, 1, '2025-06-30 06:13:05', '2025-06-30 06:13:05'),
	(4, 4, 24.00, 'mobile_payment', 'completed', NULL, NULL, 1, '2025-06-30 06:42:43', '2025-06-30 06:42:43'),
	(5, 12, 8.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 20:59:04', '2025-07-03 20:59:04'),
	(6, 13, 12.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:13:03', '2025-07-03 21:13:03'),
	(7, 14, 12.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:24:05', '2025-07-03 21:24:05'),
	(8, 11, 14.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:33:57', '2025-07-03 21:33:57'),
	(9, 10, 38.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:34:21', '2025-07-03 21:34:21'),
	(10, 9, 24.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:34:30', '2025-07-03 21:34:30'),
	(11, 8, 32.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:35:03', '2025-07-03 21:35:03'),
	(12, 7, 62.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:35:37', '2025-07-03 21:35:37'),
	(13, 6, 38.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:35:48', '2025-07-03 21:35:48'),
	(14, 5, 61.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:36:02', '2025-07-03 21:36:02'),
	(15, 15, 24.00, 'cash', 'completed', NULL, NULL, 2, '2025-07-03 21:37:47', '2025-07-03 21:37:47'),
	(16, 16, 31.00, 'cash', 'completed', NULL, NULL, 1, '2025-07-03 21:52:30', '2025-07-03 21:52:30'),
	(17, 22, 14.00, 'cash', 'completed', NULL, NULL, 1, '2025-07-03 22:28:17', '2025-07-03 22:28:17'),
	(18, 23, 23.00, 'cash', 'completed', NULL, NULL, 1, '2025-07-03 22:32:18', '2025-07-03 22:32:18'),
	(19, 24, 24.00, 'cash', 'completed', NULL, NULL, 1, '2025-07-03 22:33:35', '2025-07-03 22:33:35'),
	(20, 25, 7.00, 'cash', 'completed', NULL, NULL, 1, '2025-07-03 22:42:53', '2025-07-03 22:42:53');

-- Dumping structure for table coffee.permissions
CREATE TABLE IF NOT EXISTS `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.permissions: ~21 rows (approximately)
INSERT INTO `permissions` (`id`, `name`, `display_name`, `description`, `created_at`, `updated_at`) VALUES
	(1, 'view_users', 'عرض المستخدمين', 'عرض قائمة المستخدمين', NULL, NULL),
	(2, 'create_users', 'إضافة مستخدمين', 'إنشاء مستخدمين جدد', NULL, NULL),
	(3, 'edit_users', 'تعديل المستخدمين', 'تعديل بيانات المستخدمين', NULL, NULL),
	(4, 'delete_users', 'حذف المستخدمين', 'حذف المستخدمين من النظام', NULL, NULL),
	(5, 'view_products', 'عرض المنتجات', 'عرض قائمة المنتجات', NULL, NULL),
	(6, 'create_products', 'إضافة منتجات', 'إضافة منتجات جديدة', NULL, NULL),
	(7, 'edit_products', 'تعديل المنتجات', 'تعديل بيانات المنتجات', NULL, NULL),
	(8, 'delete_products', 'حذف المنتجات', 'حذف المنتجات من النظام', NULL, NULL),
	(9, 'manage_categories', 'إدارة الفئات', 'إدارة فئات المنتجات', NULL, NULL),
	(10, 'view_tables', 'عرض الطاولات', 'عرض حالة الطاولات', NULL, NULL),
	(11, 'manage_tables', 'إدارة الطاولات', 'إضافة وتعديل وحذف الطاولات', NULL, NULL),
	(12, 'view_all_orders', 'عرض جميع الطلبات', 'عرض جميع الطلبات في النظام', NULL, NULL),
	(13, 'view_kitchen_orders', 'عرض طلبات المطبخ', 'عرض الطلبات المخصصة للمطبخ', NULL, NULL),
	(14, 'update_order_status', 'تحديث حالة الطلب', 'تغيير حالة الطلبات', NULL, NULL),
	(15, 'cancel_orders', 'إلغاء الطلبات', 'إلغاء الطلبات النشطة', NULL, NULL),
	(16, 'process_payments', 'معالجة المدفوعات', 'معالجة مدفوعات الطلبات', NULL, NULL),
	(17, 'view_payments', 'عرض المدفوعات', 'عرض سجل المدفوعات', NULL, NULL),
	(18, 'issue_refunds', 'إصدار المبالغ المستردة', 'إصدار استرداد للمدفوعات', NULL, NULL),
	(19, 'view_reports', 'عرض التقارير', 'عرض تقارير المبيعات والإحصائيات', NULL, NULL),
	(20, 'export_reports', 'تصدير التقارير', 'تصدير التقارير إلى ملفات خارجية', NULL, NULL),
	(21, 'manage_settings', 'إدارة الإعدادات', 'تغيير إعدادات النظام', NULL, NULL);

-- Dumping structure for table coffee.printers
CREATE TABLE IF NOT EXISTS `printers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('kitchen','receipt','bar') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'receipt',
  `ip_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `port` int NOT NULL DEFAULT '9100',
  `printer_model` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `paper_width` int DEFAULT NULL,
  `paper_height` int DEFAULT NULL,
  `character_per_line` int DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.printers: ~3 rows (approximately)
INSERT INTO `printers` (`id`, `name`, `type`, `ip_address`, `port`, `printer_model`, `paper_width`, `paper_height`, `character_per_line`, `is_active`, `created_at`, `updated_at`) VALUES
	(1, 'طابعة الكاشير', 'receipt', '192.168.1.100', 9100, 'EPSON TM-T20', 80, 297, 42, 1, '2025-06-30 03:26:04', '2025-06-30 05:45:53'),
	(2, 'طابعة المطبخ', 'kitchen', '192.168.1.101', 9100, 'EPSON TM-T20', 80, 297, 42, 1, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(3, 'طابعة البار', 'bar', '192.168.1.102', 9100, 'EPSON TM-T20', 80, 297, 42, 1, '2025-06-30 03:26:04', '2025-06-30 03:26:04');

-- Dumping structure for table coffee.print_jobs
CREATE TABLE IF NOT EXISTS `print_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `printer_id` bigint unsigned NOT NULL,
  `order_id` bigint unsigned NOT NULL,
  `content` json NOT NULL,
  `status` enum('pending','processing','completed','failed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `print_jobs_printer_id_foreign` (`printer_id`),
  KEY `print_jobs_order_id_foreign` (`order_id`),
  KEY `print_jobs_status_created_at_index` (`status`,`created_at`),
  CONSTRAINT `print_jobs_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `print_jobs_printer_id_foreign` FOREIGN KEY (`printer_id`) REFERENCES `printers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.print_jobs: ~0 rows (approximately)
INSERT INTO `print_jobs` (`id`, `printer_id`, `order_id`, `content`, `status`, `error_message`, `processed_at`, `created_at`, `updated_at`) VALUES
	(1, 3, 5, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}], "order_id": 5, "created_at": "2025-07-03 21:37:46", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 18:40:16', '2025-07-03 18:40:16'),
	(2, 3, 5, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "شاي"}], "order_id": 5, "created_at": "2025-07-03 21:37:46", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 18:42:07', '2025-07-03 18:42:07'),
	(3, 3, 5, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "شاي"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}], "order_id": 5, "created_at": "2025-07-03 21:37:46", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 18:45:25', '2025-07-03 18:45:25'),
	(4, 3, 6, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "لاتيه"}], "order_id": 6, "created_at": "2025-07-03 22:09:05", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 19:09:05', '2025-07-03 19:09:05'),
	(5, 3, 7, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}, {"notes": null, "status": "pending", "quantity": 2, "product_name": "كابتشينو"}], "order_id": 7, "created_at": "2025-07-03 22:19:05", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 19:19:05', '2025-07-03 19:19:05'),
	(6, 3, 8, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "عصير برتقال"}], "order_id": 8, "created_at": "2025-07-03 22:25:54", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 19:25:54', '2025-07-03 19:25:54'),
	(7, 3, 8, '{"items": [{"notes": null, "status": "ready", "quantity": 1, "product_name": "عصير برتقال"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}], "order_id": 8, "created_at": "2025-07-03 22:25:54", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 19:27:13', '2025-07-03 19:27:13'),
	(8, 3, 9, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}], "order_id": 9, "created_at": "2025-07-03 22:33:04", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 19:33:04', '2025-07-03 19:33:04'),
	(9, 3, 10, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}], "order_id": 10, "created_at": "2025-07-03 22:33:59", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 19:33:59', '2025-07-03 19:33:59'),
	(10, 3, 11, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}], "order_id": 11, "created_at": "2025-07-03 22:45:15", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 19:45:16', '2025-07-03 19:45:16'),
	(11, 3, 12, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "شاي"}], "order_id": 12, "created_at": "2025-07-03 22:55:47", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 19:55:47', '2025-07-03 19:55:47'),
	(12, 3, 13, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "لاتيه"}], "order_id": 13, "created_at": "2025-07-04 00:12:15", "created_by": "كاشير", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 2", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": null}', 'pending', NULL, NULL, '2025-07-03 21:12:15', '2025-07-03 21:12:15'),
	(13, 3, 14, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "لاتيه"}], "order_id": 14, "created_at": "2025-07-04 00:22:51", "created_by": "كاشير", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": null}', 'pending', NULL, NULL, '2025-07-03 21:22:51', '2025-07-03 21:22:51'),
	(14, 3, 14, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "لاتيه"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}], "order_id": 14, "created_at": "2025-07-04 00:22:51", "created_by": "كاشير", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": null}', 'pending', NULL, NULL, '2025-07-03 21:26:36', '2025-07-03 21:26:36'),
	(15, 3, 15, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}], "order_id": 15, "created_at": "2025-07-04 00:37:28", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 21:37:28', '2025-07-03 21:37:28'),
	(16, 3, 16, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "قهوة أمريكية"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}, {"notes": null, "status": "pending", "quantity": 1, "product_name": "لاتيه"}], "order_id": 16, "created_at": "2025-07-04 00:51:35", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 8", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": null}', 'pending', NULL, NULL, '2025-07-03 21:51:35', '2025-07-03 21:51:35'),
	(17, 3, 24, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}], "order_id": 24, "created_at": "2025-07-04 01:32:55", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 22:32:55', '2025-07-03 22:32:55'),
	(18, 3, 26, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}], "order_id": 26, "created_at": "2025-07-04 01:43:46", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 22:43:46', '2025-07-03 22:43:46'),
	(19, 3, 27, '{"items": [{"notes": null, "status": "pending", "quantity": 1, "product_name": "كابتشينو"}], "order_id": 27, "created_at": "2025-07-04 01:46:29", "created_by": "مدير النظام", "order_type": "NEW", "printer_id": 3, "printer_ip": "192.168.1.102", "table_name": "طاولة 1", "printer_name": "طابعة البار", "printer_port": 9100, "customer_name": "عميل"}', 'pending', NULL, NULL, '2025-07-03 22:46:29', '2025-07-03 22:46:29');

-- Dumping structure for table coffee.products
CREATE TABLE IF NOT EXISTS `products` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `price` decimal(10,2) NOT NULL,
  `cost_price` decimal(10,2) DEFAULT NULL,
  `category_id` bigint unsigned NOT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `preparation_time` int DEFAULT NULL COMMENT 'in minutes',
  `printer_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `products_category_id_foreign` (`category_id`),
  KEY `products_printer_id_foreign` (`printer_id`),
  CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE RESTRICT,
  CONSTRAINT `products_printer_id_foreign` FOREIGN KEY (`printer_id`) REFERENCES `printers` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.products: ~12 rows (approximately)
INSERT INTO `products` (`id`, `name`, `description`, `price`, `cost_price`, `category_id`, `image`, `is_active`, `preparation_time`, `printer_id`, `created_at`, `updated_at`) VALUES
	(1, 'قهوة تركي', 'قهوة تركية تقليدية', 5.00, 2.00, 1, NULL, 0, 5, 3, '2025-06-30 03:26:04', '2025-06-30 05:06:17'),
	(2, 'قهوة أمريكية', 'قهوة أمريكية سادة', 7.00, 3.00, 1, NULL, 1, 3, 3, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(3, 'كابتشينو', 'قهوة إيطالية مع رغوة الحليب', 12.00, 5.00, 1, NULL, 1, 5, 3, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(4, 'لاتيه', 'قهوة مع حليب', 12.00, 5.00, 1, NULL, 1, 5, 3, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(5, 'شاي', 'شاي أسود', 4.00, 1.00, 1, NULL, 1, 3, 3, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(6, 'عصير برتقال', 'عصير برتقال طازج', 10.00, 4.00, 2, NULL, 1, 5, 3, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(7, 'عصير تفاح', 'عصير تفاح طازج', 10.00, 4.00, 2, NULL, 1, 5, 3, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(8, 'ليموناضة', 'عصير ليمون منعش', 8.00, 3.00, 2, NULL, 1, 4, 3, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(9, 'كيكة الشوكولاتة', 'كيكة شوكولاتة طازجة', 15.00, 6.00, 3, NULL, 1, 0, 2, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(10, 'تشيز كيك', 'تشيز كيك مع صلصة التوت', 18.00, 7.00, 3, NULL, 1, 0, 2, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(11, 'سندويش جبنة', 'سندويش جبنة مع خضار', 12.00, 5.00, 4, NULL, 1, 8, 2, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(12, 'سلطة خضار', 'سلطة خضار طازجة', 15.00, 6.00, 4, NULL, 1, 10, 2, '2025-06-30 03:26:04', '2025-06-30 03:26:04'),
	(13, 'تجربه', NULL, 1.00, NULL, 1, NULL, 0, NULL, NULL, '2025-06-30 05:07:03', '2025-06-30 05:07:03');

-- Dumping structure for table coffee.role_permissions
CREATE TABLE IF NOT EXISTS `role_permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `role` enum('admin','cashier','waiter','kitchen') COLLATE utf8mb4_unicode_ci NOT NULL,
  `permission_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_permissions_role_permission_id_unique` (`role`,`permission_id`),
  KEY `role_permissions_permission_id_foreign` (`permission_id`),
  CONSTRAINT `role_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.role_permissions: ~33 rows (approximately)
INSERT INTO `role_permissions` (`id`, `role`, `permission_id`, `created_at`, `updated_at`) VALUES
	(1, 'admin', 1, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(2, 'admin', 2, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(3, 'admin', 3, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(4, 'admin', 4, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(5, 'admin', 5, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(6, 'admin', 6, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(7, 'admin', 7, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(8, 'admin', 8, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(9, 'admin', 9, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(10, 'admin', 10, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(11, 'admin', 11, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(12, 'admin', 12, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(13, 'admin', 13, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(14, 'admin', 14, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(15, 'admin', 15, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(16, 'admin', 16, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(17, 'admin', 17, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(18, 'admin', 18, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(19, 'admin', 19, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(20, 'admin', 20, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(21, 'admin', 21, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(22, 'cashier', 10, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(23, 'cashier', 12, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(24, 'cashier', 14, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(25, 'cashier', 16, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(26, 'cashier', 17, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(27, 'cashier', 19, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(28, 'waiter', 14, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(29, 'waiter', 12, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(30, 'waiter', 5, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(31, 'waiter', 10, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(32, 'kitchen', 14, '2025-07-03 20:48:29', '2025-07-03 20:48:29'),
	(33, 'kitchen', 13, '2025-07-03 20:48:29', '2025-07-03 20:48:29');

-- Dumping structure for table coffee.sessions
CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.sessions: ~1 rows (approximately)
INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
	('UPsOWp8ZWxg5jHLyGM2tDNQMpFdgUfNjPVlPFmck', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiNzY4a3FQQ0lMWU9rSHNHSXZjOFpKcnNtaWp6ZzVtNDBjaHMyNnNMQyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mzg6Imh0dHA6Ly9sb2NhbGhvc3QvY29mZmVlL3B1YmxpYy9sYW5kaW5nIjt9czoyMToibGFzdF9hc3Npc3RhbmNlX2NoZWNrIjtPOjI1OiJJbGx1bWluYXRlXFN1cHBvcnRcQ2FyYm9uIjozOntzOjQ6ImRhdGUiO3M6MjY6IjIwMjUtMDctMDQgMTc6MDk6MjUuNDIyNjcyIjtzOjEzOiJ0aW1lem9uZV90eXBlIjtpOjM7czo4OiJ0aW1lem9uZSI7czozOiJVVEMiO319', 1751648965);

-- Dumping structure for table coffee.tables
CREATE TABLE IF NOT EXISTS `tables` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `capacity` int NOT NULL,
  `status` enum('available','occupied','reserved') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'available',
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `needs_assistance` tinyint(1) NOT NULL DEFAULT '0',
  `assistance_requested_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table coffee.tables: ~8 rows (approximately)
INSERT INTO `tables` (`id`, `name`, `capacity`, `status`, `location`, `created_at`, `updated_at`, `needs_assistance`, `assistance_requested_at`) VALUES
	(1, 'طاولة 1', 3, 'occupied', 'داخلي', '2025-06-30 03:26:04', '2025-07-04 12:21:33', 0, NULL),
	(2, 'طاولة 2', 4, 'available', 'داخلي', '2025-06-30 03:26:04', '2025-07-03 21:37:15', 0, NULL),
	(3, 'طاولة 3', 4, 'available', 'داخلي', '2025-06-30 03:26:04', '2025-07-03 21:21:03', 0, NULL),
	(4, 'طاولة 4', 6, 'available', 'داخلي', '2025-06-30 03:26:04', '2025-06-30 03:26:04', 0, NULL),
	(5, 'طاولة 5', 2, 'available', 'خارجي', '2025-06-30 03:26:04', '2025-06-30 03:26:04', 0, NULL),
	(6, 'طاولة 6', 4, 'available', 'خارجي', '2025-06-30 03:26:04', '2025-06-30 03:26:04', 0, NULL),
	(7, 'طاولة 7', 4, 'available', 'خارجي', '2025-06-30 03:26:04', '2025-06-30 03:26:04', 0, NULL),
	(8, 'طاولة 8', 6, 'available', 'خارجي', '2025-06-30 03:26:04', '2025-07-03 21:52:57', 0, NULL);

