-- --------------------------------------------------------
-- Versión del servidor:         8.4.3 - MySQL Community Server - GPL
-- SO del servidor:              Win64
-- HeidiSQL Versión:             12.8.0.6908
-- --------------------------------------------------------



-- Volcando estructura de base de datos para restaurante_db
CREATE DATABASE IF NOT EXISTS `restaurante_db` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `restaurante_db`;

-- Volcando estructura para tabla restaurante_db.areas
CREATE TABLE IF NOT EXISTS `areas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.areas: ~2 rows (aproximadamente)
DELETE FROM `areas`;
INSERT INTO `areas` (`id`, `name`, `created_at`, `updated_at`) VALUES
	(1, 'Salón Principal', '2025-12-25 21:31:47', '2025-12-25 21:31:47'),
	(2, 'Terraza', '2025-12-25 21:31:47', '2025-12-25 21:31:47');

-- Volcando estructura para tabla restaurante_db.categories
CREATE TABLE IF NOT EXISTS `categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `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=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.categories: ~3 rows (aproximadamente)
DELETE FROM `categories`;
INSERT INTO `categories` (`id`, `name`, `image`, `is_active`, `created_at`, `updated_at`) VALUES
	(1, 'Bebidas', NULL, 1, '2025-12-25 21:31:47', '2025-12-28 09:58:07'),
	(2, 'Hamburguesas', NULL, 1, '2025-12-25 21:31:47', '2025-12-28 09:58:07'),
	(3, 'Postres', NULL, 1, '2025-12-25 21:31:47', '2025-12-28 09:58:07'),
	(4, 'HELADOS VARIOS', 'categories/Dur4mrSOqBzBoEU8jRksC6f2VQAKANCyQ4I92e1l.png', 1, '2025-12-29 19:12:49', '2025-12-29 19:12:49');

-- Volcando estructura para tabla restaurante_db.clients
CREATE TABLE IF NOT EXISTS `clients` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DNI',
  `document_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` 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 `clients_document_number_unique` (`document_number`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.clients: ~1 rows (aproximadamente)
DELETE FROM `clients`;
INSERT INTO `clients` (`id`, `name`, `document_type`, `document_number`, `email`, `phone`, `address`, `created_at`, `updated_at`) VALUES
	(1, 'CLIENTE 1', 'DNI', '20202020', 'cliente1@correo.com', '30303031', 'direccion 1', '2025-12-28 09:23:27', '2025-12-28 09:23:49'),
	(2, 'CARLOS SOTELO', 'DNI', '34343434', 'carlos@correo.com', '89898989', 'LIMA', '2025-12-29 19:11:46', '2025-12-29 19:11:46');

-- Volcando estructura para tabla restaurante_db.expenses
CREATE TABLE IF NOT EXISTS `expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expenses_user_id_foreign` (`user_id`),
  CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.expenses: ~0 rows (aproximadamente)
DELETE FROM `expenses`;
INSERT INTO `expenses` (`id`, `description`, `amount`, `user_id`, `created_at`, `updated_at`) VALUES
	(1, 'Compra de Limones', 10.00, 1, '2025-12-28 01:18:10', '2025-12-28 01:18:10'),
	(2, 'Bolsa de Hielo', 5.00, 1, '2025-12-28 09:43:00', '2025-12-28 09:43:00'),
	(3, 'Bolsa de Hielo', 10.00, 1, '2025-12-29 19:22:08', '2025-12-29 19:22:08');

-- Volcando estructura para tabla restaurante_db.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;

-- Volcando datos para la tabla restaurante_db.failed_jobs: ~0 rows (aproximadamente)
DELETE FROM `failed_jobs`;

-- Volcando estructura para tabla restaurante_db.inventory_logs
CREATE TABLE IF NOT EXISTS `inventory_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` int NOT NULL,
  `old_stock` int DEFAULT NULL,
  `new_stock` int DEFAULT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `inventory_logs_product_id_foreign` (`product_id`),
  KEY `inventory_logs_user_id_foreign` (`user_id`),
  CONSTRAINT `inventory_logs_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `inventory_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.inventory_logs: ~6 rows (aproximadamente)
DELETE FROM `inventory_logs`;
INSERT INTO `inventory_logs` (`id`, `product_id`, `user_id`, `type`, `quantity`, `old_stock`, `new_stock`, `note`, `created_at`, `updated_at`) VALUES
	(1, 3, 1, 'entry', 50, 0, 50, 'PROVEEDOR 1', '2025-12-29 19:05:50', '2025-12-29 19:05:50'),
	(2, 3, 1, 'sale', -1, 50, 49, 'Venta POS #1', '2025-12-29 19:06:07', '2025-12-29 19:06:07'),
	(3, 7, 1, 'entry', 10, 0, 10, 'Stock Inicial', '2025-12-29 19:14:18', '2025-12-29 19:14:18'),
	(4, 8, 1, 'entry', 5, 0, 5, 'Stock Inicial', '2025-12-29 19:16:08', '2025-12-29 19:16:08'),
	(5, 9, 1, 'entry', 20, 0, 20, 'Stock Inicial', '2025-12-29 19:18:27', '2025-12-29 19:18:27'),
	(6, 1, 1, 'entry', 20, 0, 20, 'PROVEEDOR 1', '2025-12-29 19:19:03', '2025-12-29 19:19:03'),
	(7, 6, 1, 'entry', 20, 0, 20, 'PROVEEDOR 1', '2025-12-29 19:19:15', '2025-12-29 19:19:15'),
	(8, 5, 1, 'entry', 5, 0, 5, 'PROVEEDOR 1', '2025-12-29 19:19:25', '2025-12-29 19:19:25'),
	(9, 2, 1, 'entry', 5, 0, 5, 'PROVEEDOR 1', '2025-12-29 19:19:41', '2025-12-29 19:19:41'),
	(10, 4, 1, 'entry', 10, 0, 10, 'PROVEEDOR 1', '2025-12-29 19:20:19', '2025-12-29 19:20:19'),
	(11, 7, 1, 'sale', -1, 10, 9, 'Venta POS #2', '2025-12-29 19:23:37', '2025-12-29 19:23:37'),
	(12, 6, 1, 'sale', -1, 20, 19, 'Venta: Hamburguesa Clásica (Orden #2)', '2025-12-29 19:23:37', '2025-12-29 19:23:37'),
	(13, 9, 1, 'sale', -1, 20, 19, 'Venta POS #2', '2025-12-29 19:23:37', '2025-12-29 19:23:37');

-- Volcando estructura para tabla restaurante_db.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;

-- Volcando datos para la tabla restaurante_db.jobs: ~0 rows (aproximadamente)
DELETE FROM `jobs`;

-- Volcando estructura para tabla restaurante_db.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;

-- Volcando datos para la tabla restaurante_db.job_batches: ~0 rows (aproximadamente)
DELETE FROM `job_batches`;

-- Volcando estructura para tabla restaurante_db.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=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.migrations: ~19 rows (aproximadamente)
DELETE FROM `migrations`;
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, '2025_12_25_151213_create_categories_table', 1),
	(5, '2025_12_25_151226_create_products_table', 1),
	(6, '2025_12_25_151405_create_areas_table', 1),
	(7, '2025_12_25_151405_create_tables_table', 1),
	(8, '2025_12_25_152440_create_sessions_table', 1),
	(9, '2025_12_25_154209_create_orders_table', 1),
	(10, '2025_12_25_154210_create_order_details_table', 1),
	(11, '2025_12_25_182109_create_settings_table', 2),
	(12, '2025_12_25_190357_add_payments_to_orders_table', 3),
	(13, '2025_12_25_194039_add_note_to_order_details_table', 4),
	(14, '2025_12_27_201525_create_expenses_table', 5),
	(15, '2025_12_27_202113_add_client_data_to_orders', 6),
	(16, '2025_12_27_203616_add_discount_and_tip_to_orders', 7),
	(17, '2025_12_28_024400_add_role_to_users', 8),
	(18, '2025_12_28_032924_create_inventory_logs_table', 8),
	(19, '2025_12_28_041453_create_clients_table', 9),
	(20, '2025_12_28_043046_add_client_id_to_orders_table', 10),
	(21, '2025_12_29_140318_add_position_to_tables_table', 11),
	(22, '2025_12_29_142451_add_coords_to_tables', 12),
	(23, '2025_12_29_161924_create_reservations_table', 13),
	(24, '2025_12_29_180402_create_product_ingredients_table', 14),
	(25, '2025_12_29_182322_add_is_saleable_to_products_table', 15);

-- Volcando estructura para tabla restaurante_db.orders
CREATE TABLE IF NOT EXISTS `orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `table_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `status` enum('pending','completed','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `document_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Ticket',
  `client_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Público General',
  `client_document` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total` decimal(10,2) NOT NULL DEFAULT '0.00',
  `discount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `tip` decimal(10,2) NOT NULL DEFAULT '0.00',
  `payment_method` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash',
  `received_amount` decimal(10,2) DEFAULT NULL,
  `change_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `client_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `orders_table_id_foreign` (`table_id`),
  KEY `orders_user_id_foreign` (`user_id`),
  KEY `orders_client_id_foreign` (`client_id`),
  CONSTRAINT `orders_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE SET NULL,
  CONSTRAINT `orders_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`),
  CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.orders: ~18 rows (aproximadamente)
DELETE FROM `orders`;
INSERT INTO `orders` (`id`, `table_id`, `user_id`, `status`, `document_type`, `client_name`, `client_document`, `total`, `discount`, `tip`, `payment_method`, `received_amount`, `change_amount`, `notes`, `created_at`, `updated_at`, `client_id`) VALUES
	(1, 1, 1, 'completed', 'Ticket', 'CLIENTE 1', NULL, 3.50, 0.00, 0.00, 'cash', 3.50, 0.00, NULL, '2025-12-29 19:05:58', '2025-12-29 19:06:07', NULL),
	(2, 12, 1, 'completed', 'Ticket', 'CARLOS SOTELO', NULL, 21.50, 2.00, 5.00, 'cash', 21.50, 0.00, NULL, '2025-12-29 19:22:41', '2025-12-29 19:23:37', 2);

-- Volcando estructura para tabla restaurante_db.order_details
CREATE TABLE IF NOT EXISTS `order_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `product_id` bigint unsigned NOT NULL,
  `quantity` int NOT NULL DEFAULT '1',
  `price` decimal(10,2) NOT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','cooking','served') 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_details_order_id_foreign` (`order_id`),
  KEY `order_details_product_id_foreign` (`product_id`),
  CONSTRAINT `order_details_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.order_details: ~30 rows (aproximadamente)
DELETE FROM `order_details`;
INSERT INTO `order_details` (`id`, `order_id`, `product_id`, `quantity`, `price`, `note`, `status`, `created_at`, `updated_at`) VALUES
	(1, 1, 3, 1, 3.50, NULL, 'pending', '2025-12-29 19:05:58', '2025-12-29 19:05:58'),
	(2, 2, 7, 1, 3.00, NULL, 'pending', '2025-12-29 19:22:41', '2025-12-29 19:22:41'),
	(3, 2, 1, 1, 12.50, NULL, 'pending', '2025-12-29 19:22:48', '2025-12-29 19:22:48'),
	(4, 2, 9, 1, 3.00, NULL, 'pending', '2025-12-29 19:22:51', '2025-12-29 19:22:51');

-- Volcando estructura para tabla restaurante_db.products
CREATE TABLE IF NOT EXISTS `products` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `category_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `cost` decimal(10,2) DEFAULT NULL,
  `stock` int DEFAULT NULL,
  `is_saleable` tinyint(1) NOT NULL DEFAULT '1',
  `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`),
  KEY `products_category_id_foreign` (`category_id`),
  CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.products: ~5 rows (aproximadamente)
DELETE FROM `products`;
INSERT INTO `products` (`id`, `category_id`, `name`, `code`, `price`, `cost`, `stock`, `is_saleable`, `image`, `is_active`, `created_at`, `updated_at`) VALUES
	(1, 2, 'Hamburguesa Clásica', NULL, 12.50, NULL, 20, 1, 'products/bPD8jEU4aDeR5E09QCgJ4p6pdWF7HcI4HUdHudMd.png', 1, '2025-12-25 21:31:47', '2025-12-29 19:19:03'),
	(2, 2, 'Hamburguesa Doble Queso', NULL, 15.00, NULL, 5, 1, 'products/ui23JdxItgBLUex4NrB5Yomm9L3zLRNcloCt9pgD.png', 1, '2025-12-25 21:31:47', '2025-12-29 19:19:41'),
	(3, 1, 'Coca Cola 500ml', NULL, 3.50, NULL, 49, 1, 'products/4IcdWFRUgmFyw9Iu4QQ22PHlY3o5FUqrTga47UAv.png', 1, '2025-12-25 21:31:47', '2025-12-29 19:06:07'),
	(4, 1, 'Limonada Frozen', NULL, 5.00, NULL, 10, 1, 'products/X4li3YMa9TBMX7Zjob8cf4yX7rkebA04oZgSOAOL.png', 1, '2025-12-25 21:31:47', '2025-12-29 19:20:19'),
	(5, 3, 'Cheesecake Fresa', NULL, 8.00, NULL, 5, 1, 'products/gya3EvTiCjEHppXA2YnFILGBY9tfyIezPZ8SC6l2.png', 1, '2025-12-25 21:31:47', '2025-12-29 19:19:25'),
	(6, 2, 'Carne', NULL, 3.50, NULL, 19, 0, 'products/kFspkKw8mN4HXK9s9HqmUXBJKzxxuGg2kPFFw1ge.png', 1, '2025-12-29 18:11:15', '2025-12-29 19:23:37'),
	(7, 4, 'Donofrio Frio Rico x 93ML', NULL, 3.00, NULL, 9, 1, 'products/5TBf02o1WLCw5eCDegDpzatmeyC0w1grZZwXJ1Wo.png', 1, '2025-12-29 19:14:18', '2025-12-29 19:23:37'),
	(8, 4, 'Donofrio Sublime Paleta Bolsa 80ml', NULL, 4.00, NULL, 5, 1, 'products/y8Pfh5On0SczB5xmEBqwD7T5bc7O8c9HA3QF7guA.png', 1, '2025-12-29 19:16:08', '2025-12-29 19:16:17'),
	(9, 1, 'Inca Kola 500ML', NULL, 3.00, NULL, 19, 1, 'products/MeHweoXnNPWWLH83DYHLINTFxNaz77ng9gynP8qU.png', 1, '2025-12-29 19:18:27', '2025-12-29 19:23:37');

-- Volcando estructura para tabla restaurante_db.product_ingredients
CREATE TABLE IF NOT EXISTS `product_ingredients` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint unsigned NOT NULL,
  `ingredient_id` bigint unsigned NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_ingredients_product_id_foreign` (`product_id`),
  KEY `product_ingredients_ingredient_id_foreign` (`ingredient_id`),
  CONSTRAINT `product_ingredients_ingredient_id_foreign` FOREIGN KEY (`ingredient_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `product_ingredients_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.product_ingredients: ~0 rows (aproximadamente)
DELETE FROM `product_ingredients`;
INSERT INTO `product_ingredients` (`id`, `product_id`, `ingredient_id`, `quantity`, `created_at`, `updated_at`) VALUES
	(1, 1, 6, 1.00, '2025-12-29 18:11:39', '2025-12-29 18:11:39');

-- Volcando estructura para tabla restaurante_db.reservations
CREATE TABLE IF NOT EXISTS `reservations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `client_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reservation_time` datetime NOT NULL,
  `people` int NOT NULL,
  `table_id` bigint unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `status` enum('pending','confirmed','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 `reservations_table_id_foreign` (`table_id`),
  CONSTRAINT `reservations_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.reservations: ~1 rows (aproximadamente)
DELETE FROM `reservations`;
INSERT INTO `reservations` (`id`, `client_name`, `phone`, `reservation_time`, `people`, `table_id`, `note`, `status`, `created_at`, `updated_at`) VALUES
	(1, 'Victor Ramos', '999999992', '2025-12-29 18:30:00', 2, 12, 'Fin de Año 2025', 'confirmed', '2025-12-29 19:24:52', '2025-12-29 19:24:56');

-- Volcando estructura para tabla restaurante_db.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;

-- Volcando datos para la tabla restaurante_db.sessions: ~2 rows (aproximadamente)
DELETE FROM `sessions`;
INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
	('tevhsYlqWY88W5t83UuV5HZqxEBLuqmfpBIWBl2o', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoieklacjc2Z0ZzR0lsQkQ4UGxuWEsydGJrUlJvNDNCbkRMM0NBYW14RSI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MzA6Imh0dHBzOi8vcmVzdGF1cmFudGUudGVzdC9zYWxlcyI7czo1OiJyb3V0ZSI7czoxMToic2FsZXMuaW5kZXgiO31zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=', 1767036315),
	('utyjxouJN4eXahbIvuuDWXT2OzbFTbPcozxcJ8Ro', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiS0d0YXA2RnA5NUdjRTJvZ3A1M1U3OVFWekNBYXNIOFByZ3FoQnJZOSI7czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czoyMToiaHR0cDovLzEyNy4wLjAuMTo4MDAwIjt9czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6Mjk6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9yZXBvcnRzIjtzOjU6InJvdXRlIjtzOjEzOiJyZXBvcnRzLmluZGV4Ijt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTt9', 1767041686);

-- Volcando estructura para tabla restaurante_db.tables
CREATE TABLE IF NOT EXISTS `tables` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `area_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `seats` int NOT NULL DEFAULT '4',
  `status` enum('available','occupied','reserved') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'available',
  `x_pos` int NOT NULL DEFAULT '0',
  `y_pos` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tables_area_id_foreign` (`area_id`),
  CONSTRAINT `tables_area_id_foreign` FOREIGN KEY (`area_id`) REFERENCES `areas` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla restaurante_db.tables: ~11 rows (aproximadamente)
DELETE FROM `tables`;
INSERT INTO `tables` (`id`, `area_id`, `name`, `seats`, `status`, `x_pos`, `y_pos`, `created_at`, `updated_at`) VALUES
	(1, 1, 'Mesa 1', 4, 'available', 0, 0, '2025-12-25 21:31:47', '2025-12-25 21:31:47'),
	(2, 1, 'Mesa 2', 4, 'available', 19, 305, '2025-12-25 21:31:47', '2025-12-29 19:30:37'),
	(3, 1, 'Mesa 3', 4, 'available', 414, 60, '2025-12-25 21:31:47', '2025-12-29 19:30:37'),
	(4, 1, 'Mesa 4', 4, 'available', 201, 189, '2025-12-25 21:31:47', '2025-12-29 19:30:37'),
	(5, 1, 'Mesa 5', 4, 'available', 599, 355, '2025-12-25 21:31:47', '2025-12-29 19:30:37'),
	(6, 2, 'T-1', 2, 'available', 29, 11, '2025-12-25 21:31:47', '2025-12-29 19:21:30'),
	(7, 2, 'T-2', 2, 'available', 207, 10, '2025-12-25 21:31:47', '2025-12-29 19:21:30'),
	(8, 2, 'T-3', 2, 'available', 371, 17, '2025-12-25 21:31:47', '2025-12-29 19:21:30'),
	(9, 1, 'Mesa 6', 4, 'available', 695, 122, '2025-12-28 01:24:36', '2025-12-29 19:30:37'),
	(10, 2, 'MESA T1', 4, 'available', 1328, 16, '2025-12-28 01:40:05', '2025-12-29 19:21:30'),
	(11, 2, 'MESA T2', 4, 'available', 1147, 16, '2025-12-28 02:14:01', '2025-12-29 19:21:30'),
	(12, 2, 'MESA ESPECIAL 1', 4, 'available', 724, 183, '2025-12-28 07:24:53', '2025-12-29 19:21:30'),
	(13, 1, 'Mesa 7', 4, 'available', 201, 485, '2025-12-28 07:38:28', '2025-12-29 19:30:37'),
	(14, 1, 'MESA ESPECIAL', 4, 'available', 1381, 29, '2025-12-29 20:59:50', '2025-12-29 20:59:56'),
	(15, 1, 'Mesa Aniversario', 4, 'available', 1408, 410, '2025-12-29 21:29:16', '2025-12-29 21:29:23');

