-- Table structure for table `model_has_permissions`
--

CREATE TABLE IF NOT EXISTS `model_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE IF NOT EXISTS `model_has_roles` (
  `role_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(1, 'user', 1),
(2, 'user', 2),
(3, 'user', 9),
(4, 'user', 10),
(7, 'user', 11),
(11, 'user', 3),
(11, 'user', 13),
(12, 'user', 4),
(12, 'user', 12),
(12, 'user', 14),
(12, 'user', 15),
(14, 'user', 5),
(15, 'user', 6),
(16, 'user', 7),
(17, 'user', 8);

-- --------------------------------------------------------

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

CREATE TABLE IF NOT EXISTS `notifications` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notifiable_type` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notifiable_id` bigint UNSIGNED NOT NULL,
  `data` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`),
  KEY `notifications_notifiable_id_index` (`notifiable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE IF NOT EXISTS `orders` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `session_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `contact_id` bigint UNSIGNED DEFAULT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `business_date` date DEFAULT NULL,
  `zone_order_sequence` int UNSIGNED DEFAULT NULL,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `outlet_id` bigint UNSIGNED DEFAULT NULL,
  `service_context_type` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `service_point_id` bigint UNSIGNED DEFAULT NULL,
  `service_location_label` varchar(120) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `subtotal` int UNSIGNED NOT NULL DEFAULT '0',
  `discount_total` int UNSIGNED NOT NULL DEFAULT '0',
  `service_fee` int UNSIGNED NOT NULL DEFAULT '0',
  `tax_total` int UNSIGNED NOT NULL DEFAULT '0',
  `grand_total` int UNSIGNED NOT NULL DEFAULT '0',
  `refunded_amount` bigint UNSIGNED NOT NULL DEFAULT '0',
  `service_fee_rate` decimal(5,4) NOT NULL DEFAULT '0.0000',
  `tax_rate` decimal(8,4) NOT NULL DEFAULT '0.1400',
  `currency` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'EGP',
  `coupon_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `customer_notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `fulfillment_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'asap',
  `priority` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'normal',
  `preferred_time` time DEFAULT NULL,
  `preferred_date` date DEFAULT NULL,
  `calculated_ready_at` datetime DEFAULT NULL,
  `prep_time_minutes_snapshot` smallint UNSIGNED DEFAULT NULL,
  `guest_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `guest_phone` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `guest_email` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `status` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `payment_status` enum('pending','processing','paid','failed','refunded') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `payment_method` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `payment_reference` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `payment_id` bigint UNSIGNED DEFAULT NULL,
  `item_count` int UNSIGNED NOT NULL DEFAULT '0',
  `unique_items` int UNSIGNED NOT NULL DEFAULT '0',
  `avg_item_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `source` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'guest_portal',
  `cart_id` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `confirmed_by_user_id` bigint UNSIGNED DEFAULT NULL,
  `confirmed_by_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `confirmed_source` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `orders_code_unique` (`code`),
  UNIQUE KEY `orders_zone_business_sequence_unique` (`zone_id`,`business_date`,`zone_order_sequence`),
  KEY `orders_cart_id_foreign` (`cart_id`),
  KEY `orders_session_id_index` (`session_id`),
  KEY `orders_user_id_index` (`user_id`),
  KEY `orders_payment_status_index` (`payment_status`),
  KEY `orders_source_index` (`source`),
  KEY `orders_fulfillment_type_index` (`fulfillment_type`),
  KEY `orders_calculated_ready_at_index` (`calculated_ready_at`),
  KEY `orders_priority_index` (`priority`),
  KEY `orders_payment_method_index` (`payment_method`),
  KEY `orders_unit_id_index` (`unit_id`),
  KEY `orders_department_id_foreign` (`department_id`),
  KEY `orders_business_date_index` (`business_date`),
  KEY `orders_confirmed_by_user_id_foreign` (`confirmed_by_user_id`),
  KEY `orders_service_point_id_foreign` (`service_point_id`),
  KEY `idx_orders_zone_status_date` (`zone_id`,`status`,`created_at`),
  KEY `idx_orders_outlet_status_date` (`outlet_id`,`status`,`created_at`),
  KEY `idx_orders_contact_date` (`contact_id`,`created_at`),
  KEY `idx_orders_unit_status_date` (`unit_id`,`status`,`created_at`),
  KEY `idx_orders_payment_status_date` (`payment_status`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=82 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

INSERT INTO `orders` (`id`, `code`, `session_id`, `user_id`, `contact_id`, `zone_id`, `business_date`, `zone_order_sequence`, `unit_id`, `outlet_id`, `service_context_type`, `service_point_id`, `service_location_label`, `subtotal`, `discount_total`, `service_fee`, `tax_total`, `grand_total`, `refunded_amount`, `service_fee_rate`, `tax_rate`, `currency`, `coupon_code`, `notes`, `customer_notes`, `fulfillment_type`, `priority`, `preferred_time`, `preferred_date`, `calculated_ready_at`, `prep_time_minutes_snapshot`, `guest_name`, `guest_phone`, `guest_email`, `status`, `payment_status`, `payment_method`, `payment_reference`, `payment_id`, `item_count`, `unique_items`, `avg_item_price`, `source`, `cart_id`, `created_at`, `updated_at`, `confirmed_at`, `confirmed_by_user_id`, `confirmed_by_name`, `confirmed_source`, `completed_at`, `cancelled_at`, `department_id`) VALUES
(1, 'ORD-T0TE3HSW', NULL, 1, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4000, 0, 0, 0, 5768, 4000, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'يييييي', '', NULL, 4, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-05-23 12:04:08', '2026-05-24 05:25:14', NULL, NULL, NULL, NULL, '2026-05-24 05:25:14', NULL, NULL),
(2, 'ORD-5Z4BMV1D', NULL, 1, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 6418, 4500, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '1111', '', NULL, 6, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-05-23 17:00:31', '2026-05-24 03:29:31', NULL, NULL, NULL, NULL, NULL, '2026-05-23 17:00:55', NULL),
(3, 'ORD-UUVBTKMN', NULL, 1, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 13000, 0, 0, 0, 17464, 17464, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'ققققققققققق', '', NULL, 4, 'pending', 1, NULL, NULL, 2, 2, '0.00', 'guest_portal', NULL, '2026-05-23 17:08:17', '2026-05-24 03:12:13', NULL, NULL, NULL, NULL, '2026-05-24 03:12:13', NULL, NULL),
(4, 'ORD-E17QTTNH', NULL, 1, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4000, 0, 0, 0, 5768, 5768, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'dddddddd', '', NULL, 4, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-05-24 03:49:59', '2026-05-24 05:25:34', NULL, NULL, NULL, NULL, '2026-05-24 05:25:34', NULL, NULL),
(5, 'ORD-3POEKBEY', NULL, 1, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 5500, 0, 0, 0, 7717, 7717, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'rr', '', NULL, 6, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-05-24 05:00:24', '2026-05-24 05:00:37', NULL, NULL, NULL, NULL, NULL, '2026-05-24 05:00:37', NULL),
(6, 'ORD-RTH4JARE', NULL, 1, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4000, 0, 0, 0, 5768, 5768, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'dddd', '', NULL, 6, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-05-24 05:12:04', '2026-05-24 05:12:13', NULL, NULL, NULL, NULL, NULL, '2026-05-24 05:12:13', NULL),
(7, 'ORD-C9MSCGNF', NULL, 1, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 6418, 6418, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'dfsdfsd', '', NULL, 6, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-05-24 05:14:00', '2026-05-24 05:14:07', NULL, NULL, NULL, NULL, NULL, '2026-05-24 05:14:07', NULL),
(8, 'ORD-260523-SKMD', '05aUavZWr9ohmKyNdbBIzO6G6PPEoHES14mSyGE3', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 10000, 0, 3566, 0, 13566, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-24 12:03:25', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 2, 2, '50.00', 'guest_portal', 1, '2026-05-24 11:33:25', '2026-05-24 11:33:25', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9, 'ORD-260523-OSXQ', 'lbAC3nvo1tmNNg2YPesrltXUgetg9WwGkZIn3fDt', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 1200, 0, 5700, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-24 12:06:02', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 1, 1, '45.00', 'guest_portal', 2, '2026-05-24 11:36:02', '2026-05-24 11:36:02', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(10, 'ORD-260523-253V', 'lbAC3nvo1tmNNg2YPesrltXUgetg9WwGkZIn3fDt', NULL, NULL, 1, NULL, NULL, 15, NULL, NULL, NULL, NULL, 24500, 0, 7910, 0, 32410, 32410, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-24 14:13:12', 30, 'Taha', '1200250791', '', 6, 'paid', 1, NULL, NULL, 6, 3, '58.33', 'guest_portal', 3, '2026-05-24 13:43:12', '2026-06-15 11:38:13', NULL, NULL, NULL, NULL, NULL, '2026-06-15 11:38:13', NULL),
(11, 'ORD-260523-WAMX', 'UDeLp4ZU9EnoZ03xfNpId1Jq0g0k2xW3acQoTuXj', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 24500, 0, 4000, 0, 28500, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-24 14:44:20', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 5, 4, '52.50', 'guest_portal', 4, '2026-05-24 11:14:20', '2026-05-24 11:14:20', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(12, 'ORD-260523-N4VI', 'UDeLp4ZU9EnoZ03xfNpId1Jq0g0k2xW3acQoTuXj', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 3500, 0, 1060, 0, 4560, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-24 14:54:15', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 1, 1, '35.00', 'guest_portal', 5, '2026-05-24 11:24:15', '2026-05-24 11:24:15', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(13, 'ORD-260523-KS54', 'UDeLp4ZU9EnoZ03xfNpId1Jq0g0k2xW3acQoTuXj', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 3500, 0, 1060, 0, 4560, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-24 14:58:50', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 1, 1, '35.00', 'guest_portal', 6, '2026-05-24 11:28:50', '2026-05-24 11:28:50', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(14, 'ORD-260523-KX0D', '9IRylClkFsYofKVrg9gHFLO1cGuagm54si7Qoyd2', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 5500, 0, 1340, 0, 6840, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-29 14:55:39', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 1, 1, '55.00', 'guest_portal', 8, '2026-05-29 11:25:39', '2026-05-29 11:25:39', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(15, 'ORD-260523-MXL5', 'oLXv3FrAJHLfQwlKeEiQNXJEjlo0hTi5vG3NCDsK', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 2000, 0, 850, 0, 2850, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-30 18:14:25', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 1, 1, '20.00', 'guest_portal', 10, '2026-05-30 14:44:25', '2026-05-30 14:44:25', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(16, 'ORD-260523-HJ6Y', 'NVX0wYAxsH4eTHkqjMZtRtVXYrg32VpTtvwJweyE', NULL, NULL, 1, NULL, NULL, 2, NULL, NULL, NULL, NULL, 1500, 0, 780, 0, 2280, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-05-30 22:33:44', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 1, 1, '15.00', 'guest_portal', 11, '2026-05-30 19:03:44', '2026-05-30 19:03:44', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(17, 'ORD-260524-EDZT', 'gw5T1uzi1kFP2OmS6F2bz0MqHrJzGM1agR7jp5cZ', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 21000, 0, 3510, 0, 24510, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-06-04 23:13:54', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 6, 1, '35.00', 'guest_portal', 12, '2026-06-04 19:43:54', '2026-06-04 19:43:54', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(18, 'ORD-260524-IDVY', 'gw5T1uzi1kFP2OmS6F2bz0MqHrJzGM1agR7jp5cZ', NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 11000, 0, 2110, 0, 13110, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-06-05 01:30:52', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 2, 1, '55.00', 'guest_portal', 13, '2026-06-04 22:00:52', '2026-06-04 22:00:52', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(19, 'ORD-260524-AQIJ', 'KiEDqw7ciIYPbjzrSxIYC8vTfsMnnfBgXPRDIDOZ', NULL, NULL, 1, NULL, NULL, 2, NULL, NULL, NULL, NULL, 4500, 0, 1200, 0, 5700, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-06-06 02:07:42', 30, 'Taha', '1200250791', '', 1, 'pending', 1, NULL, NULL, 1, 1, '45.00', 'guest_portal', 14, '2026-06-06 01:37:42', '2026-06-06 01:37:42', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(20, 'ORD-260524-OVA3', 'YUCSbZZIzWmLJd6KbOWxyU5bi3KnEXYUcx3vYL1a', NULL, NULL, 1, NULL, NULL, 2, NULL, NULL, NULL, NULL, 9000, 0, 1830, 0, 10830, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-06-06 02:17:11', 30, 'Taha Eid', '1200250791', '', 1, 'pending', 1, NULL, NULL, 3, 3, '30.00', 'guest_portal', 15, '2026-06-06 01:47:11', '2026-06-06 01:47:11', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(21, 'ORD-260524-ZQSP', 'EfnZD2Vlc0SdgXlynHjEye4oQuENGBAggUJIPfHY', NULL, NULL, 1, NULL, NULL, 2, NULL, NULL, NULL, NULL, 11500, 0, 2180, 0, 13680, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-06-06 02:24:20', 30, 'Mostafa Elsaadany ', '1224289190', 'melsaadany@acapitalholding.com', 1, 'pending', 1, NULL, NULL, 4, 4, '28.75', 'guest_portal', 16, '2026-06-06 01:54:20', '2026-06-06 01:54:20', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(22, 'ORD-QBNJ0XQ3', NULL, 2, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 27500, 5000, 4420, 0, 26920, 2321, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'mostafa', '', NULL, 4, 'paid', 1, NULL, NULL, 6, 6, '0.00', 'guest_portal', NULL, '2026-06-06 02:25:22', '2026-06-06 02:37:02', NULL, NULL, NULL, NULL, '2026-06-06 02:33:40', NULL, NULL),
(23, 'ORD-260524-1RWE', 'EfnZD2Vlc0SdgXlynHjEye4oQuENGBAggUJIPfHY', NULL, NULL, 1, NULL, NULL, 14, NULL, NULL, NULL, NULL, 15000, 0, 2670, 0, 17670, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-06-06 03:19:48', 30, 'Mostafa Elsaadany', '1117076651', 'melsaadany@acapitalholding.com', 1, 'pending', 1, NULL, NULL, 2, 1, '75.00', 'guest_portal', 17, '2026-06-06 02:49:48', '2026-06-06 02:49:48', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(24, 'ORD-PRINT-ITGKO', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 4500, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 18:28:32', '2026-06-08 18:28:32', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(25, 'ORD-PRINT-2NMBW', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 4500, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 18:29:10', '2026-06-08 18:29:10', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(26, 'ORD-PRINT-JYAL2', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 4500, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 18:29:44', '2026-06-08 18:29:44', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(27, 'ORD-PRINT-N49S8', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 1200, 0, 5700, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 21, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 18:35:34', '2026-06-08 18:37:01', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(28, 'ORD-PRINT-IRDKR', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 4500, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 18:40:56', '2026-06-08 18:40:56', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(29, 'ORD-PRINT-FVVDQ', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 4500, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 18:42:10', '2026-06-08 18:42:10', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30, 'ORD-YLYSKNKH', NULL, 2, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 6000, 0, 0, 0, 7409, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'taha', '012', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-08 18:43:42', '2026-06-08 18:43:42', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(31, 'ORD-IIGWONQ7', NULL, 2, NULL, 1, NULL, NULL, 9, NULL, NULL, NULL, NULL, 22500, 0, 0, 0, 26220, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Taha', '1233', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-08 18:52:05', '2026-06-08 18:52:05', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(32, 'ORD-PRINT-AWFME', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 4500, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 18:56:59', '2026-06-08 18:56:59', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(33, 'ORD-PRINT-EZRIB', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 4500, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 18:57:12', '2026-06-08 18:57:12', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(34, 'ORD-P9XS3DAT', NULL, 2, NULL, 1, NULL, NULL, 3, NULL, NULL, NULL, NULL, 2000, 0, 0, 0, 2850, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '11', '', NULL, 4, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-08 19:13:20', '2026-06-08 19:14:37', NULL, NULL, NULL, NULL, '2026-06-08 19:14:37', NULL, NULL),
(35, 'ORD-GOOOTCCX', NULL, 2, NULL, 1, NULL, NULL, 5, NULL, NULL, NULL, NULL, 4000, 0, 0, 0, 5130, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '00', '', NULL, 20, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-08 19:18:21', '2026-06-08 19:18:28', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(36, 'ORD-OCJVFZWH', NULL, 2, NULL, 1, NULL, NULL, 2, NULL, NULL, NULL, NULL, 7500, 0, 0, 0, 9120, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '11', '111', NULL, 20, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-08 19:20:36', '2026-06-08 19:20:45', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(37, 'ORD-CVQNTLOI', NULL, 2, NULL, 1, NULL, NULL, 3, NULL, NULL, NULL, NULL, 4000, 0, 0, 0, 5130, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'dddd', '', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-08 22:04:10', '2026-06-08 22:04:10', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(38, 'ORD-EIFIXRGB', NULL, 2, NULL, 1, NULL, NULL, 2, NULL, NULL, NULL, NULL, 14500, 0, 0, 0, 17100, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'ggg', '', NULL, 20, 'pending', 1, NULL, NULL, 3, 3, '0.00', 'guest_portal', NULL, '2026-06-08 22:07:51', '2026-06-08 22:08:11', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(39, 'ORD-APB6ZF4X', NULL, 2, NULL, 1, NULL, NULL, 2, NULL, NULL, NULL, NULL, 2800, 0, 0, 0, 3761, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '555', '', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-08 22:13:36', '2026-06-08 22:13:36', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(40, 'ORD-PRINT-A671K', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 0, 0, 4500, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-08 22:49:25', '2026-06-08 22:49:25', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(41, 'ORD-ZNWXETC5', NULL, 2, NULL, 1, NULL, NULL, 2, NULL, NULL, NULL, NULL, 2000, 0, 0, 0, 2850, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'لتلبتلتلا', '121', NULL, 20, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-09 11:38:21', '2026-06-09 11:47:27', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(42, 'ORD-86GGJKOP', NULL, 2, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 2800, 0, 0, 0, 3761, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'اتالتالت', 'لاتلاتلا', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-09 11:48:13', '2026-06-09 11:48:13', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(43, 'ORD-PRINT-T6LP0', NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 4500, 0, 1918, 0, 6418, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-09 11:51:39', '2026-06-14 12:35:31', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(44, 'ORD-X0PD2UNW', NULL, 2, NULL, 1, '2026-05-26', 13, 2, NULL, NULL, NULL, NULL, 2800, 0, 0, 0, 3761, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'بابابل', '', NULL, 20, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-09 11:52:40', '2026-06-14 15:54:14', '2026-06-14 15:54:14', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(45, 'ORD-PRINT-BSYMQ', NULL, NULL, NULL, 1, '2026-05-26', 7, 1, NULL, NULL, NULL, NULL, 4500, 0, 1918, 0, 6418, 0, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 20, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-09 11:55:03', '2026-06-14 12:37:27', '2026-06-14 12:37:27', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(46, 'ORD-PRINT-YKERJ', NULL, NULL, NULL, 1, '2026-05-26', 8, 1, NULL, NULL, NULL, NULL, 4500, 0, 1200, 0, 5700, 5700, '0.0000', '0.0000', 'EGP', NULL, 'Created from printer-agent:create-real-order-test', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Printer Test Guest', '01000000000', NULL, 6, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'printer_test', NULL, '2026-06-09 11:58:48', '2026-06-14 13:25:19', NULL, 2, 'Admin User', 'cashier_payment', NULL, '2026-06-14 13:25:19', NULL),
(47, 'ORD-5RCJWBLD', NULL, 2, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, 7500, 0, 0, 0, 9120, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '5555', '', NULL, 20, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-09 16:29:43', '2026-06-09 16:43:04', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(48, 'ORD-RDA11HPZ', NULL, 2, NULL, 1, '2026-05-25', 3, 1, NULL, NULL, NULL, NULL, 6000, 0, 0, 0, 7409, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '55515', '51515', NULL, 20, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-09 16:43:38', '2026-06-11 10:34:59', NULL, 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(49, 'ORD-VNO0U67M', NULL, 2, NULL, 1, '2026-05-25', 1, 1, NULL, NULL, NULL, NULL, 7500, 0, 0, 0, 9120, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'يبلاتنم', '', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-09 17:01:14', '2026-06-09 17:01:14', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(50, 'ORD-260525-PADY', 'isttOWBUIlWcR8uwXV703ciL7UcotpNRK8UCmC62', NULL, NULL, 1, '2026-05-25', 2, 2, NULL, NULL, NULL, NULL, 5500, 0, 1340, 0, 6840, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-06-09 22:16:28', 30, 'Taha Eid', '1200250791', '', 1, 'pending', 1, NULL, NULL, 1, 1, '55.00', 'guest_portal', 20, '2026-06-09 18:46:28', '2026-06-09 18:46:28', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(66, 'ORD-5BWZRJHH', NULL, 2, NULL, 1, '2026-05-26', 1, NULL, 1, 'table', 9, 'Table 8', 17900, 0, 3076, 0, 20976, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'فففففف', NULL, NULL, 1, 'pending', 1, NULL, NULL, 6, 6, '0.00', 'guest_portal', NULL, '2026-06-12 16:54:53', '2026-06-14 13:45:12', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(53, 'ORD-WITPHCQQ', NULL, 2, NULL, 1, '2026-05-25', 6, NULL, 1, 'table', 2, 'Table 1', 88500, 0, 0, 0, 101460, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'test', '', NULL, 20, 'paid', 1, NULL, NULL, 5, 5, '0.00', 'guest_portal', NULL, '2026-06-12 11:42:45', '2026-06-12 11:51:02', '2026-06-12 11:51:02', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(59, 'ORD-F4BPDXZN', NULL, 2, NULL, 1, '2026-05-25', 10, NULL, 1, 'table', 2, 'Table 1', 31500, 0, 4980, 0, 36480, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'fhfhfh', '', NULL, 4, 'paid', 1, NULL, NULL, 11, 11, '0.00', 'guest_portal', NULL, '2026-06-12 12:24:09', '2026-06-12 13:55:47', '2026-06-12 13:55:24', 2, 'Admin User', 'cashier_payment', '2026-06-12 13:55:47', NULL, NULL),
(68, 'ORD-WWMPPAWQ', NULL, 2, NULL, 1, '2026-05-26', 3, NULL, 1, 'table', 8, 'Table 7', 9800, 0, 0, 0, 21742, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'تنمتمنت', '', NULL, 20, 'paid', 1, NULL, NULL, 3, 3, '0.00', 'guest_portal', NULL, '2026-06-13 13:23:11', '2026-06-13 13:23:25', '2026-06-13 13:23:25', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(67, 'ORD-0XSDHVLH', NULL, 2, NULL, 1, '2026-05-26', 2, 1, 16, 'room_service', NULL, 'Room 101', 4000, 0, 0, 0, 4560, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'البابلا', '', NULL, 20, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-13 13:22:21', '2026-06-13 13:22:37', '2026-06-13 13:22:37', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(69, 'ORD-AU0GA7TH', NULL, 2, NULL, 1, '2026-05-26', 4, NULL, 1, 'table', 5, 'Table 4', 15700, 0, 12768, 0, 28468, 13500, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Taha', '0120', NULL, 20, 'paid', 1, NULL, NULL, 4, 4, '0.00', 'guest_portal', NULL, '2026-06-13 18:21:09', '2026-06-13 20:24:45', '2026-06-13 20:22:06', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(70, 'ORD-GLI5APUK', NULL, 2, NULL, 1, '2026-05-26', 5, NULL, 1, 'table', 5, 'Table 4', 48000, 0, 0, 0, 65290, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'taha', NULL, NULL, 20, 'paid', 1, NULL, NULL, 11, 11, '0.00', 'guest_portal', NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11', '2026-06-14 13:27:11', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(71, 'ORD-NYX8GYB3', NULL, 2, NULL, 1, '2026-05-26', 6, NULL, 1, 'table', 11, 'Table 10', 78900, 0, 0, 0, 100516, 78900, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '2510', '', NULL, 6, 'pending', 1, NULL, NULL, 18, 18, '0.00', 'guest_portal', NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07', NULL, NULL, NULL, NULL, NULL, '2026-06-14 12:33:07', NULL),
(72, 'ORD-NKBTLW7B', NULL, 2, NULL, 1, '2026-05-26', 9, 2, 16, 'room_service', NULL, 'Room 102', 65500, 0, 0, 0, 84670, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'taha', '', NULL, 1, 'pending', 1, NULL, NULL, 3, 3, '0.00', 'guest_portal', NULL, '2026-06-14 13:34:12', '2026-06-14 13:34:12', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(73, 'ORD-KJZRLIDH', NULL, 2, NULL, 1, '2026-05-26', 10, NULL, 1, 'table', 2, 'Table 1', 2500, 0, 0, 0, 3420, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'فففففف', '', NULL, 20, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-14 13:46:03', '2026-06-14 13:46:10', '2026-06-14 13:46:10', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(74, 'ORD-ZIFI88BD', NULL, 2, NULL, 1, '2026-05-26', 11, NULL, 1, 'table', 3, 'Table 2', 2500, 0, 0, 0, 3420, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'mm', '', NULL, 20, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-14 13:49:53', '2026-06-14 13:50:01', '2026-06-14 13:50:01', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(75, 'ORD-XXXCAJQ4', NULL, 2, NULL, 1, '2026-05-26', 12, 1, 16, 'room_service', NULL, 'Room 101', 7500, 0, 0, 0, 18550, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '524', '', NULL, 20, 'paid', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-14 13:50:23', '2026-06-14 13:50:30', '2026-06-14 13:50:30', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(76, 'ORD-260526-NFRS', '7GEtAuJomVZGc6TYmri1smP12v6qrUYi0XAu2ZIn', NULL, NULL, 1, '2026-05-26', 14, 1, 16, 'room_service', NULL, 'Room 101', 7500, 0, 11050, 0, 18550, 0, '0.0000', '0.1400', 'EGP', NULL, NULL, '', 'asap', 'normal', NULL, NULL, '2026-06-14 18:41:16', 30, 'Ziad Tarek', '1000205146', '', 1, 'pending', 1, NULL, NULL, 1, 1, '75.00', 'guest_portal', 22, '2026-06-14 18:11:16', '2026-06-14 18:11:16', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(77, 'ORD-NORTY86P', NULL, 2, NULL, 1, '2026-05-26', 15, NULL, 1, 'table', 5, 'Table 4', 7500, 0, 0, 0, 9120, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'Taha', '01200000', NULL, 20, 'paid', 1, NULL, NULL, 2, 2, '0.00', 'guest_portal', NULL, '2026-06-14 18:15:41', '2026-06-14 18:15:58', '2026-06-14 18:15:58', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(78, 'ORD-YCU44DII', NULL, 2, NULL, 1, '2026-05-26', 16, NULL, 1, 'table', 5, 'Table 4', 16700, 0, 0, 0, 19608, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '123', '', NULL, 1, 'pending', 1, NULL, NULL, 3, 3, '0.00', 'guest_portal', NULL, '2026-06-14 18:25:28', '2026-06-14 18:25:28', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(79, 'ORD-NXE01288', NULL, 2, NULL, 1, '2026-05-26', 17, NULL, 1, 'table', 4, 'Table 3', 2500, 0, 0, 0, 3420, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, 'gjgf', '', NULL, 1, 'pending', 1, NULL, NULL, 1, 1, '0.00', 'guest_portal', NULL, '2026-06-14 18:25:50', '2026-06-14 18:25:50', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(80, 'ORD-AACLKXWB', NULL, 2, NULL, 1, '2026-05-31', 1, NULL, 1, 'table', 4, 'Table 3', 11300, 0, 0, 0, 13452, 0, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '12131', '', NULL, 20, 'paid', 1, NULL, NULL, 4, 4, '0.00', 'guest_portal', NULL, '2026-06-18 17:34:12', '2026-06-18 17:34:24', '2026-06-18 17:34:24', 2, 'Admin User', 'cashier_payment', NULL, NULL, NULL),
(81, 'ORD-DDABSVLC', NULL, 2, NULL, 1, '2026-05-31', 2, NULL, 1, 'table', 4, 'Table 3', 6300, 0, 0, 0, 7752, 7752, '0.0000', '0.0000', 'EGP', NULL, '', NULL, 'asap', 'normal', NULL, NULL, NULL, NULL, '12131', '', NULL, 6, 'paid', 1, NULL, NULL, 2, 2, '0.00', 'guest_portal', NULL, '2026-06-18 17:34:58', '2026-06-18 17:41:19', '2026-06-18 17:35:34', 2, 'Admin User', 'cashier_payment', '2026-06-18 17:40:36', '2026-06-18 17:41:19', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `orders_archive`
--

CREATE TABLE IF NOT EXISTS `orders_archive` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `session_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `contact_id` bigint UNSIGNED DEFAULT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `business_date` date DEFAULT NULL,
  `zone_order_sequence` int UNSIGNED DEFAULT NULL,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `outlet_id` bigint UNSIGNED DEFAULT NULL,
  `service_context_type` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `service_point_id` bigint UNSIGNED DEFAULT NULL,
  `service_location_label` varchar(120) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `subtotal` int UNSIGNED NOT NULL DEFAULT '0',
  `discount_total` int UNSIGNED NOT NULL DEFAULT '0',
  `service_fee` int UNSIGNED NOT NULL DEFAULT '0',
  `tax_total` int UNSIGNED NOT NULL DEFAULT '0',
  `grand_total` int UNSIGNED NOT NULL DEFAULT '0',
  `refunded_amount` bigint UNSIGNED NOT NULL DEFAULT '0',
  `service_fee_rate` decimal(5,4) NOT NULL DEFAULT '0.0000',
  `tax_rate` decimal(8,4) NOT NULL DEFAULT '0.1400',
  `currency` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'EGP',
  `coupon_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `customer_notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `fulfillment_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'asap',
  `priority` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'normal',
  `preferred_time` time DEFAULT NULL,
  `preferred_date` date DEFAULT NULL,
  `calculated_ready_at` datetime DEFAULT NULL,
  `prep_time_minutes_snapshot` smallint UNSIGNED DEFAULT NULL,
  `guest_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `guest_phone` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `guest_email` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `status` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `payment_status` enum('pending','processing','paid','failed','refunded') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `payment_method` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `payment_reference` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `payment_id` bigint UNSIGNED DEFAULT NULL,
  `item_count` int UNSIGNED NOT NULL DEFAULT '0',
  `unique_items` int UNSIGNED NOT NULL DEFAULT '0',
  `avg_item_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `source` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'guest_portal',
  `cart_id` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `confirmed_by_user_id` bigint UNSIGNED DEFAULT NULL,
  `confirmed_by_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `confirmed_source` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `archived_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `orders_code_unique` (`code`),
  UNIQUE KEY `orders_zone_business_sequence_unique` (`zone_id`,`business_date`,`zone_order_sequence`),
  KEY `orders_cart_id_foreign` (`cart_id`),
  KEY `orders_session_id_index` (`session_id`),
  KEY `orders_user_id_index` (`user_id`),
  KEY `orders_payment_status_index` (`payment_status`),
  KEY `orders_source_index` (`source`),
  KEY `orders_fulfillment_type_index` (`fulfillment_type`),
  KEY `orders_calculated_ready_at_index` (`calculated_ready_at`),
  KEY `orders_priority_index` (`priority`),
  KEY `orders_payment_method_index` (`payment_method`),
  KEY `orders_unit_id_index` (`unit_id`),
  KEY `orders_department_id_foreign` (`department_id`),
  KEY `orders_business_date_index` (`business_date`),
  KEY `orders_confirmed_by_user_id_foreign` (`confirmed_by_user_id`),
  KEY `orders_service_point_id_foreign` (`service_point_id`),
  KEY `idx_orders_zone_status_date` (`zone_id`,`status`,`created_at`),
  KEY `idx_orders_outlet_status_date` (`outlet_id`,`status`,`created_at`),
  KEY `idx_orders_contact_date` (`contact_id`,`created_at`),
  KEY `idx_orders_unit_status_date` (`unit_id`,`status`,`created_at`),
  KEY `idx_orders_payment_status_date` (`payment_status`,`created_at`),
  KEY `idx_archived_at` (`archived_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `order_items`
--

CREATE TABLE IF NOT EXISTS `order_items` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `order_id` bigint UNSIGNED NOT NULL,
  `menu_item_id` bigint UNSIGNED NOT NULL,
  `item_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `item_name_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `quantity` int UNSIGNED NOT NULL DEFAULT '1',
  `unit_price` int UNSIGNED NOT NULL DEFAULT '0',
  `line_discount` int UNSIGNED NOT NULL DEFAULT '0',
  `line_total` int UNSIGNED NOT NULL DEFAULT '0',
  `special_instructions` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `is_featured` tinyint(1) NOT NULL DEFAULT '0',
  `category_id` bigint UNSIGNED DEFAULT NULL,
  `status` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `refunded_qty` int NOT NULL DEFAULT '0',
  `variant_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_items_category_id_foreign` (`category_id`),
  KEY `order_items_order_id_index` (`order_id`),
  KEY `order_items_menu_item_id_index` (`menu_item_id`),
  KEY `order_items_status_index` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=158 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `order_items`
--

INSERT INTO `order_items` (`id`, `order_id`, `menu_item_id`, `item_name`, `item_name_ar`, `quantity`, `unit_price`, `line_discount`, `line_total`, `special_instructions`, `metadata`, `is_featured`, `category_id`, `status`, `refunded_qty`, `variant_name`, `created_at`, `updated_at`) VALUES
(1, 1, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'cancelled', 1, NULL, '2026-05-23 12:04:08', '2026-05-23 17:06:45'),
(2, 2, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, '', NULL, 0, 1, 'cancelled', 1, NULL, '2026-05-23 17:00:31', '2026-05-23 17:00:55'),
(3, 3, 1, 'Koshary', 'كشري', 2, 4500, 0, 9000, '', NULL, 0, 1, 'cancelled', 2, NULL, '2026-05-23 17:08:17', '2026-05-23 17:08:47'),
(4, 3, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'cancelled', 1, NULL, '2026-05-23 17:08:17', '2026-05-23 17:08:35'),
(5, 4, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'cancelled', 1, NULL, '2026-05-24 03:49:59', '2026-05-24 03:50:07'),
(6, 5, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 1, 5500, 0, 5500, '', NULL, 0, 1, 'cancelled', 1, NULL, '2026-05-24 05:00:24', '2026-05-24 05:00:37'),
(7, 6, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'cancelled', 1, NULL, '2026-05-24 05:12:04', '2026-05-24 05:12:13'),
(8, 7, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, '', NULL, 0, 1, 'cancelled', 1, NULL, '2026-05-24 05:14:00', '2026-05-24 05:14:07'),
(9, 8, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 1, 5500, 0, 5500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-05-24 11:33:25', '2026-05-24 11:33:25'),
(10, 8, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-05-24 11:33:25', '2026-05-24 11:33:25'),
(11, 9, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-05-24 11:36:02', '2026-05-24 11:36:02'),
(12, 10, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 2, 5500, 0, 11000, NULL, NULL, 0, 1, 'refunded', 2, NULL, '2026-05-24 13:43:12', '2026-06-15 11:37:55'),
(13, 10, 1, 'Koshary', 'كشري', 3, 4500, 0, 13500, NULL, NULL, 0, 1, 'refunded', 3, NULL, '2026-05-24 13:43:12', '2026-06-15 11:38:13'),
(14, 10, 4, 'Grilled Kofta', 'كفتة مشوية', 1, 7500, 0, 7500, NULL, NULL, 0, 1, 'cancelled', 1, NULL, '2026-05-24 13:43:12', '2026-05-24 21:48:27'),
(15, 11, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 1, 5500, 0, 5500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-05-24 11:14:20', '2026-05-24 11:14:20'),
(16, 11, 4, 'Grilled Kofta', 'كفتة مشوية', 1, 7500, 0, 7500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-05-24 11:14:20', '2026-05-24 11:14:20'),
(17, 11, 26, 'Umm Ali', 'أم علي', 2, 3500, 0, 7000, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-05-24 11:14:20', '2026-05-24 11:14:20'),
(18, 11, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-05-24 11:14:20', '2026-05-24 11:14:20'),
(19, 12, 26, 'Umm Ali', 'أم علي', 1, 3500, 0, 3500, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-05-24 11:24:15', '2026-05-24 11:24:15'),
(20, 13, 26, 'Umm Ali', 'أم علي', 1, 3500, 0, 3500, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-05-24 11:28:50', '2026-05-24 11:28:50'),
(21, 14, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 1, 5500, 0, 5500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-05-29 11:25:39', '2026-05-29 11:25:39'),
(22, 15, 2, 'Falafel (Taameya)', 'طعمية', 1, 2000, 0, 2000, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-05-30 14:44:25', '2026-05-30 14:44:25'),
(23, 16, 16, 'Egyptian Tea', 'شاي مصري', 1, 1500, 0, 1500, NULL, NULL, 0, 2, 'pending', 0, NULL, '2026-05-30 19:03:44', '2026-05-30 19:03:44'),
(24, 17, 26, 'Umm Ali', 'أم علي', 6, 3500, 0, 21000, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-06-04 19:43:54', '2026-06-04 19:43:54'),
(25, 18, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 2, 5500, 0, 11000, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-06-04 22:00:52', '2026-06-04 22:00:52'),
(26, 19, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-06-06 01:37:42', '2026-06-06 01:37:42'),
(27, 20, 31, 'Waffle', 'وافل', 1, 4000, 0, 4000, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-06-06 01:47:11', '2026-06-06 01:47:11'),
(28, 20, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-06-06 01:47:11', '2026-06-06 01:47:11'),
(29, 20, 32, 'Rice Pudding', 'أرز باللبن', 1, 2200, 0, 2200, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-06-06 01:47:11', '2026-06-06 01:47:11'),
(30, 21, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-06-06 01:54:20', '2026-06-06 01:54:20'),
(31, 21, 16, 'Egyptian Tea', 'شاي مصري', 1, 1500, 0, 1500, NULL, NULL, 0, 2, 'pending', 0, NULL, '2026-06-06 01:54:20', '2026-06-06 01:54:20'),
(32, 21, 2, 'Falafel (Taameya)', 'طعمية', 1, 2000, 0, 2000, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-06-06 01:54:20', '2026-06-06 01:54:20'),
(33, 21, 26, 'Umm Ali', 'أم علي', 1, 3500, 0, 3500, NULL, NULL, 0, 3, 'pending', 0, NULL, '2026-06-06 01:54:20', '2026-06-06 01:54:20'),
(34, 22, 2, 'Falafel (Taameya)', 'طعمية', 1, 2000, 0, 2000, '', NULL, 0, 1, 'cancelled', 1, NULL, '2026-06-06 02:25:22', '2026-06-06 02:33:06'),
(35, 22, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 1, 5500, 0, 5500, '', NULL, 0, 1, 'completed', 0, NULL, '2026-06-06 02:25:22', '2026-06-06 02:33:40'),
(36, 22, 4, 'Grilled Kofta', 'كفتة مشوية', 1, 7500, 0, 7500, '', NULL, 0, 1, 'completed', 0, NULL, '2026-06-06 02:25:22', '2026-06-06 02:33:40'),
(37, 22, 6, 'Molokhia', 'ملوخية', 1, 6000, 0, 6000, '', NULL, 0, 1, 'completed', 0, NULL, '2026-06-06 02:25:22', '2026-06-06 02:33:40'),
(38, 22, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, '', NULL, 0, 1, 'completed', 0, NULL, '2026-06-06 02:25:22', '2026-06-06 02:33:40'),
(39, 22, 20, 'Turkish Coffee', 'قهوة تركي', 1, 2000, 0, 2000, '', NULL, 0, 2, 'completed', 0, NULL, '2026-06-06 02:25:22', '2026-06-06 02:33:40'),
(40, 23, 4, 'Grilled Kofta', 'كفتة مشوية', 2, 7500, 0, 15000, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-06-06 02:49:48', '2026-06-06 02:49:48'),
(41, 24, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:28:32', '2026-06-08 18:28:32'),
(42, 25, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:29:10', '2026-06-08 18:29:10'),
(43, 26, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:29:44', '2026-06-08 18:29:44'),
(44, 27, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'preparing', 0, NULL, '2026-06-08 18:35:34', '2026-06-08 18:37:01'),
(45, 28, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:40:56', '2026-06-08 18:40:56'),
(46, 29, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:42:10', '2026-06-08 18:42:10'),
(47, 30, 6, 'Molokhia', 'ملوخية', 1, 6000, 0, 6000, '', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:43:42', '2026-06-08 18:43:42'),
(48, 31, 4, 'Grilled Kofta', 'كفتة مشوية', 3, 7500, 0, 22500, '', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:52:05', '2026-06-08 18:52:05'),
(49, 32, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:56:59', '2026-06-08 18:56:59'),
(50, 33, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 18:57:12', '2026-06-08 18:57:12'),
(51, 34, 2, 'Falafel (Taameya)', 'طعمية', 1, 2000, 0, 2000, '', NULL, 0, 1, 'completed', 0, NULL, '2026-06-08 19:13:20', '2026-06-08 19:14:37'),
(52, 35, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-08 19:18:21', '2026-06-08 19:18:28'),
(53, 36, 4, 'Grilled Kofta', 'كفتة مشوية', 1, 7500, 0, 7500, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-08 19:20:36', '2026-06-08 19:20:45'),
(54, 37, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 22:04:10', '2026-06-08 22:04:10'),
(55, 38, 31, 'Waffle', 'وافل', 2, 4000, 0, 8000, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-08 22:07:51', '2026-06-08 22:08:11'),
(56, 38, 20, 'Turkish Coffee', 'قهوة تركي', 1, 2000, 0, 2000, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-08 22:07:51', '2026-06-08 22:08:21'),
(57, 38, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-08 22:07:51', '2026-06-08 22:08:23'),
(58, 39, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'pending', 0, NULL, '2026-06-08 22:13:36', '2026-06-08 22:13:36'),
(59, 40, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-08 22:49:25', '2026-06-08 22:49:25'),
(60, 41, 2, 'Falafel (Taameya)', 'طعمية', 1, 2000, 0, 2000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-09 11:38:21', '2026-06-09 11:47:27'),
(61, 42, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'pending', 0, NULL, '2026-06-09 11:48:13', '2026-06-09 11:48:13'),
(62, 43, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'pending', 0, NULL, '2026-06-09 11:51:39', '2026-06-09 11:51:39'),
(63, 44, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-09 11:52:40', '2026-06-14 15:54:14'),
(64, 45, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-09 11:55:03', '2026-06-14 12:37:27'),
(65, 46, 1, 'Koshary', 'كشري', 1, 4500, 0, 4500, 'Real order print integration test', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-09 11:58:48', '2026-06-14 13:25:19'),
(66, 47, 4, 'Grilled Kofta', 'كفتة مشوية', 1, 7500, 0, 7500, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-09 16:29:43', '2026-06-09 16:43:04'),
(67, 48, 6, 'Molokhia', 'ملوخية', 1, 6000, 0, 6000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-09 16:43:38', '2026-06-09 16:47:42'),
(68, 49, 4, 'Grilled Kofta', 'كفتة مشوية', 1, 7500, 0, 7500, '', NULL, 0, 1, 'pending', 0, NULL, '2026-06-09 17:01:14', '2026-06-09 17:01:14'),
(69, 50, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 1, 5500, 0, 5500, NULL, NULL, 0, 1, 'pending', 0, NULL, '2026-06-09 18:46:28', '2026-06-09 18:46:28'),
(72, 53, 4, 'Grilled Kofta', 'كفتة مشوية', 2, 7500, 0, 15000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-12 11:42:45', '2026-06-12 11:51:02'),
(73, 53, 29, 'Basbousa', 'بسبوسة', 1, 2500, 0, 2500, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-12 11:42:45', '2026-06-12 11:51:02'),
(74, 53, 6, 'Molokhia', 'ملوخية', 5, 6000, 0, 30000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-12 11:42:45', '2026-06-12 11:51:02'),
(75, 53, 12, 'Pizza', 'بيتزا', 3, 9000, 0, 27000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-12 11:42:45', '2026-06-12 11:51:02'),
(76, 53, 11, 'Pasta', 'باستا', 2, 7000, 0, 14000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-12 11:42:45', '2026-06-12 11:51:02'),
(78, 59, 28, 'Baklava', 'بقلاوة', 1, 3000, 0, 3000, '', NULL, 0, 3, 'completed', 0, NULL, '2026-06-12 12:24:09', '2026-06-12 13:55:47'),
(79, 59, 18, 'Mango Juice', 'عصير مانجو', 1, 2500, 0, 2500, '', NULL, 0, 2, 'completed', 0, NULL, '2026-06-12 12:24:09', '2026-06-12 13:55:47'),
(80, 59, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'completed', 0, NULL, '2026-06-12 12:24:09', '2026-06-12 13:55:47'),
(81, 59, 28, 'Baklava', 'بقلاوة', 1, 3000, 0, 3000, '', NULL, 0, 3, 'completed', 0, NULL, '2026-06-12 12:24:28', '2026-06-12 13:55:47'),
(82, 59, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'completed', 0, NULL, '2026-06-12 12:24:28', '2026-06-12 13:55:47'),
(83, 59, 17, 'Hibiscus (Karkade)', 'كركديه', 1, 1800, 0, 1800, '', NULL, 0, 2, 'completed', 0, NULL, '2026-06-12 12:24:28', '2026-06-12 13:55:47'),
(84, 59, 26, 'Umm Ali', 'أم علي', 1, 3500, 0, 3500, '', NULL, 0, 3, 'completed', 0, NULL, '2026-06-12 12:24:28', '2026-06-12 13:55:47'),
(85, 59, 19, 'Lemon Mint', 'ليمون نعناع', 1, 1800, 0, 1800, '', NULL, 0, 2, 'completed', 0, NULL, '2026-06-12 12:24:28', '2026-06-12 13:55:47'),
(86, 59, 19, 'Lemon Mint', 'ليمون نعناع', 1, 1800, 0, 1800, '', NULL, 0, 2, 'completed', 0, NULL, '2026-06-12 12:25:08', '2026-06-12 13:55:47'),
(87, 59, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'completed', 0, NULL, '2026-06-12 12:25:08', '2026-06-12 13:55:47'),
(88, 59, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'completed', 0, NULL, '2026-06-12 12:25:08', '2026-06-12 13:55:47'),
(94, 66, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, 'fghkl', NULL, 0, 3, 'pending', 0, NULL, '2026-06-12 16:54:53', '2026-06-14 13:45:12'),
(95, 66, 17, 'Hibiscus (Karkade)', 'كركديه', 1, 1800, 0, 1800, '', NULL, 0, 2, 'pending', 0, NULL, '2026-06-12 16:54:53', '2026-06-12 16:54:53'),
(96, 66, 28, 'Baklava', 'بقلاوة', 1, 3000, 0, 3000, '', NULL, 0, 3, 'pending', 0, NULL, '2026-06-12 16:54:53', '2026-06-12 16:54:53'),
(97, 66, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'pending', 0, NULL, '2026-06-12 16:55:15', '2026-06-12 16:55:15'),
(98, 66, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'pending', 0, NULL, '2026-06-12 16:55:15', '2026-06-12 16:55:15'),
(99, 66, 19, 'Lemon Mint', 'ليمون نعناع', 1, 1800, 0, 1800, '', NULL, 0, 2, 'pending', 0, NULL, '2026-06-12 16:55:15', '2026-06-12 16:55:15'),
(100, 67, 2, 'Falafel (Taameya)', 'طعمية', 2, 2000, 0, 4000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-13 13:22:21', '2026-06-13 13:22:37'),
(101, 68, 26, 'Umm Ali', 'أم علي', 1, 3500, 0, 3500, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-13 13:23:11', '2026-06-13 13:23:25'),
(102, 68, 17, 'Hibiscus (Karkade)', 'كركديه', 1, 1800, 0, 1800, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-13 13:23:11', '2026-06-13 13:23:25'),
(103, 68, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-13 13:23:11', '2026-06-13 13:23:25'),
(104, 69, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'cancelled', 0, NULL, '2026-06-13 18:21:09', '2026-06-13 19:00:17'),
(105, 69, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'cancelled', 0, NULL, '2026-06-13 18:21:09', '2026-06-13 19:00:45'),
(106, 70, 17, 'Hibiscus (Karkade)', 'كركديه', 1, 1800, 0, 1800, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(107, 70, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(108, 70, 28, 'Baklava', 'بقلاوة', 1, 3000, 0, 3000, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(109, 70, 20, 'Turkish Coffee', 'قهوة تركي', 1, 2000, 0, 2000, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(110, 70, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(111, 70, 8, 'Grilled Chicken', 'دجاج مشوي', 1, 8500, 0, 8500, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(112, 70, 32, 'Rice Pudding', 'أرز باللبن', 1, 2200, 0, 2200, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(113, 70, 7, 'Grilled Fish', 'سمك مشوي', 1, 12000, 0, 12000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(114, 70, 22, 'Fresh Orange Juice', 'عصير برتقال طازج', 1, 2200, 0, 2200, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(115, 70, 31, 'Waffle', 'وافل', 1, 4000, 0, 4000, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(116, 70, 10, 'Caesar Salad', 'سلطة سيزر', 1, 5000, 0, 5000, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-13 18:55:43', '2026-06-14 13:27:11'),
(117, 69, 21, 'Cappuccino', 'كابتشينو', 1, 3000, 0, 3000, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:20', '2026-06-13 20:23:33'),
(118, 69, 23, 'Watermelon Juice', 'عصير بطيخ', 1, 2000, 0, 2000, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:20', '2026-06-13 20:24:36'),
(119, 69, 8, 'Grilled Chicken', 'دجاج مشوي', 1, 8500, 0, 8500, '', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-13 18:56:20', '2026-06-13 20:24:45'),
(120, 69, 32, 'Rice Pudding', 'أرز باللبن', 1, 2200, 0, 2200, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-13 18:56:20', '2026-06-13 20:22:06'),
(121, 71, 18, 'Mango Juice', 'عصير مانجو', 1, 2500, 0, 2500, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(122, 71, 6, 'Molokhia', 'ملوخية', 1, 6000, 0, 6000, '', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(123, 71, 21, 'Cappuccino', 'كابتشينو', 1, 3000, 0, 3000, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(124, 71, 20, 'Turkish Coffee', 'قهوة تركي', 1, 2000, 0, 2000, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(125, 71, 30, 'Ice Cream', 'آيس كريم', 1, 2800, 0, 2800, '', NULL, 0, 3, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(126, 71, 5, 'Hawawshi', 'حواوشي', 1, 4000, 0, 4000, '', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(127, 71, 19, 'Lemon Mint', 'ليمون نعناع', 1, 1800, 0, 1800, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(128, 71, 29, 'Basbousa', 'بسبوسة', 1, 2500, 0, 2500, '', NULL, 0, 3, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(129, 71, 16, 'Egyptian Tea', 'شاي مصري', 1, 1500, 0, 1500, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(130, 71, 26, 'Umm Ali', 'أم علي', 1, 3500, 0, 3500, '', NULL, 0, 3, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(131, 71, 17, 'Hibiscus (Karkade)', 'كركديه', 1, 1800, 0, 1800, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(132, 71, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(133, 71, 14, 'Seafood Pasta', 'باستا مأكولات بحرية', 1, 11000, 0, 11000, '', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(134, 71, 13, 'Burger', 'برجر', 1, 7500, 0, 7500, '', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(135, 71, 12, 'Pizza', 'بيتزا', 1, 9000, 0, 9000, '', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(136, 71, 11, 'Pasta', 'باستا', 1, 7000, 0, 7000, '', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(137, 71, 10, 'Caesar Salad', 'سلطة سيزر', 1, 5000, 0, 5000, '', NULL, 0, 1, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(138, 71, 24, 'Smoothie', 'سموذي', 1, 3500, 0, 3500, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-13 18:56:50', '2026-06-14 12:33:07'),
(139, 72, 2, 'Falafel (Taameya)', 'طعمية', 1, 2000, 0, 2000, 'fhhghfg gf gfj', NULL, 0, 1, 'pending', 0, NULL, '2026-06-14 13:34:12', '2026-06-14 13:34:12'),
(140, 72, 3, 'Shawarma Sandwich', 'شاورما سندوتش', 2, 5500, 0, 11000, '', NULL, 0, 1, 'pending', 0, NULL, '2026-06-14 13:34:12', '2026-06-14 13:34:12'),
(141, 72, 4, 'Grilled Kofta', 'كفتة مشوية', 7, 7500, 0, 52500, '', NULL, 0, 1, 'pending', 0, NULL, '2026-06-14 13:34:12', '2026-06-14 13:34:12'),
(142, 73, 18, 'Mango Juice', 'عصير مانجو', 1, 2500, 0, 2500, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-14 13:46:03', '2026-06-14 13:46:10'),
(143, 74, 18, 'Mango Juice', 'عصير مانجو', 1, 2500, 0, 2500, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-14 13:49:53', '2026-06-14 13:50:01'),
(144, 75, 4, 'Grilled Kofta', 'كفتة مشوية', 1, 7500, 0, 7500, '', NULL, 0, 1, 'confirmed', 0, NULL, '2026-06-14 13:50:23', '2026-06-14 13:50:30'),
(145, 76, 4, 'Grilled Kofta', 'كفتة مشوية', 1, 7500, 0, 7500, NULL, NULL, 1, 1, 'pending', 0, NULL, '2026-06-14 18:11:16', '2026-06-14 18:11:16'),
(146, 77, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-14 18:15:41', '2026-06-14 18:15:58'),
(147, 77, 28, 'Baklava', 'بقلاوة', 1, 3000, 0, 3000, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-14 18:15:41', '2026-06-14 18:15:58'),
(148, 78, 22, 'Fresh Orange Juice', 'عصير برتقال طازج', 1, 2200, 0, 2200, '', NULL, 0, 2, 'pending', 0, NULL, '2026-06-14 18:25:28', '2026-06-14 18:25:28'),
(149, 78, 7, 'Grilled Fish', 'سمك مشوي', 1, 12000, 0, 12000, '', NULL, 0, 1, 'pending', 0, NULL, '2026-06-14 18:25:28', '2026-06-14 18:25:28'),
(150, 78, 29, 'Basbousa', 'بسبوسة', 1, 2500, 0, 2500, '', NULL, 0, 3, 'pending', 0, NULL, '2026-06-14 18:25:28', '2026-06-14 18:25:28'),
(151, 79, 29, 'Basbousa', 'بسبوسة', 1, 2500, 0, 2500, '', NULL, 0, 3, 'pending', 0, NULL, '2026-06-14 18:25:50', '2026-06-14 18:25:50'),
(152, 80, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-18 17:34:12', '2026-06-18 17:34:24'),
(153, 80, 17, 'Hibiscus (Karkade)', 'كركديه', 1, 1800, 0, 1800, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-18 17:34:12', '2026-06-18 17:34:24'),
(154, 80, 26, 'Umm Ali', 'أم علي', 1, 3500, 0, 3500, '', NULL, 0, 3, 'confirmed', 0, NULL, '2026-06-18 17:34:12', '2026-06-18 17:34:24'),
(155, 80, 16, 'Egyptian Tea', 'شاي مصري', 1, 1500, 0, 1500, '', NULL, 0, 2, 'confirmed', 0, NULL, '2026-06-18 17:34:12', '2026-06-18 17:34:24'),
(156, 81, 17, 'Hibiscus (Karkade)', 'كركديه', 1, 1800, 0, 1800, '', NULL, 0, 2, 'refunded', 1, NULL, '2026-06-18 17:34:58', '2026-06-18 17:41:06'),
(157, 81, 27, 'Kunafa', 'كنافة', 1, 4500, 0, 4500, '', NULL, 0, 3, 'refunded', 1, NULL, '2026-06-18 17:34:58', '2026-06-18 17:41:19');

-- --------------------------------------------------------

--
-- Table structure for table `order_sequences`
--

CREATE TABLE IF NOT EXISTS `order_sequences` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `zone_id` bigint UNSIGNED NOT NULL,
  `business_date` date NOT NULL,
  `last_sequence` int UNSIGNED NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_sequences_zone_business_date_unique` (`zone_id`,`business_date`),
  KEY `order_sequences_business_date_index` (`business_date`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `order_sequences`
--

INSERT INTO `order_sequences` (`id`, `zone_id`, `business_date`, `last_sequence`, `created_at`, `updated_at`) VALUES
(1, 1, '2026-05-25', 10, '2026-06-09 17:01:14', '2026-06-12 12:24:09'),
(2, 1, '2026-05-26', 17, '2026-06-12 16:54:53', '2026-06-14 18:25:50'),
(3, 1, '2026-05-31', 2, '2026-06-18 17:34:12', '2026-06-18 17:34:58');

-- --------------------------------------------------------

--
-- Table structure for table `outlets`
--

CREATE TABLE IF NOT EXISTS `outlets` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `zone_id` bigint UNSIGNED NOT NULL,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `type` enum('service','room_service','restaurant','pool_bar','spa','gym','shop','other') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'service',
  `accepts_unit_orders` tinyint(1) NOT NULL DEFAULT '0',
  `accepts_table_orders` tinyint(1) NOT NULL DEFAULT '0',
  `operating_mode` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '24_hours',
  `opens_at` time DEFAULT NULL,
  `closes_at` time DEFAULT NULL,
  `last_order_at` time DEFAULT NULL,
  `unavailable_reason` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `unavailable_reason_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `outlets_code_unique` (`code`),
  KEY `outlets_zone_id_type_index` (`zone_id`,`type`),
  KEY `outlets_zone_id_is_active_index` (`zone_id`,`is_active`),
  KEY `outlets_operating_active_idx` (`operating_mode`,`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `outlets`
--

INSERT INTO `outlets` (`id`, `zone_id`, `name`, `name_ar`, `type`, `accepts_unit_orders`, `accepts_table_orders`, `operating_mode`, `opens_at`, `closes_at`, `last_order_at`, `unavailable_reason`, `unavailable_reason_ar`, `is_active`, `code`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'Lobby Bar', 'بار', 'restaurant', 0, 1, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSK-PYR-REST', 'Default F&B routing outlet for menu orders.', '2026-05-23 00:27:02', '2026-06-11 19:50:37', NULL),
(2, 2, 'Porto Sokhna - Hotel Service Outlet', 'مركز خدمات بورتو السخنة - ', 'service', 0, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSK-HOTEL-SVC', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02', NULL),
(3, 3, 'Porto Sokhna - Golf Service Outlet', 'مركز خدمات بورتو السخنة - ', 'service', 0, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSK-GOLF-SVC', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02', NULL),
(4, 4, 'Porto South Beach - Genwa Service Outlet', 'مركز خدمات بورتو ساوث بيتش - ', 'service', 0, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSB-GENWA-SVC', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02', NULL),
(5, 5, 'Porto South Beach - PVC Timeshare Service Outlet', 'مركز خدمات بورتو ساوث بيتش - ', 'service', 0, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSB-PVC-SVC', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02', NULL),
(6, 6, 'Porto Marina - Towers Service Outlet', 'مركز خدمات بورتو مارينا - ', 'service', 0, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-TOWERS-SVC', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02', NULL),
(7, 7, 'Porto Marina - Hotel Service Outlet', 'مركز خدمات بورتو مارينا - ', 'service', 0, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-HOTEL-SVC', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02', NULL),
(8, 8, 'Porto Marina - Golf Service Outlet', 'مركز خدمات بورتو مارينا - ', 'service', 0, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-GOLF-SVC', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02', NULL),
(9, 2, 'Porto Sokhna - Hotel Restaurant', NULL, 'restaurant', 0, 1, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSK-HOTEL-REST', 'Default F&B routing outlet for menu orders.', '2026-06-11 16:03:35', '2026-06-11 16:03:35', NULL),
(10, 3, 'Porto Sokhna - Golf Restaurant', NULL, 'restaurant', 0, 1, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSK-GOLF-REST', 'Default F&B routing outlet for menu orders.', '2026-06-11 16:03:35', '2026-06-11 16:03:35', NULL),
(11, 4, 'Porto South Beach - Genwa Restaurant', NULL, 'restaurant', 0, 1, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSB-GENWA-REST', 'Default F&B routing outlet for menu orders.', '2026-06-11 16:03:35', '2026-06-11 16:03:35', NULL),
(12, 5, 'Porto South Beach - PVC Timeshare Restaurant', NULL, 'restaurant', 0, 1, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSB-PVC-REST', 'Default F&B routing outlet for menu orders.', '2026-06-11 16:03:35', '2026-06-11 16:03:35', NULL),
(13, 6, 'Porto Marina - Towers Restaurant', NULL, 'restaurant', 0, 1, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-TOWERS-REST', 'Default F&B routing outlet for menu orders.', '2026-06-11 16:03:36', '2026-06-11 16:03:36', NULL),
(14, 7, 'Porto Marina - Hotel Restaurant', NULL, 'restaurant', 0, 1, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-HOTEL-REST', 'Default F&B routing outlet for menu orders.', '2026-06-11 16:03:36', '2026-06-11 16:03:36', NULL),
(15, 8, 'Porto Marina - Golf Restaurant', NULL, 'restaurant', 0, 1, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-GOLF-REST', 'Default F&B routing outlet for menu orders.', '2026-06-11 16:03:36', '2026-06-11 16:03:36', NULL),
(16, 1, 'Room Service', NULL, 'room_service', 1, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSK-PYR-RS', 'Default guest online room-service outlet.', '2026-06-11 16:35:46', '2026-06-11 16:35:46', NULL),
(17, 2, 'Room Service', NULL, 'room_service', 1, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSK-HOTEL-RS', 'Default guest online room-service outlet.', '2026-06-11 16:35:46', '2026-06-11 16:35:46', NULL),
(18, 3, 'Room Service', NULL, 'room_service', 1, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSK-GOLF-RS', 'Default guest online room-service outlet.', '2026-06-11 16:35:46', '2026-06-11 16:35:46', NULL),
(19, 4, 'Room Service', NULL, 'room_service', 1, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSB-GENWA-RS', 'Default guest online room-service outlet.', '2026-06-11 16:35:46', '2026-06-11 16:35:46', NULL),
(20, 5, 'Room Service', NULL, 'room_service', 1, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PSB-PVC-RS', 'Default guest online room-service outlet.', '2026-06-11 16:35:47', '2026-06-11 16:35:47', NULL),
(21, 6, 'Room Service', NULL, 'room_service', 1, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-TOWERS-RS', 'Default guest online room-service outlet.', '2026-06-11 16:35:47', '2026-06-11 16:35:47', NULL),
(22, 7, 'Room Service', NULL, 'room_service', 1, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-HOTEL-RS', 'Default guest online room-service outlet.', '2026-06-11 16:35:47', '2026-06-11 16:35:47', NULL),
(23, 8, 'Room Service', NULL, 'room_service', 1, 0, '24_hours', NULL, NULL, NULL, NULL, NULL, 1, 'PMR-GOLF-RS', 'Default guest online room-service outlet.', '2026-06-11 16:35:47', '2026-06-11 16:35:47', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `outlet_adjustments`
--

CREATE TABLE IF NOT EXISTS `outlet_adjustments` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `outlet_id` bigint UNSIGNED NOT NULL,
  `adjustment_definition_id` bigint UNSIGNED NOT NULL,
  `value` decimal(10,4) NOT NULL,
  `is_percentage` tinyint(1) NOT NULL DEFAULT '1',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `outlet_adjustments_outlet_definition_unique` (`outlet_id`,`adjustment_definition_id`),
  KEY `outlet_adjustments_outlet_active_idx` (`outlet_id`,`is_active`),
  KEY `outlet_adjustments_definition_idx` (`adjustment_definition_id`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `outlet_adjustments`
--

INSERT INTO `outlet_adjustments` (`id`, `outlet_id`, `adjustment_definition_id`, `value`, `is_percentage`, `is_active`, `created_at`, `updated_at`) VALUES
(44, 1, 2, '5.0000', 0, 1, '2026-06-13 21:37:45', '2026-06-13 21:37:45'),
(30, 16, 1, '14.0000', 1, 1, '2026-06-13 13:21:21', '2026-06-13 13:21:21'),
(17, 1, 3, '14.0000', 1, 1, '2026-06-13 12:58:22', '2026-06-13 12:58:22'),
(45, 16, 43, '100.0000', 0, 1, '2026-06-13 21:51:58', '2026-06-13 21:51:58');

-- --------------------------------------------------------

--
-- Table structure for table `outlet_printer_assignments`
--

CREATE TABLE IF NOT EXISTS `outlet_printer_assignments` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `outlet_id` bigint UNSIGNED NOT NULL,
  `printer_agent_printer_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `outlet_service_points`
--

CREATE TABLE IF NOT EXISTS `outlet_service_points` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `zone_id` bigint UNSIGNED NOT NULL,
  `outlet_id` bigint UNSIGNED NOT NULL,
  `type` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'table',
  `label` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `qr_token` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `capacity` smallint UNSIGNED DEFAULT NULL,
  `sort_order` int UNSIGNED NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `outlet_service_points_outlet_type_label_unique` (`outlet_id`,`type`,`label`),
  UNIQUE KEY `outlet_service_points_code_unique` (`code`),
  UNIQUE KEY `outlet_service_points_qr_token_unique` (`qr_token`),
  KEY `outlet_service_points_zone_outlet_active_idx` (`zone_id`,`outlet_id`,`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `outlet_service_points`
--

INSERT INTO `outlet_service_points` (`id`, `zone_id`, `outlet_id`, `type`, `label`, `code`, `qr_token`, `capacity`, `sort_order`, `is_active`, `metadata`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'counter', 'Takeaway', 'PSK-PYR-REST-COUNTER-TAKEAWAY', '9WMT6AR02EUhqHwbw2C0TYKbf6sVOXNKFJZcfLpksFGgnGkI', NULL, 1, 1, NULL, '2026-06-11 17:32:51', '2026-06-12 13:41:05'),
(2, 1, 1, 'table', 'Table 1', 'PSK-PYR-REST-TABLE-TABLE-1', 'DpltoQxYXVEdWZB4QAwQlkC2J3djhKy3CiHwENki7aCfIQkd', NULL, 2, 1, '[]', '2026-06-11 17:32:51', '2026-06-13 18:19:01'),
(3, 1, 1, 'table', 'Table 2', 'PSK-PYR-REST-TABLE-TABLE-2', 'HeTp5wrl0pXyLII0tENSGaa2UE85FwbYPlg0MHF2Kb8xi2tL', NULL, 3, 1, '[]', '2026-06-11 17:32:51', '2026-06-14 13:49:53'),
(4, 1, 1, 'table', 'Table 3', 'PSK-PYR-REST-TABLE-TABLE-3', 'bpaLDb5k14RO90FWBPK4sK2Hu0j5T461wTb1eQeDHkcOFQbS', NULL, 4, 1, '[]', '2026-06-11 17:32:51', '2026-06-13 18:18:27'),
(5, 1, 1, 'table', 'Table 4', 'PSK-PYR-REST-TABLE-TABLE-4', 'CLKMDde0NheoaFgAtQvFOE14zXxP7zpbdJhPGXfsiHbpQirw', NULL, 5, 1, '[]', '2026-06-11 17:32:51', '2026-06-14 18:15:41'),
(6, 1, 1, 'table', 'Table 5', 'PSK-PYR-REST-TABLE-TABLE-5', 'T9Bpmyiw1t8u66XZe8uXA1SrMGJQ0yuEIFOssx0D6PTNvhBO', NULL, 6, 1, '{\"status\": \"reserved\", \"reserved\": true, \"reserved_at\": \"2026-06-13T21:56:04+03:00\", \"reservation_name\": \"taha\", \"reservation_phone\": \"120\"}', '2026-06-11 17:32:51', '2026-06-13 18:56:04'),
(7, 1, 1, 'table', 'Table 6', 'PSK-PYR-REST-TABLE-TABLE-6', 'mHr5VAidAXTKuXfSr1Okc8fKIAhzdjhJ7Gt2G84N3XCs4Av5', NULL, 7, 1, '{\"status\":\"reserved\",\"reserved\":true,\"reservation_name\":\"taha\",\"reservation_phone\":\"101001\",\"reserved_at\":\"2026-06-14T13:26:13+03:00\"}', '2026-06-11 17:32:51', '2026-06-14 13:26:13'),
(8, 1, 1, 'table', 'Table 7', 'PSK-PYR-REST-TABLE-TABLE-7', 'nsYsmFipaJLsYlnkZcEPiYCoVK72niFwccn4GRNKES28vzhI', NULL, 8, 1, NULL, '2026-06-11 17:32:51', '2026-06-11 18:56:54'),
(9, 1, 1, 'table', 'Table 8', 'PSK-PYR-REST-TABLE-TABLE-8', 'R1pXG6n9ejR469yls0QKiBHcS4h6eBc2uYPJ6Ry58H0ev7O9', NULL, 9, 1, '[]', '2026-06-11 17:32:51', '2026-06-13 18:57:40'),
(10, 1, 1, 'table', 'Table 9', 'PSK-PYR-REST-TABLE-TABLE-9', 'ag1EsmUHWMRWFbUuAAxdksBQ417e6QtpxIIyNQD7ZWFo7JxE', NULL, 9, 1, NULL, '2026-06-11 17:32:51', '2026-06-11 18:59:56'),
(11, 1, 1, 'table', 'Table 10', 'PSK-PYR-REST-TABLE-TABLE-10', 'ctYjpI9USLyawiTb4Ah2nvRQlEMfcX2wdLGMNZ4dOxSQd5Q8', NULL, 10, 1, '[]', '2026-06-11 18:59:35', '2026-06-13 18:56:50');

-- --------------------------------------------------------

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

CREATE TABLE IF NOT EXISTS `password_resets` (
  `email` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `token` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE IF NOT EXISTS `payments` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `service_request_id` bigint UNSIGNED DEFAULT NULL,
  `order_id` bigint UNSIGNED DEFAULT NULL,
  `cashier_shift_id` bigint UNSIGNED DEFAULT NULL COMMENT 'The associated shift',
  `outlet_id` bigint UNSIGNED DEFAULT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `amount` decimal(12,2) NOT NULL,
  `type` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `provider` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `provider_reference` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `payment_channel` varchar(80) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `provider_payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `status` tinyint UNSIGNED NOT NULL DEFAULT '2',
  `paid_at` datetime DEFAULT NULL,
  `business_date` date DEFAULT NULL,
  `created_by` bigint UNSIGNED DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `payments_service_request_id_foreign` (`service_request_id`),
  KEY `payments_created_by_foreign` (`created_by`),
  KEY `payments_cashier_shift_id_index` (`cashier_shift_id`),
  KEY `payments_outlet_id_index` (`outlet_id`),
  KEY `payments_business_status_idx` (`business_date`,`status`),
  KEY `payments_order_id_foreign` (`order_id`),
  KEY `payments_zone_business_date_idx` (`zone_id`,`business_date`),
  KEY `payments_zone_status_idx` (`zone_id`,`status`),
  KEY `payments_provider_index` (`provider`),
  KEY `payments_provider_reference_index` (`provider_reference`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `payments` (`id`, `service_request_id`, `order_id`, `cashier_shift_id`, `outlet_id`, `zone_id`, `amount`, `type`, `provider`, `provider_reference`, `payment_channel`, `provider_payload`, `status`, `paid_at`, `business_date`, `created_by`, `notes`) VALUES
(1, 1, NULL, 1, 1, 1, '324.90', 1, NULL, NULL, NULL, NULL, 1, '2026-05-23 14:08:14', '2026-05-23', 1, ''),
(2, NULL, 1, 1, NULL, 1, '57.68', 1, NULL, NULL, NULL, NULL, 1, '2026-05-23 15:04:14', '2026-05-23', 1, ''),
(3, NULL, 1, 1, NULL, 1, '-40.00', 6, NULL, NULL, NULL, NULL, 1, '2026-05-23 20:06:45', '2026-05-23', 1, 'Item refund: Hawawshi + adjustments'),
(4, 3, NULL, 2, 1, 1, '129.96', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 03:12:34', '2026-05-23', 2, ''),
(5, NULL, 2, 2, NULL, 1, '19.18', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 03:29:31', '2026-05-23', 2, ''),
(6, 3, NULL, 2, 1, 1, '-129.96', 6, NULL, NULL, NULL, NULL, 1, '2026-05-24 03:31:47', '2026-05-23', 2, 'Cash refund - excess payment'),
(7, 4, NULL, 1, 1, 1, '194.94', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 03:49:34', '2026-05-23', 1, ''),
(8, NULL, 4, 1, NULL, 1, '57.68', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 03:50:04', '2026-05-23', 1, ''),
(9, NULL, 4, 1, NULL, 1, '-57.68', 6, NULL, NULL, NULL, NULL, 1, '2026-05-24 03:50:07', '2026-05-23', 1, 'Item refund: Hawawshi + adjustments'),
(10, NULL, 5, 1, NULL, 1, '77.17', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:00:30', '2026-05-23', 1, ''),
(11, 5, NULL, 1, 1, 1, '194.94', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:01:11', '2026-05-23', 1, ''),
(12, 6, NULL, 1, 1, 1, '454.86', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:09:28', '2026-05-23', 1, ''),
(13, NULL, 6, 1, NULL, 1, '57.68', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:12:08', '2026-05-23', 1, ''),
(14, 7, NULL, 1, 1, 1, '194.94', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:12:24', '2026-05-23', 1, ''),
(15, NULL, 7, 1, NULL, 1, '64.18', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:14:04', '2026-05-23', 1, ''),
(16, 8, NULL, 1, 1, 1, '129.96', 1, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:14:24', '2026-05-23', 1, ''),
(17, NULL, 5, 1, NULL, 1, '-77.17', 6, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:15:09', '2026-05-23', 1, 'Excess payment refunded to customer'),
(18, NULL, 7, 1, NULL, 1, '-64.18', 6, NULL, NULL, NULL, NULL, 1, '2026-05-24 05:24:13', '2026-05-23', 1, 'Excess payment refunded to customer'),
(19, NULL, 10, 2, NULL, 1, '370.50', 1, NULL, NULL, NULL, NULL, 1, '2026-05-25 00:48:22', '2026-05-23', 2, ''),
(20, 10, NULL, 2, 1, 1, '129.96', 1, NULL, NULL, NULL, NULL, 1, '2026-05-26 21:44:00', '2026-05-23', 2, ''),
(21, 9, NULL, 2, 1, 1, '194.94', 1, NULL, NULL, NULL, NULL, 1, '2026-05-26 21:44:38', '2026-05-23', 2, ''),
(22, 13, NULL, 2, 1, 1, '519.84', 1, NULL, NULL, NULL, NULL, 1, '2026-06-03 10:39:28', '2026-05-23', 2, ''),
(23, 12, NULL, 3, 1, 1, '194.94', 1, NULL, NULL, NULL, NULL, 1, '2026-06-03 10:47:28', '2026-05-24', 2, ''),
(24, NULL, 22, 4, NULL, 1, '295.99', 1, NULL, NULL, NULL, NULL, 1, '2026-06-06 02:34:24', '2026-05-24', 2, ''),
(25, NULL, 22, 4, NULL, 1, '-20.00', 6, NULL, NULL, NULL, NULL, 1, '2026-06-06 02:36:46', '2026-05-24', 2, 'Excess payment refunded to customer'),
(26, NULL, 22, 4, NULL, 1, '-30.00', 6, NULL, NULL, NULL, NULL, 1, '2026-06-06 02:38:42', '2026-05-24', 2, 'Excess payment refunded to customer'),
(27, 15, NULL, 5, 1, 1, '324.90', 1, NULL, NULL, NULL, NULL, 1, '2026-06-06 03:06:39', '2026-05-25', 2, ''),
(28, 15, NULL, 5, 1, 1, '-324.90', 6, NULL, NULL, NULL, NULL, 1, '2026-06-06 03:07:31', '2026-05-25', 2, 'Cash refund - excess payment'),
(29, NULL, 50, 5, NULL, 1, '68.40', 1, NULL, NULL, NULL, NULL, 1, '2026-06-09 22:22:43', '2026-05-25', 2, ''),
(30, NULL, 48, 5, NULL, 1, '74.09', 1, NULL, NULL, NULL, NULL, 1, '2026-06-11 13:34:59', '2026-05-25', 2, ''),
(31, NULL, 53, 5, 1, 1, '1014.60', 1, NULL, NULL, NULL, NULL, 1, '2026-06-12 14:51:01', '2026-05-25', 2, ''),
(32, NULL, 59, 6, 1, 1, '364.80', 1, NULL, NULL, NULL, NULL, 1, '2026-06-12 16:55:24', '2026-05-26', 2, ''),
(33, NULL, 67, 6, 16, 1, '45.60', 1, NULL, NULL, NULL, NULL, 1, '2026-06-13 16:22:37', '2026-05-26', 2, ''),
(34, NULL, 68, 6, 1, 1, '217.42', 1, NULL, NULL, NULL, NULL, 1, '2026-06-13 16:23:25', '2026-05-26', 2, ''),
(35, NULL, 69, 6, 1, 1, '284.68', 1, NULL, NULL, NULL, NULL, 1, '2026-06-13 23:22:06', '2026-05-26', 2, ''),
(36, NULL, 45, 6, NULL, 1, '64.18', 1, NULL, NULL, NULL, NULL, 1, '2026-06-14 12:37:27', '2026-05-26', 2, ''),
(37, NULL, 46, 6, NULL, 1, '57.00', 1, NULL, NULL, NULL, NULL, 1, '2026-06-14 12:39:07', '2026-05-26', 2, ''),
(38, NULL, 46, 6, NULL, 1, '-57.00', 6, NULL, NULL, NULL, NULL, 1, '2026-06-14 13:25:26', '2026-05-26', 2, 'Excess payment refunded to customer'),
(39, NULL, 70, 6, 1, 1, '652.90', 1, NULL, NULL, NULL, NULL, 1, '2026-06-14 13:27:11', '2026-05-26', 2, ''),
(40, NULL, 73, 6, 1, 1, '34.20', 1, NULL, NULL, NULL, NULL, 1, '2026-06-14 13:46:10', '2026-05-26', 2, ''),
(41, NULL, 74, 6, 1, 1, '34.20', 1, NULL, NULL, NULL, NULL, 1, '2026-06-14 13:50:01', '2026-05-26', 2, ''),
(42, NULL, 75, 6, 16, 1, '185.50', 1, NULL, NULL, NULL, NULL, 1, '2026-06-14 13:50:30', '2026-05-26', 2, ''),
(43, NULL, 44, 6, NULL, 1, '37.61', 1, NULL, NULL, NULL, NULL, 1, '2026-06-14 15:54:14', '2026-05-26', 2, ''),
(44, NULL, 77, 6, 1, 1, '91.20', 1, NULL, NULL, NULL, NULL, 1, '2026-06-14 18:15:58', '2026-05-26', 2, ''),
(45, 17, NULL, 7, 16, 1, '271.00', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 15:53:33', '2026-05-27', 2, ''),
(46, 16, NULL, 8, 16, 1, '285.00', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 16:50:47', '2026-05-29', 2, ''),
(47, 18, NULL, 9, 16, 1, '385.00', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 17:03:20', '2026-05-30', 2, ''),
(48, 12, NULL, 9, 16, 1, '-194.94', 6, NULL, NULL, NULL, NULL, 1, '2026-06-18 17:03:34', '2026-05-30', 2, 'Cash refund - excess payment'),
(49, 19, NULL, 10, 16, 1, '214.00', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 19:16:44', '2026-05-31', 2, ''),
(50, 19, NULL, 10, 16, 1, '-214.00', 6, NULL, NULL, NULL, NULL, 1, '2026-06-18 19:16:55', '2026-05-31', 2, 'Cash refund - excess payment'),
(51, 20, NULL, 10, 16, 1, '385.00', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 19:21:30', '2026-05-31', 2, ''),
(52, 20, NULL, 10, 16, 1, '-385.00', 6, NULL, NULL, NULL, NULL, 1, '2026-06-18 19:21:57', '2026-05-31', 2, 'Cash refund - excess payment'),
(53, 21, NULL, 10, 16, 1, '1867.00', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 19:37:04', '2026-05-31', 2, ''),
(54, 21, NULL, 10, 16, 1, '-963.62', 6, NULL, NULL, NULL, NULL, 1, '2026-06-18 19:37:59', '2026-05-31', 2, 'Cash refund - excess payment'),
(55, 22, NULL, 10, 16, 1, '100.00', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 20:19:51', '2026-05-31', 2, ''),
(56, NULL, 80, 10, 1, 1, '134.52', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 20:34:24', '2026-05-31', 2, ''),
(57, NULL, 81, 10, 1, 1, '77.52', 1, NULL, NULL, NULL, NULL, 1, '2026-06-18 20:35:33', '2026-05-31', 2, ''),
(58, NULL, 81, 10, 1, 1, '-77.52', 6, NULL, NULL, NULL, NULL, 1, '2026-06-18 20:41:28', '2026-05-31', 2, 'Excess payment refunded to customer');

-- --------------------------------------------------------

--
-- Table structure for table `payment_integration_settings`
--

CREATE TABLE IF NOT EXISTS `payment_integration_settings` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `provider` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'paymob',
  `display_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `is_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `test_mode` tinyint(1) NOT NULL DEFAULT '1',
  `api_key` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `integration_id` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `hmac_secret` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `iframe_id` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `iframe_id_installment` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `base_url` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'https://accept.paymob.com',
  `iframe_base_url` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'https://accept.paymob.com',
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payment_integrations_provider_zone_unique` (`provider`,`zone_id`),
  KEY `payment_integration_settings_zone_id_foreign` (`zone_id`),
  KEY `payment_integrations_provider_enabled_idx` (`provider`,`is_enabled`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_integration_settings`
--

INSERT INTO `payment_integration_settings` (`id`, `zone_id`, `provider`, `display_name`, `is_enabled`, `test_mode`, `api_key`, `integration_id`, `hmac_secret`, `iframe_id`, `iframe_id_installment`, `base_url`, `iframe_base_url`, `metadata`, `created_at`, `updated_at`) VALUES
(1, 1, 'paymob', 'Paymob', 1, 1, 'eyJpdiI6IlRpVzgwY3hCWTdaVnRkR3NFZmNzclE9PSIsInZhbHVlIjoiaG5yMkc3UitVZndMdFQ3RGltcmpqbnR6TkZCemU5eG5TK09sVWpocXFnVHN2U0pLTjdJeXUxazBqZHEwb3VLVGFkRnAxc0hzOW13bFYrQllQNmVhS2tpNzNPR1VvNjJjZEFxTGU4ZExTQ3N3ZkZxZitKbkRrOHJlVVJpam14K2ZmUlpSaFJvMWtOUjJLaTlyTk1YRjNjeXlMOVBHSER5bkNnTCt3UmVaVXZYZU9RTDV5YUVpbXMzNy9CZ0FRV25iVGRRVDl4MUlWUXZYSjZ6WVhVeXh3UjNOWXlFTWd6cGUzR1BPdXdMa2RobGYrb1V4NzBrUXI1dUUrcGJBb01ITkJJVGZCUzdZSTZrbnpNL2RGVUx3YmhoZFJmTWR3aWM1ZnVCSkNUd1dES3M5UlBHaHNDUjg5Y0JHZDZhQVdLUjBFL2dSNGswWGdDbXVaWGdOTjlsdk8xK25lT213MTF1bUlSdTlpU2hOd2k4PSIsIm1hYyI6IjA4NmRlYTFmMWQwYTNiNjU0YjlkZDlmYTQ3NzI1YjE3OGRhNjIyYmY4YzAxYTNjYzE5YTBjZTEwNjU1OTVkMGQiLCJ0YWciOiIifQ==', '1974774', 'eyJpdiI6ImI3UjBNRW16WURJNnlKZVBOMTNLTGc9PSIsInZhbHVlIjoiZDg1SnVEZzhJaXpFT2xSRmhDL3UzdHRyQWIzZ21Mcmgwc2syUmRoM0syeXB3dDJ4ZGMwWDdwZXNESkxlVUtxOSIsIm1hYyI6IjUxMTg5MmZjMzM5MGU4MzJhYzkyMGRkMDNlYThiODg2ZTc5NTg2ZjgzMjQzYmNjZjcwMGVlOTBmMDJhNjA2ZWIiLCJ0YWciOiIifQ==', '368397', '368396', 'https://accept.paymob.com', 'https://accept-alpha.paymob.com', NULL, '2026-06-09 17:56:39', '2026-06-09 17:56:39');

-- --------------------------------------------------------

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

CREATE TABLE IF NOT EXISTS `permissions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `guard_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=234 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'users.view', 'web', NULL, NULL),
(2, 'users.create', 'web', NULL, NULL),
(3, 'users.edit', 'web', NULL, NULL),
(4, 'users.delete', 'web', NULL, NULL),
(5, 'roles.view', 'web', NULL, NULL),
(6, 'roles.create', 'web', NULL, NULL),
(7, 'roles.edit', 'web', NULL, NULL),
(8, 'roles.delete', 'web', NULL, NULL),
(9, 'tickets.view', 'web', NULL, NULL),
(10, 'tickets.create', 'web', NULL, NULL),
(11, 'tickets.edit', 'web', NULL, NULL),
(12, 'tickets.delete', 'web', NULL, NULL),
(13, 'tickets.assign', 'web', NULL, NULL),
(14, 'tickets.change_status', 'web', NULL, NULL),
(15, 'tickets.view_all', 'web', NULL, NULL),
(16, 'tickets.view_department', 'web', NULL, NULL),
(17, 'tickets.view_own', 'web', NULL, NULL),
(18, 'tickets.dashboard.view', 'web', NULL, NULL),
(23, 'tickets.categories.view', 'web', NULL, NULL),
(24, 'tickets.categories.create', 'web', NULL, NULL),
(25, 'tickets.categories.edit', 'web', NULL, NULL),
(26, 'tickets.categories.delete', 'web', NULL, NULL),
(27, 'tickets.items.view', 'web', NULL, NULL),
(28, 'tickets.items.create', 'web', NULL, NULL),
(29, 'tickets.items.edit', 'web', NULL, NULL),
(30, 'tickets.items.delete', 'web', NULL, NULL),
(31, 'requests.view', 'web', NULL, NULL),
(32, 'requests.create', 'web', NULL, NULL),
(33, 'requests.edit', 'web', NULL, NULL),
(34, 'requests.delete', 'web', NULL, NULL),
(35, 'requests.services.view', 'web', NULL, NULL),
(36, 'requests.services.create', 'web', NULL, NULL),
(37, 'requests.services.edit', 'web', NULL, NULL),
(38, 'requests.services.delete', 'web', NULL, NULL),
(39, 'requests.categories.view', 'web', NULL, NULL),
(40, 'requests.categories.create', 'web', NULL, NULL),
(41, 'requests.categories.edit', 'web', NULL, NULL),
(42, 'requests.categories.delete', 'web', NULL, NULL),
(43, 'tickets.replies.view', 'web', NULL, NULL),
(44, 'tickets.replies.create', 'web', NULL, NULL),
(45, 'tickets.replies.edit', 'web', NULL, NULL),
(46, 'tickets.replies.delete', 'web', NULL, NULL),
(47, 'tickets.zones.view', 'web', NULL, NULL),
(48, 'tickets.zones.create', 'web', NULL, NULL),
(49, 'tickets.zones.edit', 'web', NULL, NULL),
(50, 'tickets.zones.delete', 'web', NULL, NULL),
(51, 'properties.view', 'web', NULL, NULL),
(52, 'properties.create', 'web', NULL, NULL),
(53, 'properties.edit', 'web', NULL, NULL),
(54, 'properties.delete', 'web', NULL, NULL),
(55, 'units.view', 'web', NULL, NULL),
(56, 'units.create', 'web', NULL, NULL),
(57, 'units.edit', 'web', NULL, NULL),
(58, 'units.delete', 'web', NULL, NULL),
(59, 'areas.view', 'web', NULL, NULL),
(60, 'areas.create', 'web', NULL, NULL),
(61, 'areas.edit', 'web', NULL, NULL),
(62, 'areas.delete', 'web', NULL, NULL),
(63, 'sites.view', 'web', NULL, NULL),
(64, 'sites.create', 'web', NULL, NULL),
(65, 'sites.edit', 'web', NULL, NULL),
(66, 'sites.delete', 'web', NULL, NULL),
(67, 'zones.view', 'web', NULL, NULL),
(68, 'zones.create', 'web', NULL, NULL),
(69, 'zones.edit', 'web', NULL, NULL),
(70, 'zones.delete', 'web', NULL, NULL),
(71, 'departments.view', 'web', NULL, NULL),
(72, 'departments.create', 'web', NULL, NULL),
(73, 'departments.edit', 'web', NULL, NULL),
(74, 'departments.delete', 'web', NULL, NULL),
(75, 'visitors.dashboard', 'web', NULL, NULL),
(76, 'visitors.view', 'web', NULL, NULL),
(77, 'visitors.create', 'web', NULL, NULL),
(78, 'visitors.edit', 'web', NULL, NULL),
(79, 'visitors.delete', 'web', NULL, NULL),
(80, 'visitors.manage', 'web', NULL, NULL),
(81, 'visitors.check_in', 'web', NULL, NULL),
(82, 'visitors.check_out', 'web', NULL, NULL),
(83, 'visitors.qr_resend', 'web', NULL, NULL),
(84, 'visitors.qr_print', 'web', NULL, NULL),
(85, 'visitors.qr_pdf', 'web', NULL, NULL),
(86, 'visitors.qr_share', 'web', NULL, NULL),
(87, 'visitors.gates.view', 'web', NULL, NULL),
(88, 'visitors.gates.create', 'web', NULL, NULL),
(89, 'visitors.gates.edit', 'web', NULL, NULL),
(90, 'visitors.gates.delete', 'web', NULL, NULL),
(91, 'memberships.view', 'web', NULL, NULL),
(92, 'memberships.create', 'web', NULL, NULL),
(93, 'memberships.edit', 'web', NULL, NULL),
(94, 'memberships.delete', 'web', NULL, NULL),
(95, 'contacts.view', 'web', NULL, NULL),
(96, 'contacts.create', 'web', NULL, NULL),
(97, 'contacts.edit', 'web', NULL, NULL),
(98, 'contacts.delete', 'web', NULL, NULL),
(99, 'reports.view', 'web', NULL, NULL),
(100, 'reports.export', 'web', NULL, NULL),
(104, 'settings.view', 'web', NULL, NULL),
(105, 'settings.edit', 'web', NULL, NULL),
(106, 'cashier.open_shift', 'web', NULL, NULL),
(107, 'cashier.close_shift', 'web', NULL, NULL),
(108, 'cashier.view_shifts', 'web', NULL, NULL),
(109, 'cashier.view_own_shifts', 'web', NULL, NULL),
(110, 'cashier.view_all_shifts', 'web', NULL, NULL),
(111, 'cashier.daily_closing', 'web', NULL, NULL),
(112, 'cashier.print_reports', 'web', NULL, NULL),
(113, 'cashier.apply_discount', 'web', NULL, NULL),
(114, 'cashier.remove_discount', 'web', NULL, NULL),
(115, 'cashier.collect_cash', 'web', NULL, NULL),
(116, 'cashier.night_run', 'web', NULL, NULL),
(117, 'cashier.view_night_reports', 'web', NULL, NULL),
(118, 'cashier.manage_house_fund', 'web', NULL, NULL),
(119, 'cashier.house_fund_to_bank', 'web', NULL, NULL),
(120, 'cashier.issue_float', 'web', NULL, NULL),
(121, 'cashier.view_finance_reports', 'web', NULL, NULL),
(122, 'bank.view', 'web', NULL, NULL),
(123, 'bank.view_all', 'web', NULL, NULL),
(124, 'bank.view_zone', 'web', NULL, NULL),
(125, 'bank.create', 'web', NULL, NULL),
(126, 'bank.edit', 'web', NULL, NULL),
(127, 'bank.delete', 'web', NULL, NULL),
(128, 'bank.accounts.view', 'web', NULL, NULL),
(129, 'bank.accounts.view_all', 'web', NULL, NULL),
(130, 'bank.accounts.view_zone', 'web', NULL, NULL),
(131, 'bank.accounts.create', 'web', NULL, NULL),
(132, 'bank.accounts.edit', 'web', NULL, NULL),
(133, 'bank.accounts.delete', 'web', NULL, NULL),
(134, 'bank.transactions.view', 'web', NULL, NULL),
(135, 'bank.transactions.view_all', 'web', NULL, NULL),
(136, 'bank.transactions.view_zone', 'web', NULL, NULL),
(137, 'bank.transactions.create', 'web', NULL, NULL),
(138, 'bank.transactions.edit', 'web', NULL, NULL),
(139, 'bank.transactions.delete', 'web', NULL, NULL),
(140, 'outlets.view', 'web', '2026-06-11 15:50:31', '2026-06-11 15:50:31'),
(141, 'outlets.create', 'web', '2026-06-11 15:50:31', '2026-06-11 15:50:31'),
(142, 'outlets.edit', 'web', '2026-06-11 15:50:31', '2026-06-11 15:50:31'),
(143, 'outlets.delete', 'web', NULL, NULL),
(144, 'outlets.manage', 'web', '2026-06-11 15:50:31', '2026-06-11 15:50:31'),
(145, 'outlets.view_collections', 'web', NULL, NULL),
(146, 'orders.view', 'web', NULL, NULL),
(147, 'orders.create', 'web', NULL, NULL),
(148, 'orders.edit', 'web', NULL, NULL),
(149, 'orders.delete', 'web', NULL, NULL),
(150, 'orders.refund', 'web', NULL, NULL),
(151, 'orders.payment', 'web', NULL, NULL),
(152, 'menu.categories.view', 'web', NULL, NULL),
(153, 'menu.categories.create', 'web', NULL, NULL),
(154, 'menu.categories.edit', 'web', NULL, NULL),
(155, 'menu.categories.delete', 'web', NULL, NULL),
(156, 'menu.items.view', 'web', NULL, NULL),
(157, 'menu.items.create', 'web', NULL, NULL),
(158, 'menu.items.edit', 'web', NULL, NULL),
(159, 'menu.items.delete', 'web', NULL, NULL),
(160, 'menu.featured.view', 'web', NULL, NULL),
(161, 'menu.featured.create', 'web', NULL, NULL),
(162, 'menu.featured.edit', 'web', NULL, NULL),
(163, 'menu.featured.delete', 'web', NULL, NULL),
(164, 'menu.featured.set_landing', 'web', NULL, NULL),
(165, 'guest.landing.view', 'web', NULL, NULL),
(166, 'guest.landing.create', 'web', NULL, NULL),
(167, 'guest.landing.edit', 'web', NULL, NULL),
(168, 'guest.landing.delete', 'web', NULL, NULL),
(214, 'reports.tickets.export', 'web', NULL, NULL),
(213, 'reports.tickets.print', 'web', NULL, NULL),
(212, 'reports.tickets.view', 'web', NULL, NULL),
(178, 'system.manage', 'web', NULL, NULL),
(179, 'system.manage_permissions', 'web', NULL, NULL),
(180, 'system.manage_roles', 'web', NULL, NULL),
(181, 'system.manage_users', 'web', NULL, NULL),
(182, 'system.view_logs', 'web', NULL, NULL),
(183, 'invoice.view', 'web', NULL, NULL),
(184, 'invoice.viewown', 'web', NULL, NULL),
(185, 'invoice.viewall', 'web', NULL, NULL),
(186, 'invoice.print', 'web', NULL, NULL),
(211, 'reports.finance.export', 'web', NULL, NULL),
(210, 'reports.finance.print', 'web', NULL, NULL),
(209, 'reports.finance.view', 'web', NULL, NULL),
(208, 'reports.invoice.export', 'web', NULL, NULL),
(207, 'reports.invoice.view', 'web', NULL, NULL),
(192, 'requests.edit_items', 'web', NULL, NULL),
(193, 'requests.refund', 'web', NULL, NULL),
(194, 'cashier.reconcile_shift', 'web', NULL, NULL),
(195, 'cashier.confirm_house_fund', 'web', NULL, NULL),
(201, 'finance.adjustments.view', 'web', NULL, NULL),
(202, 'finance.adjustments.create', 'web', NULL, NULL),
(203, 'finance.adjustments.edit', 'web', NULL, NULL),
(204, 'finance.adjustments.delete', 'web', NULL, NULL),
(215, 'dashboard.view', 'web', NULL, NULL),
(224, 'menu.items.toggle_status', 'web', '2026-06-09 18:59:29', '2026-06-09 18:59:29'),
(225, 'menu.items.toggle_availability', 'web', '2026-06-09 18:59:29', '2026-06-09 18:59:29'),
(226, 'printing.view', 'web', '2026-06-13 15:12:34', '2026-06-13 15:12:34'),
(227, 'printing.create', 'web', '2026-06-13 15:12:34', '2026-06-13 15:12:34'),
(228, 'printing.edit', 'web', '2026-06-13 15:12:34', '2026-06-13 15:12:34'),
(229, 'printing.delete', 'web', '2026-06-13 15:12:34', '2026-06-13 15:12:34'),
(230, 'printing.install', 'web', '2026-06-13 15:12:34', '2026-06-13 15:12:34'),
(231, 'printing.download', 'web', '2026-06-13 15:12:34', '2026-06-13 15:12:34'),
(232, 'surveys.manage', 'web', '2026-06-19 12:49:58', '2026-06-19 12:49:58'),
(233, 'reports.guest-satisfaction.view', 'web', '2026-06-19 12:49:58', '2026-06-19 12:49:58');

-- --------------------------------------------------------

--
-- Table structure for table `personal_access_tokens`
--

CREATE TABLE IF NOT EXISTS `personal_access_tokens` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tokenable_id` bigint UNSIGNED NOT NULL,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `token` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `abilities` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pms_rate_plans`
--

CREATE TABLE IF NOT EXISTS `pms_rate_plans` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `code` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'EGP',
  `base_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `included_adults` smallint UNSIGNED NOT NULL DEFAULT '2',
  `extra_adult_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `extra_child_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_by` bigint UNSIGNED DEFAULT NULL,
  `updated_by` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pms_rate_zone_code_unique` (`zone_id`,`code`),
  KEY `pms_rate_plans_created_by_foreign` (`created_by`),
  KEY `pms_rate_plans_updated_by_foreign` (`updated_by`),
  KEY `pms_rate_zone_active_idx` (`zone_id`,`active`),
  KEY `pms_rate_plans_active_index` (`active`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pms_reservations`
--

CREATE TABLE IF NOT EXISTS `pms_reservations` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `confirmation_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `zone_id` bigint UNSIGNED NOT NULL,
  `contact_id` bigint UNSIGNED NOT NULL,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `rate_plan_id` bigint UNSIGNED DEFAULT NULL,
  `quoted_rate_amount` decimal(12,2) DEFAULT NULL,
  `quoted_rate_currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `arrival_date` date NOT NULL,
  `departure_date` date NOT NULL,
  `adults` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `children` tinyint UNSIGNED NOT NULL DEFAULT '0',
  `source` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'reserved',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_by` bigint UNSIGNED DEFAULT NULL,
  `updated_by` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pms_reservations_confirmation_number_unique` (`confirmation_number`),
  KEY `pms_reservations_contact_id_foreign` (`contact_id`),
  KEY `pms_reservations_created_by_foreign` (`created_by`),
  KEY `pms_reservations_updated_by_foreign` (`updated_by`),
  KEY `pms_res_zone_arrival_idx` (`zone_id`,`arrival_date`),
  KEY `pms_res_zone_departure_idx` (`zone_id`,`departure_date`),
  KEY `pms_res_zone_status_idx` (`zone_id`,`status`),
  KEY `pms_res_unit_dates_idx` (`unit_id`,`arrival_date`,`departure_date`),
  KEY `pms_reservations_status_index` (`status`),
  KEY `pms_res_rate_plan_idx` (`rate_plan_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pms_reservation_action_logs`
--

CREATE TABLE IF NOT EXISTS `pms_reservation_action_logs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `reservation_id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `action` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `before` json DEFAULT NULL,
  `after` json DEFAULT NULL,
  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pms_reservation_action_logs_user_id_foreign` (`user_id`),
  KEY `pms_action_log_reservation_idx` (`reservation_id`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `printer_agents`
--

CREATE TABLE IF NOT EXISTS `printer_agents` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `agent_uuid` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `token_hash` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'approved',
  `last_seen_at` timestamp NULL DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `printer_agents_agent_uuid_unique` (`agent_uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `printer_agents`
--

INSERT INTO `printer_agents` (`id`, `agent_uuid`, `name`, `token_hash`, `status`, `last_seen_at`, `metadata`, `created_at`, `updated_at`) VALUES
(2, 'local-laravel-agent', 'Local Laravel Test Agent', '023f393114e2878118361db154e6a795ff30783dcadaef232c5bbe71fd882bfc', 'unconfigured', '2026-06-08 22:44:01', '{\"os\": \"windows\", \"version\": \"0.1.0\", \"hostname\": \"DESKTOP-5EGDS35\", \"capabilities\": {\"adapters\": [\"network_raw\"], \"supports_confirmed\": false}, \"deleted_local_printer_ids\": [\"local-fake-printer\"]}', '2026-06-08 22:29:49', '2026-06-09 11:49:35'),
(3, 'aot-agent-184041ca-09cd-4c59-8c05-906fe0d74412', 'AOT Auto Registered Agent', '6360cdce90f5d0f79a1e70949a20792844dfee0687c9b05d2ceedf9dd9ee48a2', 'unconfigured', '2026-06-12 13:34:09', '{\"os\":\"windows\",\"version\":\"tray-sync\",\"hostname\":\"DESKTOP-5EGDS35\",\"capabilities\":{\"adapters\":[\"network_raw\",\"windows_spooler\"],\"supports_confirmed\":false},\"registered_from\":\"print_routing_auto_installer\",\"requires_admin_setup\":true,\"deleted_local_printer_ids\":[\"pending-printer-e0d74412\",\"pending-printer-21c59db7\"]}', '2026-06-08 22:44:20', '2026-06-14 12:31:46'),
(4, 'aot-agent-aa8f5cd5-acf7-425a-99f6-2b2b552f8a83', 'AOT Auto Registered Agent', '2df35ad7ab2f7d8fa2ecc8fb185bc16fe4df0537c8593f929468e7bfca7300ab', 'approved', '2026-06-14 19:30:36', '{\"registered_from\":\"print_routing_auto_installer\",\"requires_admin_setup\":true,\"installer_token\":\"eyJpdiI6ImZFeVp0TUZSNDJLQVd6M3JaTldDc0E9PSIsInZhbHVlIjoiU1RHNllVNDZvdE1veW1wb3NTR1RVTzZ5ZCtKZlIvT3EzUG5xQ3paRjgxRXJjWmJhQ0tiZ0lWNzcvSHFVWE0rb25Ka0VhbVBNWWhDT00rR2FteGR0MWIvYjdDSkZVejVYcDdUQzI2NCtvOG89IiwibWFjIjoiNWQzZTk4ZjdhZTFhZGM5ZjcyMWVhOTIzODA0MTZjMmE2OTgxMWVhZjliODY4ZDQ3MGQ4MzYzNDUyNmFmMzVkMiIsInRhZyI6IiJ9\",\"version\":\"0.1.0\",\"hostname\":\"DPSBITMANAGER\",\"os\":\"windows\",\"capabilities\":{\"adapters\":[\"network_raw\",\"windows_spooler\"],\"payload_formats\":[\"escpos_base64\",\"text_utf8_base64\",\"aot_receipt_v1_base64\"],\"supports_aot_receipt_v1\":true,\"supports_confirmed\":false}}', '2026-06-14 12:31:50', '2026-06-14 19:30:36');

-- --------------------------------------------------------

--
-- Table structure for table `printer_agent_printers`
--

CREATE TABLE IF NOT EXISTS `printer_agent_printers` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `printer_agent_id` bigint UNSIGNED NOT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `outlet_id` bigint UNSIGNED DEFAULT NULL,
  `local_printer_id` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `connection_type` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ip_address` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `port` int UNSIGNED DEFAULT NULL,
  `spooler_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `print_on_order_created` tinyint(1) NOT NULL DEFAULT '0',
  `print_on_order_confirmed` tinyint(1) NOT NULL DEFAULT '0',
  `station_label` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `print_language` varchar(8) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'en',
  `arabic_code_page` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pc864_22',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `printer_agent_printers_printer_agent_id_local_printer_id_unique` (`printer_agent_id`,`local_printer_id`),
  KEY `printer_agent_printers_zone_active_idx` (`zone_id`,`is_active`),
  KEY `printer_agent_printers_outlet_id_foreign` (`outlet_id`),
  KEY `printer_agent_printers_zone_outlet_active_idx` (`zone_id`,`outlet_id`,`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `printer_agent_printers`
--

INSERT INTO `printer_agent_printers` (`id`, `printer_agent_id`, `zone_id`, `outlet_id`, `local_printer_id`, `name`, `connection_type`, `ip_address`, `port`, `spooler_name`, `is_active`, `print_on_order_created`, `print_on_order_confirmed`, `station_label`, `print_language`, `arabic_code_page`, `created_at`, `updated_at`) VALUES
(7, 4, 1, NULL, 'pending-printer-552f8a83', 'Pending Printer Setup', 'network_raw', '192.168.102.231', 9100, NULL, 1, 0, 1, 'Discovered by Installer', 'en', 'pc864_22', '2026-06-14 12:31:50', '2026-06-14 12:32:12');

-- --------------------------------------------------------

--
-- Table structure for table `printer_links`
--

CREATE TABLE IF NOT EXISTS `printer_links` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `printer_agent_printer_id` bigint UNSIGNED NOT NULL,
  `link_type` enum('zone','outlet','service_point','cashier_station','kitchen_station','payment_method','order_context','global') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `link_id` bigint UNSIGNED NOT NULL DEFAULT '0',
  `trigger` enum('order_created','order_confirmed','payment_paid','manual_reprint') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` enum('kot','customer_receipt','cashier_receipt','audit_copy') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'customer_receipt',
  `priority` smallint UNSIGNED NOT NULL DEFAULT '50',
  `copies` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `fallback_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `printer_links_unique_route` (`printer_agent_printer_id`,`link_type`,`link_id`,`trigger`,`document_type`),
  KEY `printer_links_route_lookup_idx` (`link_type`,`link_id`,`trigger`,`document_type`,`is_active`,`fallback_enabled`,`priority`),
  KEY `printer_links_trigger_lookup_idx` (`trigger`,`document_type`,`is_active`,`fallback_enabled`,`priority`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `printer_links`
--

INSERT INTO `printer_links` (`id`, `printer_agent_printer_id`, `link_type`, `link_id`, `trigger`, `document_type`, `priority`, `copies`, `is_active`, `fallback_enabled`, `meta`, `created_at`, `updated_at`) VALUES
(1, 4, 'outlet', 1, 'order_created', 'kot', 50, 1, 1, 0, '{\"managed_from\": \"print_routing\", \"target_label\": \"Lobby Bar - Porto Sokhna - Pyramids\"}', '2026-06-14 09:22:11', '2026-06-14 09:22:11'),
(9, 7, 'outlet', 1, 'order_confirmed', 'customer_receipt', 50, 1, 1, 0, '{\"managed_from\":\"print_routing\",\"target_label\":\"Lobby Bar - Porto Sokhna - Pyramids\"}', '2026-06-14 18:09:39', '2026-06-14 18:09:39'),
(7, 7, 'outlet', 16, 'order_confirmed', 'customer_receipt', 50, 1, 1, 0, '{\"managed_from\":\"print_routing\",\"target_label\":\"Room Service - Porto Sokhna - Pyramids\"}', '2026-06-14 12:38:43', '2026-06-14 12:38:43');

-- --------------------------------------------------------

--
-- Table structure for table `print_jobs`
--

CREATE TABLE IF NOT EXISTS `print_jobs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `printer_agent_id` bigint UNSIGNED NOT NULL,
  `printer_agent_printer_id` bigint UNSIGNED NOT NULL,
  `order_id` bigint UNSIGNED DEFAULT NULL,
  `source` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `status` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `payload_format` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'escpos_base64',
  `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leased_until` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `error_code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `error_message` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `print_jobs_printer_agent_id_foreign` (`printer_agent_id`),
  KEY `print_jobs_printer_agent_printer_id_foreign` (`printer_agent_printer_id`),
  KEY `print_jobs_order_id_index` (`order_id`),
  KEY `print_jobs_source_index` (`source`),
  KEY `idx_print_jobs_agent_status_date` (`printer_agent_id`,`status`,`created_at`),
  KEY `idx_print_jobs_printer_status_date` (`printer_agent_printer_id`,`status`,`created_at`),
  KEY `idx_print_jobs_order_source_date` (`order_id`,`source`,`created_at`),
  KEY `idx_print_jobs_leased_until` (`status`,`leased_until`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `print_jobs`
--

INSERT INTO `print_jobs` (`id`, `printer_agent_id`, `printer_agent_printer_id`, `order_id`, `source`, `status`, `payload_format`, `content`, `leased_until`, `sent_at`, `confirmed_at`, `error_code`, `error_message`, `meta`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NULL, NULL, 'sent', 'escpos_base64', 'G0BBT1QgTEFSQVZFTCBURVNUCk9yZGVyICMyMDAxCkl0ZW06IExhcmF2ZWwgZ2VuZXJhdGVkIHRlc3QgcmVjZWlwdAo=', '2026-06-08 18:22:20', '2026-06-08 15:21:20', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 68}', '2026-06-08 18:21:19', '2026-06-08 18:21:20'),
(2, 1, 1, NULL, NULL, 'sent', 'escpos_base64', 'G0BBT1QgTEFSQVZFTCBURVNUCk9yZGVyICMyMDAxCkl0ZW06IExhcmF2ZWwgZ2VuZXJhdGVkIHRlc3QgcmVjZWlwdAo=', '2026-06-08 18:23:25', '2026-06-08 15:22:25', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 68}', '2026-06-08 18:22:24', '2026-06-08 18:22:25'),
(3, 1, 1, 24, 'real_order_test', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSCk9yZGVyOiBPUkQtUFJJTlQtSVRHS08KR3Vlc3Q6IFByaW50ZXIgVGVzdCBHdWVzdApQaG9uZTogMDEwMDAwMDAwMDAKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6Mjg6MzIKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEtvc2hhcnkKICBOb3RlOiBSZWFsIG9yZGVyIHByaW50IGludGVncmF0aW9uIHRlc3QKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA0NS4wMApPcmRlciBub3RlOiBDcmVhdGVkIGZyb20gcHJpbnRlci1hZ2VudDpjcmVhdGUtcmVhbC1vcmRlci10ZXN0Cgo=', '2026-06-08 18:30:11', '2026-06-08 15:29:11', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 320}', '2026-06-08 18:28:32', '2026-06-08 18:29:11'),
(5, 1, 1, 26, 'real_order_test', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSCk9yZGVyOiBPUkQtUFJJTlQtSllBTDIKR3Vlc3Q6IFByaW50ZXIgVGVzdCBHdWVzdApQaG9uZTogMDEwMDAwMDAwMDAKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6Mjk6NDQKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEtvc2hhcnkKICBOb3RlOiBSZWFsIG9yZGVyIHByaW50IGludGVncmF0aW9uIHRlc3QKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA0NS4wMApPcmRlciBub3RlOiBDcmVhdGVkIGZyb20gcHJpbnRlci1hZ2VudDpjcmVhdGUtcmVhbC1vcmRlci10ZXN0Cgo=', '2026-06-08 18:30:44', '2026-06-08 15:29:44', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 320}', '2026-06-08 18:29:44', '2026-06-08 18:29:44'),
(4, 1, 1, 25, 'real_order_test', 'cancelled', 'escpos_base64', 'G0AKQU9UIE9SREVSCk9yZGVyOiBPUkQtUFJJTlQtMk5NQlcKR3Vlc3Q6IFByaW50ZXIgVGVzdCBHdWVzdApQaG9uZTogMDEwMDAwMDAwMDAKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6Mjk6MTAKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEtvc2hhcnkKICBOb3RlOiBSZWFsIG9yZGVyIHByaW50IGludGVncmF0aW9uIHRlc3QKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA0NS4wMApPcmRlciBub3RlOiBDcmVhdGVkIGZyb20gcHJpbnRlci1hZ2VudDpjcmVhdGUtcmVhbC1vcmRlci10ZXN0Cgo=', NULL, NULL, NULL, 'test_reset', 'Cancelled by printer-agent:create-real-order-test --clear-pending-test-jobs', '{\"source\": \"real_order_test\", \"created_by\": \"OrderPrintJobService\", \"order_code\": \"ORD-PRINT-2NMBW\"}', '2026-06-08 18:29:10', '2026-06-08 18:29:44'),
(6, 1, 1, 27, 'real_order_test', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSCk9yZGVyOiBPUkQtUFJJTlQtTjQ5UzgKR3Vlc3Q6IFByaW50ZXIgVGVzdCBHdWVzdApQaG9uZTogMDEwMDAwMDAwMDAKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6MzU6MzQKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEtvc2hhcnkKICBOb3RlOiBSZWFsIG9yZGVyIHByaW50IGludGVncmF0aW9uIHRlc3QKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA0NS4wMApPcmRlciBub3RlOiBDcmVhdGVkIGZyb20gcHJpbnRlci1hZ2VudDpjcmVhdGUtcmVhbC1vcmRlci10ZXN0Cgo=', '2026-06-08 18:36:35', '2026-06-08 15:35:35', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 320}', '2026-06-08 18:35:34', '2026-06-08 18:35:35'),
(7, 1, 1, 28, 'real_order_test', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSCk9yZGVyOiBPUkQtUFJJTlQtSVJES1IKR3Vlc3Q6IFByaW50ZXIgVGVzdCBHdWVzdApQaG9uZTogMDEwMDAwMDAwMDAKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6NDA6NTYKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEtvc2hhcnkKICBOb3RlOiBSZWFsIG9yZGVyIHByaW50IGludGVncmF0aW9uIHRlc3QKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA0NS4wMApPcmRlciBub3RlOiBDcmVhdGVkIGZyb20gcHJpbnRlci1hZ2VudDpjcmVhdGUtcmVhbC1vcmRlci10ZXN0Cgo=', '2026-06-08 18:41:57', '2026-06-08 15:40:57', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 320}', '2026-06-08 18:40:56', '2026-06-08 18:40:57'),
(8, 1, 1, 29, 'real_order_test', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSCk9yZGVyOiBPUkQtUFJJTlQtRlZWRFEKR3Vlc3Q6IFByaW50ZXIgVGVzdCBHdWVzdApQaG9uZTogMDEwMDAwMDAwMDAKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6NDI6MTAKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEtvc2hhcnkKICBOb3RlOiBSZWFsIG9yZGVyIHByaW50IGludGVncmF0aW9uIHRlc3QKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA0NS4wMApPcmRlciBub3RlOiBDcmVhdGVkIGZyb20gcHJpbnRlci1hZ2VudDpjcmVhdGUtcmVhbC1vcmRlci10ZXN0Cgo=', '2026-06-08 18:43:12', '2026-06-08 15:42:12', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 320}', '2026-06-08 18:42:10', '2026-06-08 18:42:12'),
(9, 1, 1, 30, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSCk9yZGVyOiBPUkQtWUxZU0tOS0gKR3Vlc3Q6IHRhaGEKUGhvbmU6IDAxMgpVbml0OiAxMDEKQ3JlYXRlZDogMjAyNi0wNi0wOCAyMTo0Mzo0MgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoxIHggTW9sb2toaWEKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA3NC4wOQoK', '2026-06-08 18:44:45', '2026-06-08 15:43:45', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 192}', '2026-06-08 18:43:42', '2026-06-08 18:43:45'),
(10, 1, 1, 31, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSCk9yZGVyOiBPUkQtSUlHV09OUTcKR3Vlc3Q6IFRhaGEKUGhvbmU6IDEyMzMKVW5pdDogMTA0CkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6NTI6MDUKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMyB4IEdyaWxsZWQgS29mdGEKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCAyNjIuMjAKCg==', '2026-06-08 18:53:06', '2026-06-08 15:52:06', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 199}', '2026-06-08 18:52:05', '2026-06-08 18:52:06'),
(11, 1, 1, 32, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IFJFQ0VJVkVECk9yZGVyOiBPUkQtUFJJTlQtQVdGTUUKR3Vlc3Q6IFByaW50ZXIgVGVzdCBHdWVzdApQaG9uZTogMDEwMDAwMDAwMDAKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6NTY6NTkKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEtvc2hhcnkKICBOb3RlOiBSZWFsIG9yZGVyIHByaW50IGludGVncmF0aW9uIHRlc3QKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA0NS4wMApPcmRlciBub3RlOiBDcmVhdGVkIGZyb20gcHJpbnRlci1hZ2VudDpjcmVhdGUtcmVhbC1vcmRlci10ZXN0Cgo=', '2026-06-08 18:58:00', '2026-06-08 15:57:00', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 338}', '2026-06-08 18:56:59', '2026-06-08 18:57:00'),
(12, 1, 1, 33, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IFJFQ0VJVkVECk9yZGVyOiBPUkQtUFJJTlQtRVpSSUIKR3Vlc3Q6IFByaW50ZXIgVGVzdCBHdWVzdApQaG9uZTogMDEwMDAwMDAwMDAKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjE6NTc6MTIKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEtvc2hhcnkKICBOb3RlOiBSZWFsIG9yZGVyIHByaW50IGludGVncmF0aW9uIHRlc3QKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA0NS4wMApPcmRlciBub3RlOiBDcmVhdGVkIGZyb20gcHJpbnRlci1hZ2VudDpjcmVhdGUtcmVhbC1vcmRlci10ZXN0Cgo=', '2026-06-08 18:58:13', '2026-06-08 15:57:13', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 338}', '2026-06-08 18:57:12', '2026-06-08 18:57:13'),
(13, 1, 1, 34, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IFJFQ0VJVkVECk9yZGVyOiBPUkQtUDlYUzNEQVQKR3Vlc3Q6IDExClBob25lOiAtClVuaXQ6IDEwMwpDcmVhdGVkOiAyMDI2LTA2LTA4IDIyOjEzOjIwCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCjEgeCBGYWxhZmVsIChUYWFtZXlhKQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpUb3RhbDogRUdQIDI4LjUwCgo=', '2026-06-08 19:14:22', '2026-06-08 16:13:22', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 215}', '2026-06-08 19:13:20', '2026-06-08 19:13:22'),
(14, 1, 1, 34, 'order_confirmed', 'failed', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IENPTkZJUk1FRApPcmRlcjogT1JELVA5WFMzREFUCkd1ZXN0OiAxMQpQaG9uZTogLQpVbml0OiAxMDMKQ3JlYXRlZDogMjAyNi0wNi0wOCAyMjoxMzo1OAotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoxIHggRmFsYWZlbCAoVGFhbWV5YSkKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCAyOC41MAoK', '2026-06-08 19:14:59', NULL, NULL, 'printer_unreachable', 'dial tcp 127.0.0.1:19100: connectex: No connection could be made because the target machine actively refused it.', '{\"confirmation\": null, \"bytes_written\": 0}', '2026-06-08 19:13:58', '2026-06-08 19:13:59'),
(15, 1, 1, 35, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IFJFQ0VJVkVECk9yZGVyOiBPUkQtR09PT1RDQ1gKR3Vlc3Q6IDAwClBob25lOiAtClVuaXQ6IDEwNQpDcmVhdGVkOiAyMDI2LTA2LTA4IDIyOjE4OjIxCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCjEgeCBIYXdhd3NoaQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpUb3RhbDogRUdQIDUxLjMwCgo=', '2026-06-08 19:19:23', '2026-06-08 16:18:23', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 206}', '2026-06-08 19:18:21', '2026-06-08 19:18:23'),
(16, 1, 1, 36, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IFJFQ0VJVkVECk9yZGVyOiBPUkQtT0NKVkZaV0gKR3Vlc3Q6IDExClBob25lOiAxMTEKVW5pdDogMTAyCkNyZWF0ZWQ6IDIwMjYtMDYtMDggMjI6MjA6MzYKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEdyaWxsZWQgS29mdGEKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KVG90YWw6IEVHUCA5MS4yMAoK', '2026-06-08 19:21:38', '2026-06-08 16:20:38', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 213}', '2026-06-08 19:20:36', '2026-06-08 19:20:38'),
(17, 1, 1, 36, 'order_confirmed', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IENPTkZJUk1FRApPcmRlcjogT1JELU9DSlZGWldICkd1ZXN0OiAxMQpQaG9uZTogMTExClVuaXQ6IDEwMgpDcmVhdGVkOiAyMDI2LTA2LTA4IDIyOjIwOjQ1Ci0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCjEgeCBHcmlsbGVkIEtvZnRhCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tClRvdGFsOiBFR1AgOTEuMjAKCg==', '2026-06-08 19:21:47', '2026-06-08 16:20:47', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 214}', '2026-06-08 19:20:45', '2026-06-08 19:20:47'),
(18, 1, 1, 37, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IFJFQ0VJVkVECk9yZGVyOiBPUkQtQ1ZRTlRMT0kKR3Vlc3Q6IGRkZGQKUGhvbmU6IC0KVW5pdDogMTAzCkNyZWF0ZWQ6IDIwMjYtMDYtMDkgMDE6MDQ6MTAKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEhhd2F3c2hpCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tClRvdGFsOiBFR1AgNTEuMzAKCg==', '2026-06-08 22:08:34', '2026-06-08 19:07:34', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 208}', '2026-06-08 22:04:10', '2026-06-08 22:07:34'),
(19, 1, 1, 38, 'order_created', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IFJFQ0VJVkVECk9yZGVyOiBPUkQtRUlGSVhSR0IKR3Vlc3Q6IGdnZwpQaG9uZTogLQpVbml0OiAxMDIKQ3JlYXRlZDogMjAyNi0wNi0wOSAwMTowNzo1MQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoyIHggV2FmZmxlCjEgeCBUdXJraXNoIENvZmZlZQoxIHggS3VuYWZhCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tClRvdGFsOiBFR1AgMTcxLjAwCgo=', '2026-06-08 22:08:54', '2026-06-08 19:07:54', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 236}', '2026-06-08 22:07:51', '2026-06-08 22:07:54'),
(20, 1, 1, 38, 'order_confirmed', 'sent', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IENPTkZJUk1FRApPcmRlcjogT1JELUVJRklYUkdCCkd1ZXN0OiBnZ2cKUGhvbmU6IC0KVW5pdDogMTAyCkNyZWF0ZWQ6IDIwMjYtMDYtMDkgMDE6MDg6MTEKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMiB4IFdhZmZsZQoxIHggVHVya2lzaCBDb2ZmZWUKMSB4IEt1bmFmYQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpUb3RhbDogRUdQIDE3MS4wMAoK', '2026-06-08 22:09:14', '2026-06-08 19:08:14', NULL, NULL, NULL, '{\"confirmation\": \"socket_write_only\", \"bytes_written\": 237}', '2026-06-08 22:08:11', '2026-06-08 22:08:14'),
(57, 4, 7, 77, 'order_confirmed', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBMb2JieSBCYXINChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjMTUNChthAE9yZGVyOiBPUkQtTk9SVFk4NlANChthAExvY2F0aW9uOiBUYWJsZSA0DQobYQBHdWVzdCBOYW1lOiBUYWhhDQobYQBQaG9uZTogMDEyMDAwMDANChthAENyZWF0ZWQ6IDIwMjYtMDYtMTQgMTg6MTU6NTgNChthAFBhaWQ6IEVHUCA5MS4yMA0KG2EATWV0aG9kOiBDYXNoDQobYQBQYWlkIEJ5OiBBZG1pbiBVc2VyDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EAMSB4IEt1bmFmYS4uLi4uLi4uLi4uLi4uLi4uNDUuMDANChthADEgeCBCYWtsYXZhLi4uLi4uLi4uLi4uLi4uLjMwLjAwDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EASXRlbXM6IDIgUXR5OiAyDQobYQBTdWJ0b3RhbC4uLi4uLi4uLi4uLi4uLi4uLi43NS4wMA0KG2EAQ292ZXIgQ2hhcmdlLi4uLi4uLi4uLi4uLi4uKzUuMDANChthAFZBVC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uKzExLjIwDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EAVG90YWwuLi4uLi4uLi4uLi4uLi4uLi5FR1AgOTEuMjANChthARthAS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQFUaGFuayB5b3UgZm9yIHlvdXIgb3JkZXINChthAVdlIGhvcGUgdG8gc2VlIHlvdSBhZ2FpbiBzb29uDQobIQAbYQANCg0KDQoNCh1WQkA=', '2026-06-14 18:17:01', '2026-06-14 15:16:01', NULL, NULL, NULL, '{\"source\":\"order_confirmed\",\"order_code\":\"ORD-NORTY86P\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"PSK-PYR - Lobby Bar\\nTrigger: CONFIRMED\\nOrder No: Order #15\\nOrder: ORD-NORTY86P\\nLocation: Table 4\\nGuest Name: Taha\\nPhone: 01200000\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 18:15:58\\nPaid: EGP 91.20\\nMethod: Cash\\nPaid By: Admin User\\n--------------------------------\\n1 x Kunafa.................45.00\\n1 x Baklava................30.00\\n--------------------------------\\nItems: 2    Qty: 2\\nSubtotal...................75.00\\nCover Charge...............+5.00\\nVAT.......................+11.20\\n--------------------------------\\nTotal..................EGP 91.20\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":1,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[1,16],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"customer_receipt\",\"matched_link_id\":9,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":9,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":1},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":722,\"confirmation\":\"socket_write_only\"}', '2026-06-14 18:15:58', '2026-06-14 18:16:01'),
(56, 4, 7, 76, 'order_created', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBSb29tIFNlcnZpY2UNChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjMTQNChthAE9yZGVyOiBPUkQtMjYwNTI2LU5GUlMNChthAExvY2F0aW9uOiBSb29tIDEwMQ0KG2EAR3Vlc3QgTmFtZTogWmlhZCBUYXJlaw0KG2EAUGhvbmU6IDEwMDAyMDUxNDYNChthAENyZWF0ZWQ6IDIwMjYtMDYtMTQgMTg6MTE6MTYNChthAENvbGxlY3Q6IEVHUCAxODUuNTANChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQAxIHggR3JpbGxlZCBLb2Z0YS4uLi4uLi4uLi43NS4wMA0KG2EALS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthAEl0ZW1zOiAxIFF0eTogMQ0KG2EAU3VidG90YWwuLi4uLi4uLi4uLi4uLi4uLi4uNzUuMDANChthAFNlcnZpY2UgQ2hhcmdlLi4uLi4uLi4uLi4uKzEwLjUwDQobYQBhZGp1c21lbnQxLi4uLi4uLi4uLi4uLi4uKzEwMC4wMA0KG2EALS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthAFRvdGFsLi4uLi4uLi4uLi4uLi4uLi5FR1AgMTg1LjUwDQobYQEbYQEtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EBVGhhbmsgeW91IGZvciB5b3VyIG9yZGVyDQobYQFXZSBob3BlIHRvIHNlZSB5b3UgYWdhaW4gc29vbg0KGyEAG2EADQoNCg0KDQodVkJA', '2026-06-14 18:12:16', '2026-06-14 15:11:16', NULL, NULL, NULL, '{\"source\":\"order_created\",\"order_code\":\"ORD-260526-NFRS\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"PSK-PYR - Room Service\\nTrigger: RECEIVED\\nOrder No: Order #14\\nOrder: ORD-260526-NFRS\\nLocation: Room 101\\nGuest Name: Ziad Tarek\\nPhone: 1000205146\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 18:11:16\\nCollect: EGP 185.50\\n--------------------------------\\n1 x Grilled Kofta..........75.00\\n--------------------------------\\nItems: 1    Qty: 1\\nSubtotal...................75.00\\nService Charge............+10.50\\nadjusment1...............+100.00\\n--------------------------------\\nTotal.................EGP 185.50\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":16,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[1,1,16,16],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"kot\",\"matched_link_id\":10,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":10,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":0},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":663,\"confirmation\":\"socket_write_only\"}', '2026-06-14 18:11:16', '2026-06-14 18:11:16'),
(55, 4, 7, 44, 'manual_reprint', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBvcnRvIFNva2huYSAtIFB5cmFtaWRzDQobRQAbIQAbYQBPcmRlciBObzogT3JkZXIgIzEzDQobYQBPcmRlcjogT1JELVgwUEQyVU5XDQobYQBMb2NhdGlvbjogUm9vbSAxMDINChthAEd1ZXN0IE5hbWU6IC0NChthAFBob25lOiAtDQobYQBDcmVhdGVkOiAyMDI2LTA2LTE0IDE1OjU5OjQ3DQobYQBQYWlkOiBFR1AgMzcuNjENChthAE1ldGhvZDogQ2FzaA0KG2EAUGFpZCBCeTogQWRtaW4gVXNlcg0KG2EALS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthADEgeCBJY2UgQ3JlYW0uLi4uLi4uLi4uLi4uLjI4LjAwDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EASXRlbXM6IDEgUXR5OiAxDQobYQBTdWJ0b3RhbC4uLi4uLi4uLi4uLi4uLi4uLi4yOC4wMA0KG2EAQ292ZXIgQ2hhcmdlLi4uLi4uLi4uLi4uLi4uKzUuMDANChthAFZBVC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLis0LjYyDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EAVG90YWwuLi4uLi4uLi4uLi4uLi4uLi5FR1AgMzcuNjENChthARthAS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQFUaGFuayB5b3UgZm9yIHlvdXIgb3JkZXINChthAVdlIGhvcGUgdG8gc2VlIHlvdSBhZ2FpbiBzb29uDQobIQAbYQANCg0KDQoNCh1WQkA=', '2026-06-14 16:00:51', '2026-06-14 12:59:51', NULL, NULL, NULL, '{\"source\":\"manual_reprint\",\"order_code\":\"ORD-X0PD2UNW\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"Porto Sokhna - Pyramids\\nTrigger: REPRINT\\nOrder No: Order #13\\nOrder: ORD-X0PD2UNW\\nLocation: Room 102\\nGuest Name: -\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 15:59:47\\nPaid: EGP 37.61\\nMethod: Cash\\nPaid By: Admin User\\n--------------------------------\\n1 x Ice Cream..............28.00\\n--------------------------------\\nItems: 1    Qty: 1\\nSubtotal...................28.00\\nCover Charge...............+5.00\\nVAT........................+4.62\\n--------------------------------\\nTotal..................EGP 37.61\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":null,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[16],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":true,\"routing_engine\":\"linked_printer\",\"document_type\":\"customer_receipt\",\"matched_link_id\":7,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":7,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":1},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":680,\"confirmation\":\"socket_write_only\"}', '2026-06-14 15:59:47', '2026-06-14 15:59:51'),
(34, 2, 5, 42, 'order_created', 'cancelled', 'escpos_base64', 'G0AKQU9UIE9SREVSClRyaWdnZXI6IFJFQ0VJVkVECk9yZGVyOiBPUkQtODZHR0pLT1AKR3Vlc3Q6INin2KrYp9mE2KrYp9mE2KoKUGhvbmU6INmE2KfYqtmE2KfYqtmE2KcKVW5pdDogMTAxCkNyZWF0ZWQ6IDIwMjYtMDYtMDkgMTQ6NDg6MTMKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KMSB4IEljZSBDcmVhbQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpUb3RhbDogRUdQIDM3LjYxCgo=', NULL, NULL, NULL, 'stale_agent', 'Cancelled because the printer agent is no longer approved/configured', '{\"source\": \"order_created\", \"printer\": \"local-fake-printer\", \"created_by\": \"OrderPrintJobService\", \"order_code\": \"ORD-86GGJKOP\", \"order_zone_id\": 1, \"station_label\": \"Cashier\", \"printer_zone_id\": null}', '2026-06-09 11:48:13', '2026-06-09 11:59:38'),
(54, 4, 7, 44, 'order_confirmed', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBvcnRvIFNva2huYSAtIFB5cmFtaWRzDQobRQAbIQAbYQBPcmRlciBObzogT3JkZXIgIzEzDQobYQBPcmRlcjogT1JELVgwUEQyVU5XDQobYQBMb2NhdGlvbjogUm9vbSAxMDINChthAEd1ZXN0IE5hbWU6IC0NChthAFBob25lOiAtDQobYQBDcmVhdGVkOiAyMDI2LTA2LTE0IDE1OjU0OjE0DQobYQBQYWlkOiBFR1AgMzcuNjENChthAE1ldGhvZDogQ2FzaA0KG2EAUGFpZCBCeTogQWRtaW4gVXNlcg0KG2EALS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthADEgeCBJY2UgQ3JlYW0uLi4uLi4uLi4uLi4uLjI4LjAwDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EASXRlbXM6IDEgUXR5OiAxDQobYQBTdWJ0b3RhbC4uLi4uLi4uLi4uLi4uLi4uLi4yOC4wMA0KG2EAQ292ZXIgQ2hhcmdlLi4uLi4uLi4uLi4uLi4uKzUuMDANChthAFZBVC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLis0LjYyDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EAVG90YWwuLi4uLi4uLi4uLi4uLi4uLi5FR1AgMzcuNjENChthARthAS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQFUaGFuayB5b3UgZm9yIHlvdXIgb3JkZXINChthAVdlIGhvcGUgdG8gc2VlIHlvdSBhZ2FpbiBzb29uDQobIQAbYQANCg0KDQoNCh1WQkA=', '2026-06-14 15:55:16', '2026-06-14 12:54:16', NULL, NULL, NULL, '{\"source\":\"order_confirmed\",\"order_code\":\"ORD-X0PD2UNW\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"Porto Sokhna - Pyramids\\nTrigger: CONFIRMED\\nOrder No: Order #13\\nOrder: ORD-X0PD2UNW\\nLocation: Room 102\\nGuest Name: -\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 15:54:14\\nPaid: EGP 37.61\\nMethod: Cash\\nPaid By: Admin User\\n--------------------------------\\n1 x Ice Cream..............28.00\\n--------------------------------\\nItems: 1    Qty: 1\\nSubtotal...................28.00\\nCover Charge...............+5.00\\nVAT........................+4.62\\n--------------------------------\\nTotal..................EGP 37.61\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":null,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[16],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"customer_receipt\",\"matched_link_id\":7,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":7,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":1},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":680,\"confirmation\":\"socket_write_only\"}', '2026-06-14 15:54:14', '2026-06-14 15:54:16'),
(53, 4, 7, 75, 'order_confirmed', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBSb29tIFNlcnZpY2UNChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjMTINChthAE9yZGVyOiBPUkQtWFhYQ0FKUTQNChthAExvY2F0aW9uOiBSb29tIDEwMQ0KG2EAR3Vlc3QgTmFtZTogNTI0DQobYQBQaG9uZTogLQ0KG2EAQ3JlYXRlZDogMjAyNi0wNi0xNCAxMzo1MDozMA0KG2EAUGFpZDogRUdQIDE4NS41MA0KG2EATWV0aG9kOiBDYXNoDQobYQBQYWlkIEJ5OiBBZG1pbiBVc2VyDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EAMSB4IEdyaWxsZWQgS29mdGEgNzUuMDANChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQBJdGVtczogMSBRdHk6IDENChthAFN1YnRvdGFsIDc1LjAwDQobYQBTZXJ2aWNlIENoYXJnZSArMTAuNTANChthAGFkanVzbWVudDEgKzEwMC4wMA0KG2EALS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthAFRvdGFsIEVHUCAxODUuNTANChthARthAS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQFUaGFuayB5b3UgZm9yIHlvdXIgb3JkZXINChthAVdlIGhvcGUgdG8gc2VlIHlvdSBhZ2FpbiBzb29uDQobIQAbYQANCg0KDQoNCh1WQkA=', '2026-06-14 13:51:31', '2026-06-14 10:50:31', NULL, NULL, NULL, '{\"source\":\"order_confirmed\",\"order_code\":\"ORD-XXXCAJQ4\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"PSK-PYR - Room Service\\nTrigger: CONFIRMED\\nOrder No: Order #12\\nOrder: ORD-XXXCAJQ4\\nLocation: Room 101\\nGuest Name: 524\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 13:50:30\\nPaid: EGP 185.50\\nMethod: Cash\\nPaid By: Admin User\\n--------------------------------\\n1 x Grilled Kofta          75.00\\n--------------------------------\\nItems: 1    Qty: 1\\nSubtotal                   75.00\\nService Charge            +10.50\\nadjusment1               +100.00\\n--------------------------------\\nTotal                 EGP 185.50\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":16,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[16],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"customer_receipt\",\"matched_link_id\":7,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":7,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":0},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":614,\"confirmation\":\"socket_write_only\"}', '2026-06-14 13:50:30', '2026-06-14 13:50:31'),
(50, 4, 7, 72, 'order_created', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBSb29tIFNlcnZpY2UNChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjOQ0KG2EAT3JkZXI6IE9SRC1OS0JUTFc3Qg0KG2EATG9jYXRpb246IFJvb20gMTAyDQobYQBHdWVzdCBOYW1lOiB0YWhhDQobYQBQaG9uZTogLQ0KG2EAQ3JlYXRlZDogMjAyNi0wNi0xNCAxMzozNDoxMg0KG2EAQ29sbGVjdDogRUdQIDg0Ni43MA0KG2EALS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthADEgeCBGYWxhZmVsIChUYWFtZXlhKQ0KG2EATm90ZTogZmhoZ2hmZyBnZiBnZmoNChthADIgeCBTaGF3YXJtYSBTYW5kd2ljaA0KG2EANyB4IEdyaWxsZWQgS29mdGENChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQBJdGVtczogMyBRdHk6IDEwDQobYQBUb3RhbDogRUdQIDg0Ni43MA0KG2EBG2EBLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthAVRoYW5rIHlvdSBmb3IgeW91ciBvcmRlcg0KG2EBV2UgaG9wZSB0byBzZWUgeW91IGFnYWluIHNvb24NChshABthAA0KDQoNCg0KHVZCQA==', '2026-06-14 13:35:16', '2026-06-14 10:34:16', NULL, NULL, NULL, '{\"source\":\"order_created\",\"order_code\":\"ORD-NKBTLW7B\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"PSK-PYR - Room Service\\nTrigger: RECEIVED\\nOrder No: Order #9\\nOrder: ORD-NKBTLW7B\\nLocation: Room 102\\nGuest Name: taha\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 13:34:12\\nCollect: EGP 846.70\\n--------------------------------\\n1 x Falafel (Taameya)\\n  Note: fhhghfg gf gfj\\n2 x Shawarma Sandwich\\n7 x Grilled Kofta\\n--------------------------------\\nItems: 3    Qty: 10\\nTotal: EGP 846.70\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":16,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[16,16,1,1],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"kot\",\"matched_link_id\":6,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":6,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":16,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":0},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":544,\"confirmation\":\"socket_write_only\"}', '2026-06-14 13:34:12', '2026-06-14 13:34:16'),
(51, 4, 7, 73, 'order_created', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBMb2JieSBCYXINChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjMTANChthAE9yZGVyOiBPUkQtS0paUkxJREgNChthAExvY2F0aW9uOiBUYWJsZSAxDQobYQBHdWVzdCBOYW1lOiAtDQobYQBQaG9uZTogLQ0KG2EAQ3JlYXRlZDogMjAyNi0wNi0xNCAxMzo0NjowMw0KG2EAQ29sbGVjdDogRUdQIDM0LjIwDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EAMSB4IE1hbmdvIEp1aWNlIDI1LjAwDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EASXRlbXM6IDEgUXR5OiAxDQobYQBTdWJ0b3RhbCAyNS4wMA0KG2EAQ292ZXIgQ2hhcmdlICs1LjAwDQobYQBWQVQgKzQuMjANChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQBUb3RhbCBFR1AgMzQuMjANChthARthAS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQFUaGFuayB5b3UgZm9yIHlvdXIgb3JkZXINChthAVdlIGhvcGUgdG8gc2VlIHlvdSBhZ2FpbiBzb29uDQobIQAbYQANCg0KDQoNCh1WQkA=', '2026-06-14 13:47:07', '2026-06-14 10:46:07', NULL, NULL, NULL, '{\"source\":\"order_created\",\"order_code\":\"ORD-KJZRLIDH\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"PSK-PYR - Lobby Bar\\nTrigger: RECEIVED\\nOrder No: Order #10\\nOrder: ORD-KJZRLIDH\\nLocation: Table 1\\nGuest Name: -\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 13:46:03\\nCollect: EGP 34.20\\n--------------------------------\\n1 x Mango Juice            25.00\\n--------------------------------\\nItems: 1    Qty: 1\\nSubtotal                   25.00\\nCover Charge               +5.00\\nVAT                        +4.20\\n--------------------------------\\nTotal                  EGP 34.20\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":1,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[16,16,1,1],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"kot\",\"matched_link_id\":4,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":4,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":1},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":554,\"confirmation\":\"socket_write_only\"}', '2026-06-14 13:46:03', '2026-06-14 13:46:07'),
(52, 4, 7, 73, 'order_confirmed', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBMb2JieSBCYXINChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjMTANChthAE9yZGVyOiBPUkQtS0paUkxJREgNChthAExvY2F0aW9uOiBUYWJsZSAxDQobYQBHdWVzdCBOYW1lOiAtDQobYQBQaG9uZTogLQ0KG2EAQ3JlYXRlZDogMjAyNi0wNi0xNCAxMzo0NjoxMA0KG2EAUGFpZDogRUdQIDM0LjIwDQobYQBNZXRob2Q6IENhc2gNChthAFBhaWQgQnk6IEFkbWluIFVzZXINChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQAxIHggTWFuZ28gSnVpY2UgMjUuMDANChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQBJdGVtczogMSBRdHk6IDENChthAFN1YnRvdGFsIDI1LjAwDQobYQBDb3ZlciBDaGFyZ2UgKzUuMDANChthAFZBVCArNC4yMA0KG2EALS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthAFRvdGFsIEVHUCAzNC4yMA0KG2EBG2EBLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthAVRoYW5rIHlvdSBmb3IgeW91ciBvcmRlcg0KG2EBV2UgaG9wZSB0byBzZWUgeW91IGFnYWluIHNvb24NChshABthAA0KDQoNCg0KHVZCQA==', '2026-06-14 13:47:11', '2026-06-14 10:46:11', NULL, NULL, NULL, '{\"source\":\"order_confirmed\",\"order_code\":\"ORD-KJZRLIDH\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"PSK-PYR - Lobby Bar\\nTrigger: CONFIRMED\\nOrder No: Order #10\\nOrder: ORD-KJZRLIDH\\nLocation: Table 1\\nGuest Name: -\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 13:46:10\\nPaid: EGP 34.20\\nMethod: Cash\\nPaid By: Admin User\\n--------------------------------\\n1 x Mango Juice            25.00\\n--------------------------------\\nItems: 1    Qty: 1\\nSubtotal                   25.00\\nCover Charge               +5.00\\nVAT                        +4.20\\n--------------------------------\\nTotal                  EGP 34.20\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":1,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[16,16,1,1],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"customer_receipt\",\"matched_link_id\":5,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":5,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":1},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":592,\"confirmation\":\"socket_write_only\"}', '2026-06-14 13:46:10', '2026-06-14 13:46:11'),
(48, 4, 7, NULL, 'printer_test', 'sent', 'escpos_base64', 'G0AbMhshABthARtFAUFPVCBQUklOVEVSIFRFU1QbRQANChthAFByaW50ZXI6IFBlbmRpbmcgUHJpbnRlciBTZXR1cA0KU3RhdGlvbjogRGlzY292ZXJlZCBieSBJbnN0YWxsZXINCkxvY2FsIElEOiBwZW5kaW5nLXByaW50ZXItNTUyZjhhODMNCkxhbmd1YWdlOiBFbmdsaXNoDQpUaW1lOiAyMDI2LTA2LTE0IDEyOjM4OjAxDQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KSWYgeW91IGNhbiByZWFkIHRoaXMsIHJvdXRpbmcgd29ya3MuDQoNCg0KDQoNCg0KDQodVgA=', '2026-06-14 12:39:01', '2026-06-14 09:38:01', NULL, NULL, NULL, '{\"source\":\"print_routing_test_button\",\"printer\":\"pending-printer-552f8a83\",\"business_date\":\"2026-06-14\",\"print_language\":\"en\",\"arabic_code_page\":\"pc864_22\",\"receipt_preview\":\"\\u001b@\\u001b2\\u001b!\\u0000\\u001ba\\u0001\\u001bE\\u0001AOT PRINTER TEST\\u001bE\\u0000\\r\\n\\u001ba\\u0000Printer: Pending Printer Setup\\r\\nStation: Discovered by Installer\\r\\nLocal ID: pending-printer-552f8a83\\r\\nLanguage: English\\r\\nTime: 2026-06-14 12:38:01\\r\\n--------------------------------\\r\\nIf you can read this, routing works.\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\u001dV\\u0000\",\"created_by\":\"PrintRouting\",\"bytes_written\":272,\"confirmation\":\"socket_write_only\"}', '2026-06-14 12:38:01', '2026-06-14 12:38:01'),
(49, 4, 7, 70, 'order_confirmed', 'sent', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBMb2JieSBCYXINChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjNQ0KG2EAT3JkZXI6IE9SRC1HTEk1QVBVSw0KG2EATG9jYXRpb246IFRhYmxlIDQNChthAEd1ZXN0IE5hbWU6IHRhaGENChthAFBob25lOiAtDQobYQBDcmVhdGVkOiAyMDI2LTA2LTE0IDEzOjI3OjExDQobYQBQYWlkOiBFR1AgNjUyLjkwDQobYQBNZXRob2Q6IENhc2gNChthAFBhaWQgQnk6IEFkbWluIFVzZXINChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQAxIHggSGliaXNjdXMgKEthcmthZGUpDQobYQAxIHggS3VuYWZhDQobYQAxIHggQmFrbGF2YQ0KG2EAMSB4IFR1cmtpc2ggQ29mZmVlDQobYQAxIHggSWNlIENyZWFtDQobYQAxIHggR3JpbGxlZCBDaGlja2VuDQobYQAxIHggUmljZSBQdWRkaW5nDQobYQAxIHggR3JpbGxlZCBGaXNoDQobYQAxIHggRnJlc2ggT3JhbmdlIEp1aWNlDQobYQAxIHggV2FmZmxlDQobYQAxIHggQ2Flc2FyIFNhbGFkDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EASXRlbXM6IDExIFF0eTogMTENChthAFRvdGFsOiBFR1AgNjUyLjkwDQobYQEbYQEtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EBVGhhbmsgeW91IGZvciB5b3VyIG9yZGVyDQobYQFXZSBob3BlIHRvIHNlZSB5b3UgYWdhaW4gc29vbg0KGyEAG2EADQoNCg0KDQodVkJA', '2026-06-14 13:28:11', '2026-06-14 10:27:11', NULL, NULL, NULL, '{\"source\":\"order_confirmed\",\"order_code\":\"ORD-GLI5APUK\",\"business_date\":\"2026-05-26\",\"receipt_preview\":\"PSK-PYR - Lobby Bar\\nTrigger: CONFIRMED\\nOrder No: Order #5\\nOrder: ORD-GLI5APUK\\nLocation: Table 4\\nGuest Name: taha\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-14 13:27:11\\nPaid: EGP 652.90\\nMethod: Cash\\nPaid By: Admin User\\n--------------------------------\\n1 x Hibiscus (Karkade)\\n1 x Kunafa\\n1 x Baklava\\n1 x Turkish Coffee\\n1 x Ice Cream\\n1 x Grilled Chicken\\n1 x Rice Pudding\\n1 x Grilled Fish\\n1 x Fresh Orange Juice\\n1 x Waffle\\n1 x Caesar Salad\\n--------------------------------\\nItems: 11    Qty: 11\\nTotal: EGP 652.90\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":1,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[16,16,1,1],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"customer_receipt\",\"matched_link_id\":5,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":5,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":1},\"copy_number\":1,\"copy_count\":1,\"bytes_written\":708,\"confirmation\":\"socket_write_only\"}', '2026-06-14 13:27:11', '2026-06-14 13:27:12'),
(58, 4, 7, 80, 'order_confirmed', 'pending', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBMb2JieSBCYXINChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjMQ0KG2EAT3JkZXI6IE9SRC1BQUNMS1hXQg0KG2EATG9jYXRpb246IFRhYmxlIDMNChthAEd1ZXN0IE5hbWU6IDEyMTMxDQobYQBQaG9uZTogLQ0KG2EAQ3JlYXRlZDogMjAyNi0wNi0xOCAyMDozNDoyNA0KG2EAUGFpZDogRUdQIDEzNC41Mg0KG2EATWV0aG9kOiBDYXNoDQobYQBQYWlkIEJ5OiBBZG1pbiBVc2VyDQobYQAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KG2EAMSB4IEt1bmFmYS4uLi4uLi4uLi4uLi4uLi4uNDUuMDANChthADEgeCBIaWJpc2N1cyAoS2Fya2FkZSkuLi4uLjE4LjAwDQobYQAxIHggVW1tIEFsaS4uLi4uLi4uLi4uLi4uLi4zNS4wMA0KG2EAMSB4IEVneXB0aWFuIFRlYS4uLi4uLi4uLi4uMTUuMDANChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQBJdGVtczogNCBRdHk6IDQNChthAFN1YnRvdGFsLi4uLi4uLi4uLi4uLi4uLi4uMTEzLjAwDQobYQBDb3ZlciBDaGFyZ2UuLi4uLi4uLi4uLi4uLi4rNS4wMA0KG2EAVkFULi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4rMTYuNTINChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQBUb3RhbC4uLi4uLi4uLi4uLi4uLi4uRUdQIDEzNC41Mg0KG2EBG2EBLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthAVRoYW5rIHlvdSBmb3IgeW91ciBvcmRlcg0KG2EBV2UgaG9wZSB0byBzZWUgeW91IGFnYWluIHNvb24NChshABthAA0KDQoNCg0KHVZCQA==', NULL, NULL, NULL, NULL, NULL, '{\"source\":\"order_confirmed\",\"order_code\":\"ORD-AACLKXWB\",\"business_date\":\"2026-05-31\",\"receipt_preview\":\"PSK-PYR - Lobby Bar\\nTrigger: CONFIRMED\\nOrder No: Order #1\\nOrder: ORD-AACLKXWB\\nLocation: Table 3\\nGuest Name: 12131\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-18 20:34:24\\nPaid: EGP 134.52\\nMethod: Cash\\nPaid By: Admin User\\n--------------------------------\\n1 x Kunafa.................45.00\\n1 x Hibiscus (Karkade).....18.00\\n1 x Umm Ali................35.00\\n1 x Egyptian Tea...........15.00\\n--------------------------------\\nItems: 4    Qty: 4\\nSubtotal..................113.00\\nCover Charge...............+5.00\\nVAT.......................+16.52\\n--------------------------------\\nTotal.................EGP 134.52\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":1,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[1,16],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"customer_receipt\",\"matched_link_id\":9,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":9,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":1},\"copy_number\":1,\"copy_count\":1}', '2026-06-18 17:34:24', '2026-06-18 17:34:24'),
(59, 4, 7, 81, 'order_confirmed', 'pending', 'escpos_base64', 'G0AbMhshABthARshEBtFAVBTSy1QWVIgLSBMb2JieSBCYXINChtFABshABthAE9yZGVyIE5vOiBPcmRlciAjMg0KG2EAT3JkZXI6IE9SRC1EREFCU1ZMQw0KG2EATG9jYXRpb246IFRhYmxlIDMNChthAEd1ZXN0IE5hbWU6IDEyMTMxDQobYQBQaG9uZTogLQ0KG2EAQ3JlYXRlZDogMjAyNi0wNi0xOCAyMDozNTozNA0KG2EAUGFpZDogRUdQIDc3LjUyDQobYQBNZXRob2Q6IENhc2gNChthAFBhaWQgQnk6IEFkbWluIFVzZXINChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQAxIHggSGliaXNjdXMgKEthcmthZGUpLi4uLi4xOC4wMA0KG2EAMSB4IEt1bmFmYS4uLi4uLi4uLi4uLi4uLi4uNDUuMDANChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQBJdGVtczogMiBRdHk6IDINChthAFN1YnRvdGFsLi4uLi4uLi4uLi4uLi4uLi4uLjYzLjAwDQobYQBDb3ZlciBDaGFyZ2UuLi4uLi4uLi4uLi4uLi4rNS4wMA0KG2EAVkFULi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uKzkuNTINChthAC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQobYQBUb3RhbC4uLi4uLi4uLi4uLi4uLi4uLkVHUCA3Ny41Mg0KG2EBG2EBLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NChthAVRoYW5rIHlvdSBmb3IgeW91ciBvcmRlcg0KG2EBV2UgaG9wZSB0byBzZWUgeW91IGFnYWluIHNvb24NChshABthAA0KDQoNCg0KHVZCQA==', NULL, NULL, NULL, NULL, NULL, '{\"source\":\"order_confirmed\",\"order_code\":\"ORD-DDABSVLC\",\"business_date\":\"2026-05-31\",\"receipt_preview\":\"PSK-PYR - Lobby Bar\\nTrigger: CONFIRMED\\nOrder No: Order #2\\nOrder: ORD-DDABSVLC\\nLocation: Table 3\\nGuest Name: 12131\\nPhone: -\\nPrinter: Pending Printer Setup\\nCreated: 2026-06-18 20:35:34\\nPaid: EGP 77.52\\nMethod: Cash\\nPaid By: Admin User\\n--------------------------------\\n1 x Hibiscus (Karkade).....18.00\\n1 x Kunafa.................45.00\\n--------------------------------\\nItems: 2    Qty: 2\\nSubtotal...................63.00\\nCover Charge...............+5.00\\nVAT........................+9.52\\n--------------------------------\\nTotal..................EGP 77.52\\n--------------------------------\\nThank you for your order\\nWe hope to see you again soon\",\"order_zone_id\":1,\"order_outlet_id\":1,\"printer\":\"pending-printer-552f8a83\",\"printer_zone_id\":1,\"printer_outlet_ids\":[1,16],\"station_label\":\"Discovered by Installer\",\"aot_firmware_bitmap\":false,\"created_by\":\"OrderPrintJobService\",\"manual_reprint\":false,\"routing_engine\":\"linked_printer\",\"document_type\":\"customer_receipt\",\"matched_link_id\":9,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"match_level\":\"outlet\",\"routing_trace\":{\"matched_link_id\":9,\"matched_link_type\":\"outlet\",\"matched_link_target_id\":1,\"matched_link_priority\":50,\"fallback_enabled\":false,\"target_rank\":1},\"copy_number\":1,\"copy_count\":1}', '2026-06-18 17:35:34', '2026-06-18 17:35:34');

-- --------------------------------------------------------

--
-- Table structure for table `print_jobs_archive`
--

CREATE TABLE IF NOT EXISTS `print_jobs_archive` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `printer_agent_id` bigint UNSIGNED NOT NULL,
  `printer_agent_printer_id` bigint UNSIGNED NOT NULL,
  `order_id` bigint UNSIGNED DEFAULT NULL,
  `source` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `status` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `payload_format` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'escpos_base64',
  `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leased_until` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `error_code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `error_message` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `archived_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `print_jobs_printer_agent_id_foreign` (`printer_agent_id`),
  KEY `print_jobs_printer_agent_printer_id_foreign` (`printer_agent_printer_id`),
  KEY `print_jobs_order_id_index` (`order_id`),
  KEY `print_jobs_source_index` (`source`),
  KEY `idx_print_jobs_agent_status_date` (`printer_agent_id`,`status`,`created_at`),
  KEY `idx_print_jobs_printer_status_date` (`printer_agent_printer_id`,`status`,`created_at`),
  KEY `idx_print_jobs_order_source_date` (`order_id`,`source`,`created_at`),
  KEY `idx_print_jobs_leased_until` (`status`,`leased_until`,`created_at`),
  KEY `idx_archived_at` (`archived_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `properties`
--

CREATE TABLE IF NOT EXISTS `properties` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `type` enum('building','villa') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `floors` int DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `properties_code_unique` (`code`),
  KEY `idx_properties_zone_id` (`zone_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `properties`
--

INSERT INTO `properties` (`id`, `zone_id`, `name`, `name_ar`, `code`, `type`, `floors`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 'Porto Sokhna - Pyramids Building 1', 'مبنى 1 بورتو السخنة - ', 'PSK-PYR-B1', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(2, 1, 'Porto Sokhna - Pyramids Building 2', 'مبنى 2 بورتو السخنة - ', 'PSK-PYR-B2', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(3, 1, 'Porto Sokhna - Pyramids Building 3', 'مبنى 3 بورتو السخنة - ', 'PSK-PYR-B3', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(4, 2, 'Porto Sokhna - Hotel Building 1', 'مبنى 1 بورتو السخنة - ', 'PSK-HOTEL-B1', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(5, 2, 'Porto Sokhna - Hotel Building 2', 'مبنى 2 بورتو السخنة - ', 'PSK-HOTEL-B2', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(6, 2, 'Porto Sokhna - Hotel Building 3', 'مبنى 3 بورتو السخنة - ', 'PSK-HOTEL-B3', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(7, 3, 'Porto Sokhna - Golf Building 1', 'مبنى 1 بورتو السخنة - ', 'PSK-GOLF-B1', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(8, 3, 'Porto Sokhna - Golf Building 2', 'مبنى 2 بورتو السخنة - ', 'PSK-GOLF-B2', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(9, 3, 'Porto Sokhna - Golf Building 3', 'مبنى 3 بورتو السخنة - ', 'PSK-GOLF-B3', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(10, 4, 'Porto South Beach - Genwa Building 1', 'مبنى 1 بورتو ساوث بيتش - ', 'PSB-GENWA-B1', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(11, 4, 'Porto South Beach - Genwa Building 2', 'مبنى 2 بورتو ساوث بيتش - ', 'PSB-GENWA-B2', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(12, 4, 'Porto South Beach - Genwa Building 3', 'مبنى 3 بورتو ساوث بيتش - ', 'PSB-GENWA-B3', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(13, 5, 'Porto South Beach - PVC Timeshare Building 1', 'مبنى 1 بورتو ساوث بيتش - ', 'PSB-PVC-B1', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(14, 5, 'Porto South Beach - PVC Timeshare Building 2', 'مبنى 2 بورتو ساوث بيتش - ', 'PSB-PVC-B2', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(15, 5, 'Porto South Beach - PVC Timeshare Building 3', 'مبنى 3 بورتو ساوث بيتش - ', 'PSB-PVC-B3', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(16, 6, 'Porto Marina - Towers Building 1', 'مبنى 1 بورتو مارينا - ', 'PMR-TOWERS-B1', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(17, 6, 'Porto Marina - Towers Building 2', 'مبنى 2 بورتو مارينا - ', 'PMR-TOWERS-B2', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(18, 6, 'Porto Marina - Towers Building 3', 'مبنى 3 بورتو مارينا - ', 'PMR-TOWERS-B3', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(19, 7, 'Porto Marina - Hotel Building 1', 'مبنى 1 بورتو مارينا - ', 'PMR-HOTEL-B1', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(20, 7, 'Porto Marina - Hotel Building 2', 'مبنى 2 بورتو مارينا - ', 'PMR-HOTEL-B2', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(21, 7, 'Porto Marina - Hotel Building 3', 'مبنى 3 بورتو مارينا - ', 'PMR-HOTEL-B3', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(22, 8, 'Porto Marina - Golf Building 1', 'مبنى 1 بورتو مارينا - ', 'PMR-GOLF-B1', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(23, 8, 'Porto Marina - Golf Building 2', 'مبنى 2 بورتو مارينا - ', 'PMR-GOLF-B2', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(24, 8, 'Porto Marina - Golf Building 3', 'مبنى 3 بورتو مارينا - ', 'PMR-GOLF-B3', 'building', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02');

-- --------------------------------------------------------

--
-- Table structure for table `refunds`
--

CREATE TABLE IF NOT EXISTS `refunds` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `request_item_id` bigint UNSIGNED NOT NULL,
  `quantity_refunded` int NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `created_by` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `refunds_request_item_id_foreign` (`request_item_id`),
  KEY `refunds_created_by_foreign` (`created_by`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `refunds`
--

INSERT INTO `refunds` (`id`, `request_item_id`, `quantity_refunded`, `amount`, `reason`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '250.00', 'Full refund', 1, '2026-05-23 17:09:16', '2026-05-23 17:09:16'),
(2, 2, 1, '389.88', 'Partial refund (including proportional adjustments)', 1, '2026-05-23 17:24:45', '2026-05-23 17:24:45'),
(3, 3, 1, '454.86', 'Partial refund (including proportional adjustments)', 1, '2026-05-23 17:24:51', '2026-05-23 17:24:51'),
(4, 4, 1, '129.96', 'Partial refund (including proportional adjustments)', 2, '2026-05-24 03:30:44', '2026-05-24 03:30:44'),
(5, 5, 1, '194.94', 'Partial refund (including proportional adjustments)', 1, '2026-05-24 03:49:37', '2026-05-24 03:49:37'),
(6, 6, 1, '194.94', 'Full refund (including proportional adjustments)', 1, '2026-05-24 05:01:15', '2026-05-24 05:01:15'),
(7, 7, 1, '454.86', 'Full refund (including proportional adjustments)', 1, '2026-05-24 05:09:31', '2026-05-24 05:09:31'),
(8, 8, 1, '194.94', 'Full refund (including proportional adjustments)', 1, '2026-05-24 05:12:28', '2026-05-24 05:12:28'),
(9, 9, 1, '129.96', 'Partial refund (including proportional adjustments)', 1, '2026-05-24 05:14:27', '2026-05-24 05:14:27'),
(10, 16, 1, '324.90', 'Partial refund (including proportional adjustments)', 2, '2026-06-06 03:06:50', '2026-06-06 03:06:50'),
(11, 15, 1, '519.84', 'Partial refund (including proportional adjustments)', 2, '2026-06-12 13:58:38', '2026-06-12 13:58:38'),
(12, 12, 1, '454.86', 'Partial refund (including proportional adjustments)', 2, '2026-06-18 14:02:47', '2026-06-18 14:02:47'),
(13, 13, 1, '194.94', 'Partial refund (including proportional adjustments)', 2, '2026-06-18 14:02:59', '2026-06-18 14:02:59'),
(14, 21, 1, '214.00', 'Partial refund (including proportional adjustments)', 2, '2026-06-18 16:16:52', '2026-06-18 16:16:52'),
(15, 22, 1, '385.00', 'Partial refund (including proportional adjustments)', 2, '2026-06-18 16:21:51', '2026-06-18 16:21:51'),
(16, 23, 1, '481.81', 'Partial refund (including proportional adjustments)', 2, '2026-06-18 16:37:24', '2026-06-18 16:37:24'),
(17, 23, 1, '481.81', 'Partial refund (including proportional adjustments)', 2, '2026-06-18 16:37:33', '2026-06-18 16:37:33'),
(18, 24, 1, '120.45', 'Partial refund (including proportional adjustments)', 2, '2026-06-18 16:39:40', '2026-06-18 16:39:40');

-- --------------------------------------------------------

--
-- Table structure for table `rental_units`
--

CREATE TABLE IF NOT EXISTS `rental_units` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `unit_id` bigint UNSIGNED NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date 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 `rental_units_unit_id_foreign` (`unit_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `request_histories`
--

CREATE TABLE IF NOT EXISTS `request_histories` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `service_request_id` bigint UNSIGNED NOT NULL,
  `request_item_id` bigint UNSIGNED DEFAULT NULL,
  `updated_by` bigint UNSIGNED DEFAULT NULL,
  `type` tinyint NOT NULL DEFAULT '1',
  `old_value` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `new_value` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `request_histories_service_request_id_foreign` (`service_request_id`),
  KEY `request_histories_request_item_id_foreign` (`request_item_id`),
  KEY `request_histories_updated_by_foreign` (`updated_by`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `request_histories`
--

INSERT INTO `request_histories` (`id`, `service_request_id`, `request_item_id`, `updated_by`, `type`, `old_value`, `new_value`, `created_at`) VALUES
(1, 1, 1, 1, 4, NULL, '250', '2026-05-23 17:09:16'),
(2, 2, 2, 1, 4, NULL, '389.88', '2026-05-23 17:24:45'),
(3, 2, 3, 1, 4, NULL, '454.86', '2026-05-23 17:24:51'),
(4, 3, 4, 2, 4, NULL, '129.96', '2026-05-24 00:30:44'),
(5, 4, 5, 1, 4, NULL, '194.94', '2026-05-24 00:49:37'),
(6, 5, 6, 1, 4, NULL, '194.94', '2026-05-24 02:01:15'),
(7, 6, 7, 1, 4, NULL, '454.86', '2026-05-24 02:09:31'),
(8, 7, 8, 1, 4, NULL, '194.94', '2026-05-24 02:12:28'),
(9, 8, 9, 1, 4, NULL, '129.96', '2026-05-24 02:14:27'),
(10, 10, 11, 2, 1, '$item->status', '2', '2026-05-26 18:44:07'),
(11, 10, 11, 2, 1, '$item->status', '3', '2026-05-26 18:44:14'),
(12, 10, 11, 2, 1, '$item->status', '4', '2026-05-26 18:44:23'),
(13, 9, 10, 2, 1, '$item->status', '2', '2026-05-26 18:44:45'),
(14, 9, 10, 2, 1, '$item->status', '4', '2026-05-26 18:44:50'),
(15, 13, 14, 2, 1, '$item->status', '2', '2026-06-03 07:39:51'),
(16, 13, 14, 2, 1, '$item->status', '3', '2026-06-03 07:40:21'),
(17, 13, 14, 2, 1, '$item->status', '2', '2026-06-03 07:40:36'),
(18, 13, 14, 2, 1, '$item->status', '4', '2026-06-03 07:40:37'),
(19, 15, 16, 2, 4, NULL, '324.9', '2026-06-06 00:06:50'),
(20, 14, 15, 2, 4, NULL, '519.84', '2026-06-12 13:58:38'),
(21, 11, 12, 2, 4, NULL, '454.86', '2026-06-18 14:02:47'),
(22, 12, 13, 2, 4, NULL, '194.94', '2026-06-18 14:03:00'),
(23, 19, 21, 2, 4, NULL, '214', '2026-06-18 16:16:52'),
(24, 20, 22, 2, 4, NULL, '385', '2026-06-18 16:21:51'),
(25, 21, 23, 2, 4, NULL, '481.81', '2026-06-18 16:37:24'),
(26, 21, 23, 2, 4, NULL, '481.81', '2026-06-18 16:37:33'),
(27, 21, 24, 2, 4, NULL, '120.45', '2026-06-18 16:39:40');

-- --------------------------------------------------------

--
-- Table structure for table `request_items`
--

CREATE TABLE IF NOT EXISTS `request_items` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `service_request_id` bigint UNSIGNED NOT NULL,
  `service_item_id` bigint UNSIGNED NOT NULL,
  `quantity` int NOT NULL DEFAULT '1',
  `unit_price` decimal(10,2) NOT NULL,
  `subtotal` decimal(12,2) NOT NULL,
  `total_price` decimal(12,2) NOT NULL,
  `refunded_quantity` int NOT NULL DEFAULT '0',
  `refunded_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `status` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `request_items_service_request_id_foreign` (`service_request_id`),
  KEY `request_items_service_item_id_foreign` (`service_item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `request_items`
--

INSERT INTO `request_items` (`id`, `service_request_id`, `service_item_id`, `quantity`, `unit_price`, `subtotal`, `total_price`, `refunded_quantity`, `refunded_amount`, `status`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 2, 1, '250.00', '250.00', '250.00', 1, '250.00', 6, NULL, '2026-05-23 11:02:17', '2026-05-23 17:09:16'),
(2, 2, 1, 1, '300.00', '300.00', '300.00', 1, '389.88', 6, NULL, '2026-05-23 17:24:37', '2026-05-23 17:24:45'),
(3, 2, 4, 1, '350.00', '350.00', '350.00', 1, '454.86', 6, NULL, '2026-05-23 17:24:37', '2026-05-23 17:24:51'),
(4, 3, 6, 1, '100.00', '100.00', '100.00', 1, '129.96', 6, NULL, '2026-05-23 22:25:12', '2026-05-24 03:30:44'),
(5, 4, 5, 1, '150.00', '150.00', '150.00', 1, '194.94', 6, NULL, '2026-05-24 03:49:30', '2026-05-24 03:49:37'),
(6, 5, 5, 1, '150.00', '150.00', '150.00', 1, '194.94', 6, NULL, '2026-05-24 05:01:07', '2026-05-24 05:01:15'),
(7, 6, 4, 1, '350.00', '350.00', '350.00', 1, '454.86', 6, NULL, '2026-05-24 05:09:24', '2026-05-24 05:09:31'),
(8, 7, 5, 1, '150.00', '150.00', '150.00', 1, '194.94', 6, NULL, '2026-05-24 05:12:21', '2026-05-24 05:12:28'),
(9, 8, 6, 1, '100.00', '100.00', '100.00', 1, '129.96', 6, NULL, '2026-05-24 05:14:20', '2026-05-24 05:14:27'),
(10, 9, 5, 1, '150.00', '150.00', '150.00', 0, '0.00', 4, 'Service: Extra Cleaning\nDetails:\n', '2026-05-25 10:37:42', '2026-05-26 18:44:50'),
(11, 10, 6, 1, '100.00', '100.00', '100.00', 0, '0.00', 4, NULL, '2026-05-26 18:43:17', '2026-05-26 18:44:23'),
(12, 11, 4, 1, '350.00', '350.00', '350.00', 1, '454.86', 6, NULL, '2026-05-26 18:52:07', '2026-06-18 14:02:47'),
(13, 12, 5, 1, '150.00', '150.00', '150.00', 1, '194.94', 6, 'ابلابل ابلا فبا بلا لب', '2026-05-29 11:26:20', '2026-06-18 14:03:00'),
(14, 13, 7, 1, '400.00', '400.00', '400.00', 0, '0.00', 4, 'Service: Deep Cleaning\nDetails:\n', '2026-06-03 07:38:29', '2026-06-03 07:40:37'),
(15, 14, 7, 1, '400.00', '400.00', '400.00', 1, '519.84', 6, 'Service: تنظيف عميق\nDetails:\n', '2026-06-04 22:00:46', '2026-06-12 13:58:38'),
(16, 15, 2, 1, '250.00', '250.00', '250.00', 1, '324.90', 6, NULL, '2026-06-06 03:03:24', '2026-06-06 03:06:50'),
(17, 16, 2, 1, '250.00', '250.00', '250.00', 0, '0.00', 4, NULL, '2026-06-13 21:37:50', '2026-06-18 14:05:31'),
(18, 17, 5, 1, '150.00', '150.00', '150.00', 0, '0.00', 4, NULL, '2026-06-18 12:53:16', '2026-06-18 12:53:38'),
(19, 18, 6, 1, '100.00', '100.00', '100.00', 0, '0.00', 4, NULL, '2026-06-18 14:03:16', '2026-06-18 14:05:23'),
(20, 18, 5, 1, '150.00', '150.00', '150.00', 0, '0.00', 4, NULL, '2026-06-18 14:03:16', '2026-06-18 14:05:23'),
(21, 19, 6, 1, '100.00', '100.00', '100.00', 1, '214.00', 6, NULL, '2026-06-18 16:16:40', '2026-06-18 16:16:52'),
(22, 20, 2, 1, '250.00', '250.00', '250.00', 1, '385.00', 6, NULL, '2026-06-18 16:21:26', '2026-06-18 16:21:51'),
(23, 21, 7, 2, '400.00', '800.00', '800.00', 2, '963.62', 6, NULL, '2026-06-18 16:37:00', '2026-06-18 16:37:33'),
(24, 21, 6, 1, '100.00', '100.00', '100.00', 1, '120.45', 6, NULL, '2026-06-18 16:37:00', '2026-06-18 16:39:40'),
(25, 21, 4, 1, '350.00', '350.00', '350.00', 0, '0.00', 1, NULL, '2026-06-18 16:37:00', '2026-06-18 16:37:00'),
(26, 21, 5, 2, '150.00', '300.00', '300.00', 0, '0.00', 1, NULL, '2026-06-18 16:37:00', '2026-06-18 16:37:00'),
(27, 22, 1, 1, '300.00', '300.00', '300.00', 0, '0.00', 1, NULL, '2026-06-18 17:19:43', '2026-06-18 17:19:43');

-- --------------------------------------------------------

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

CREATE TABLE IF NOT EXISTS `roles` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `guard_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'super-admin', 'web', '2026-05-23 00:26:53', '2026-05-23 00:26:53'),
(2, 'admin', 'web', '2026-05-23 00:26:54', '2026-05-23 00:26:54'),
(3, 'tickets-manager', 'web', '2026-05-23 00:26:55', '2026-05-23 00:26:55'),
(4, 'tickets-technician', 'web', '2026-05-23 00:26:55', '2026-05-23 00:26:55'),
(5, 'tickets-requester', 'web', '2026-05-23 00:26:56', '2026-05-23 00:26:56'),
(6, 'property-manager', 'web', '2026-05-23 00:26:56', '2026-05-23 00:26:56'),
(7, 'unit-manager', 'web', '2026-05-23 00:26:56', '2026-05-23 00:26:56'),
(8, 'visitor-manager', 'web', '2026-05-23 00:26:57', '2026-05-23 00:26:57'),
(9, 'menu-manager', 'web', '2026-05-23 00:26:57', '2026-05-23 00:26:57'),
(10, 'user', 'web', '2026-05-23 00:26:58', '2026-05-23 00:26:58'),
(11, 'service-agent', 'web', '2026-05-23 00:26:58', '2026-05-23 00:26:58'),
(12, 'cashier', 'web', '2026-05-23 00:26:58', '2026-05-23 00:26:58'),
(13, 'cashier-manager', 'web', '2026-05-23 00:26:59', '2026-05-23 00:26:59'),
(14, 'supervisor-cashier', 'web', '2026-05-23 00:26:59', '2026-05-23 00:26:59'),
(15, 'night-editor', 'web', '2026-05-23 00:27:00', '2026-05-23 00:27:00'),
(16, 'general-cashier', 'web', '2026-05-23 00:27:00', '2026-05-23 00:27:00'),
(17, 'finance', 'web', '2026-05-23 00:27:01', '2026-05-23 00:27:01');

-- --------------------------------------------------------

--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE IF NOT EXISTS `role_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `role_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(1, 1),
(1, 2),
(2, 1),
(2, 2),
(3, 1),
(3, 2),
(4, 1),
(4, 2),
(5, 1),
(5, 2),
(6, 1),
(6, 2),
(7, 1),
(7, 2),
(8, 1),
(8, 2),
(9, 1),
(9, 2),
(9, 3),
(9, 4),
(9, 5),
(9, 10),
(9, 12),
(10, 1),
(10, 2),
(10, 3),
(10, 4),
(10, 5),
(10, 10),
(11, 1),
(11, 2),
(11, 3),
(11, 4),
(12, 1),
(12, 2),
(12, 3),
(13, 1),
(13, 2),
(13, 3),
(14, 1),
(14, 2),
(14, 3),
(14, 4),
(15, 1),
(15, 2),
(15, 3),
(16, 1),
(16, 2),
(16, 4),
(17, 1),
(17, 2),
(17, 5),
(17, 10),
(18, 1),
(18, 2),
(18, 3),
(18, 4),
(18, 5),
(23, 1),
(23, 2),
(23, 3),
(23, 4),
(23, 5),
(23, 11),
(24, 1),
(24, 2),
(24, 3),
(25, 1),
(25, 2),
(25, 3),
(26, 1),
(26, 2),
(26, 3),
(27, 1),
(27, 2),
(27, 3),
(27, 4),
(27, 5),
(27, 11),
(28, 1),
(28, 2),
(28, 3),
(29, 1),
(29, 2),
(29, 3),
(30, 1),
(30, 2),
(30, 3),
(31, 1),
(31, 2),
(31, 3),
(31, 4),
(31, 5),
(31, 11),
(31, 12),
(31, 13),
(31, 14),
(32, 1),
(32, 2),
(32, 3),
(32, 4),
(32, 5),
(32, 11),
(32, 13),
(32, 14),
(33, 1),
(33, 2),
(33, 3),
(33, 11),
(33, 12),
(33, 14),
(34, 1),
(34, 2),
(34, 3),
(35, 1),
(35, 2),
(36, 1),
(36, 2),
(37, 1),
(37, 2),
(38, 1),
(38, 2),
(39, 1),
(39, 2),
(40, 1),
(40, 2),
(41, 1),
(41, 2),
(42, 1),
(42, 2),
(43, 1),
(43, 2),
(43, 3),
(43, 4),
(43, 5),
(43, 11),
(44, 1),
(44, 2),
(44, 3),
(45, 1),
(45, 2),
(45, 3),
(46, 1),
(46, 2),
(46, 3),
(47, 1),
(47, 2),
(47, 3),
(47, 4),
(48, 1),
(48, 2),
(49, 1),
(49, 2),
(49, 3),
(50, 1),
(50, 2),
(51, 1),
(51, 2),
(51, 6),
(51, 7),
(52, 1),
(52, 2),
(52, 6),
(53, 1),
(53, 2),
(53, 6),
(54, 1),
(54, 2),
(55, 1),
(55, 2),
(55, 6),
(55, 7),
(56, 1),
(56, 2),
(56, 6),
(56, 7),
(57, 1),
(57, 2),
(57, 6),
(57, 7),
(58, 1),
(58, 2),
(58, 7),
(59, 1),
(59, 6),
(60, 1),
(61, 1),
(62, 1),
(63, 1),
(63, 6),
(63, 7),
(63, 8),
(64, 1),
(65, 1),
(66, 1),
(67, 1),
(67, 6),
(67, 7),
(67, 8),
(68, 1),
(69, 1),
(70, 1),
(71, 1),
(71, 6),
(72, 1),
(73, 1),
(74, 1),
(75, 1),
(75, 8),
(76, 1),
(76, 8),
(77, 1),
(77, 8),
(78, 1),
(78, 8),
(79, 1),
(79, 8),
(80, 1),
(80, 8),
(81, 1),
(81, 8),
(82, 1),
(82, 8),
(83, 1),
(83, 8),
(84, 1),
(84, 8),
(85, 1),
(85, 8),
(86, 1),
(86, 8),
(87, 1),
(87, 8),
(88, 1),
(89, 1),
(90, 1),
(91, 1),
(92, 1),
(93, 1),
(94, 1),
(95, 1),
(95, 2),
(96, 1),
(96, 2),
(97, 1),
(97, 2),
(98, 1),
(98, 2),
(99, 1),
(99, 2),
(99, 3),
(99, 13),
(99, 17),
(100, 1),
(100, 2),
(100, 3),
(100, 13),
(100, 17),
(104, 1),
(104, 2),
(105, 1),
(105, 2),
(106, 1),
(106, 2),
(106, 11),
(106, 12),
(106, 13),
(106, 14),
(107, 1),
(107, 2),
(107, 11),
(107, 12),
(107, 13),
(107, 14),
(108, 1),
(108, 2),
(108, 12),
(108, 13),
(108, 14),
(108, 15),
(108, 16),
(109, 1),
(109, 2),
(109, 11),
(109, 12),
(109, 13),
(109, 14),
(110, 1),
(110, 2),
(110, 13),
(110, 14),
(110, 15),
(110, 16),
(110, 17),
(111, 1),
(111, 2),
(111, 13),
(111, 15),
(112, 1),
(112, 2),
(112, 12),
(112, 13),
(112, 14),
(112, 15),
(112, 16),
(113, 1),
(113, 2),
(113, 14),
(114, 1),
(114, 2),
(114, 14),
(115, 1),
(115, 2),
(115, 11),
(115, 12),
(115, 14),
(116, 1),
(116, 2),
(116, 15),
(117, 1),
(117, 2),
(117, 15),
(117, 16),
(117, 17),
(118, 1),
(118, 2),
(118, 16),
(119, 1),
(119, 2),
(119, 16),
(120, 1),
(120, 2),
(120, 16),
(121, 1),
(121, 2),
(121, 15),
(121, 16),
(121, 17),
(122, 1),
(122, 2),
(122, 16),
(122, 17),
(123, 1),
(123, 2),
(123, 16),
(123, 17),
(124, 1),
(124, 2),
(125, 1),
(125, 2),
(125, 16),
(125, 17),
(126, 1),
(126, 2),
(126, 16),
(126, 17),
(127, 1),
(127, 2),
(127, 16),
(127, 17),
(128, 1),
(128, 2),
(128, 16),
(128, 17),
(129, 1),
(129, 2),
(129, 16),
(129, 17),
(130, 1),
(130, 2),
(131, 1),
(131, 2),
(131, 16),
(131, 17),
(132, 1),
(132, 2),
(132, 16),
(132, 17),
(133, 1),
(133, 2),
(133, 16),
(133, 17),
(134, 1),
(134, 2),
(134, 16),
(134, 17),
(135, 1),
(135, 2),
(135, 16),
(135, 17),
(136, 1),
(136, 2),
(137, 1),
(137, 2),
(137, 16),
(137, 17),
(138, 1),
(138, 2),
(138, 16),
(138, 17),
(139, 1),
(139, 2),
(139, 16),
(139, 17),
(140, 1),
(140, 2),
(140, 11),
(140, 16),
(140, 17),
(141, 1),
(141, 2),
(142, 1),
(142, 2),
(143, 1),
(144, 1),
(144, 2),
(145, 1),
(145, 2),
(145, 16),
(145, 17),
(146, 1),
(146, 2),
(146, 14),
(147, 1),
(147, 2),
(147, 14),
(148, 1),
(148, 2),
(148, 14),
(149, 1),
(149, 2),
(150, 1),
(150, 2),
(150, 14),
(151, 1),
(151, 2),
(151, 14),
(152, 1),
(152, 2),
(152, 9),
(152, 11),
(153, 1),
(153, 2),
(153, 9),
(154, 1),
(154, 2),
(154, 9),
(155, 1),
(155, 2),
(155, 9),
(156, 1),
(156, 2),
(156, 9),
(156, 11),
(157, 1),
(157, 2),
(157, 9),
(158, 1),
(158, 2),
(158, 9),
(159, 1),
(159, 2),
(159, 9),
(160, 1),
(160, 2),
(160, 9),
(160, 11),
(161, 1),
(161, 2),
(161, 9),
(162, 1),
(162, 2),
(162, 9),
(163, 1),
(163, 2),
(163, 9),
(164, 1),
(164, 2),
(164, 9),
(165, 1),
(165, 2),
(165, 9),
(166, 1),
(166, 2),
(166, 9),
(167, 1),
(167, 2),
(167, 9),
(168, 1),
(168, 2),
(168, 9),
(178, 1),
(179, 1),
(180, 1),
(181, 1),
(182, 1),
(183, 1),
(183, 2),
(183, 12),
(183, 14),
(183, 15),
(183, 17),
(184, 1),
(184, 2),
(184, 12),
(185, 1),
(185, 2),
(185, 14),
(185, 15),
(185, 17),
(186, 1),
(186, 2),
(186, 12),
(186, 14),
(186, 15),
(186, 17),
(192, 1),
(192, 14),
(193, 1),
(193, 2),
(193, 14),
(194, 1),
(194, 2),
(194, 14),
(194, 15),
(194, 16),
(195, 1),
(195, 2),
(195, 16),
(201, 1),
(201, 2),
(201, 17),
(202, 1),
(202, 2),
(202, 17),
(203, 1),
(203, 2),
(203, 17),
(204, 1),
(204, 2),
(204, 17),
(207, 1),
(207, 2),
(207, 14),
(207, 15),
(207, 16),
(207, 17),
(208, 1),
(208, 2),
(208, 14),
(208, 15),
(208, 16),
(208, 17),
(209, 1),
(209, 2),
(209, 15),
(209, 16),
(209, 17),
(210, 1),
(210, 2),
(210, 15),
(210, 16),
(210, 17),
(211, 1),
(211, 2),
(211, 15),
(211, 16),
(211, 17),
(212, 1),
(212, 2),
(212, 3),
(213, 1),
(213, 2),
(213, 3),
(214, 1),
(214, 2),
(214, 3),
(215, 1),
(215, 2),
(215, 3),
(215, 4),
(215, 5),
(215, 10),
(215, 11),
(215, 12),
(215, 14),
(224, 1),
(224, 2),
(224, 9),
(225, 1),
(225, 2),
(225, 9),
(226, 1),
(226, 2),
(227, 1),
(227, 2),
(228, 1),
(228, 2),
(229, 1),
(229, 2),
(230, 1),
(230, 2),
(231, 1),
(231, 2),
(232, 1),
(232, 2),
(232, 3),
(233, 1),
(233, 2),
(233, 3);

-- --------------------------------------------------------

--
-- Table structure for table `service_categories`
--

CREATE TABLE IF NOT EXISTS `service_categories` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `icon` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sort_order` int NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `service_categories_code_unique` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `service_items`
--

CREATE TABLE IF NOT EXISTS `service_items` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `icon` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sort_order` int NOT NULL DEFAULT '0',
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `is_visible_to_guest` tinyint(1) NOT NULL DEFAULT '0',
  `unit` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `unit_price` decimal(10,2) NOT NULL,
  `service_type` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `zone_id` bigint UNSIGNED NOT NULL,
  `outlet_id` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `service_items_code_unique` (`code`),
  KEY `service_items_department_id_foreign` (`department_id`),
  KEY `service_items_zone_id_foreign` (`zone_id`),
  KEY `service_items_outlet_active_idx` (`outlet_id`,`active`)
) ENGINE=InnoDB AUTO_INCREMENT=169 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `service_items`
--

INSERT INTO `service_items` (`id`, `name`, `name_ar`, `code`, `icon`, `sort_order`, `description`, `active`, `is_visible_to_guest`, `unit`, `unit_price`, `service_type`, `department_id`, `zone_id`, `outlet_id`, `created_at`, `updated_at`) VALUES
(1, 'AC Repair', 'إصلاح تكييف', 'PSK-PYR-MNT-AC-REP', 'fas fa-snowflake', 1, NULL, 1, 0, 1, '300.00', 1, 1, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(2, 'Plumbing Fix', 'إصلاح سباكة', 'PSK-PYR-MNT-PLB-FIX', 'fas fa-faucet', 2, NULL, 1, 0, 1, '250.00', 1, 1, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(3, 'Electrical Check', 'فحص كهرباء', 'PSK-PYR-MNT-ELE-CHK', 'fas fa-bolt', 3, NULL, 1, 0, 1, '200.00', 1, 1, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(4, 'Appliance Repair', 'إصلاح أجهزة', 'PSK-PYR-MNT-APP-REP', 'fas fa-tools', 4, NULL, 1, 0, 1, '350.00', 1, 1, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(5, 'Extra Cleaning', 'تنظيف إضافي', 'PSK-PYR-HKP-EXT-CLN', 'fas fa-broom', 5, NULL, 1, 1, 1, '150.00', 1, 2, 1, NULL, '2026-05-23 00:27:06', '2026-05-25 10:37:21'),
(6, 'Linen Change', 'تغيير مفروشات', 'PSK-PYR-HKP-LIN-CHG', 'fas fa-bed', 6, NULL, 1, 1, 1, '100.00', 1, 2, 1, 16, '2026-05-23 00:27:06', '2026-06-13 21:08:22'),
(7, 'Deep Cleaning', 'تنظيف عميق', 'PSK-PYR-HKP-DEEP-CLN', 'fas fa-spray-can', 7, NULL, 1, 1, 1, '400.00', 1, 2, 1, NULL, '2026-05-23 00:27:06', '2026-05-25 10:37:19'),
(8, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'PSK-PYR-ENG-HVAC', 'fas fa-wind', 8, NULL, 1, 0, 1, '500.00', 1, 5, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(9, 'Generator Check', 'فحص مولد كهربائي', 'PSK-PYR-ENG-GEN', 'fas fa-plug', 9, NULL, 1, 0, 1, '400.00', 1, 5, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(10, 'Lock Change', 'تغيير قفل', 'PSK-PYR-SEC-LOCK', 'fas fa-key', 10, NULL, 1, 0, 1, '150.00', 1, 3, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(11, 'CCTV Check', 'فحص كاميرات', 'PSK-PYR-SEC-CCTV', 'fas fa-video', 11, NULL, 1, 0, 1, '200.00', 1, 3, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(12, 'Late Checkout', 'تأخر مغادرة', 'PSK-PYR-FDK-LATE', 'fas fa-clock', 12, NULL, 1, 0, 1, '200.00', 1, 4, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(13, 'Early Check-in', 'تسجيل دخول مبكر', 'PSK-PYR-FDK-EARLY', 'fas fa-door-open', 13, NULL, 1, 0, 1, '150.00', 1, 4, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(14, 'Luggage Storage', 'تخزين أمتعة', 'PSK-PYR-FDK-LUG', 'fas fa-suitcase', 14, NULL, 1, 0, 1, '50.00', 1, 4, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(15, 'Airport Pickup', 'استقبال من المطار', 'PSK-PYR-GST-AIR-PICK', 'fas fa-car', 15, NULL, 1, 0, 1, '800.00', 1, 7, 1, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(16, 'Airport Drop-off', 'توصيل للمطار', 'PSK-PYR-GST-AIR-DROP', 'fas fa-car-side', 16, NULL, 1, 0, 1, '600.00', 1, 7, 1, 16, '2026-05-23 00:27:06', '2026-06-13 20:54:03'),
(17, 'Extra Bed', 'سرير إضافي', 'PSK-PYR-GST-EXT-BED', 'fas fa-bed', 17, NULL, 1, 1, 1, '250.00', 1, 7, 1, 16, '2026-05-23 00:27:06', '2026-06-13 21:13:53'),
(18, 'Baby Cot', 'سرير طفل', 'PSK-PYR-GST-COT', 'fas fa-baby', 18, NULL, 1, 1, 1, '100.00', 1, 7, 1, 16, '2026-05-23 00:27:06', '2026-06-13 21:13:49'),
(19, 'Room Breakfast', 'إفطار بالغرفة', 'PSK-PYR-FNB-RM-BRK', 'fas fa-mug-hot', 19, NULL, 1, 1, 1, '180.00', 1, 6, 1, 16, '2026-05-23 00:27:06', '2026-06-13 07:29:01'),
(20, 'Room Dinner', 'عشاء بالغرفة', 'PSK-PYR-FNB-RM-DIN', 'fas fa-utensils', 20, NULL, 1, 1, 1, '350.00', 1, 6, 1, 16, '2026-05-23 00:27:06', '2026-06-13 07:28:57'),
(21, 'Minibar Refill', 'تعبئة ميني بار', 'PSK-PYR-FNB-MINI-RFL', 'fas fa-wine-bottle', 21, '', 1, 1, 1, '200.00', 1, 6, 1, 16, '2026-05-23 00:27:06', '2026-06-18 17:33:14'),
(22, 'AC Repair', 'إصلاح تكييف', 'PSK-HOTEL-MNT-AC-REP', 'fas fa-snowflake', 1, NULL, 1, 0, 1, '300.00', 1, 1, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(23, 'Plumbing Fix', 'إصلاح سباكة', 'PSK-HOTEL-MNT-PLB-FIX', 'fas fa-faucet', 2, NULL, 1, 0, 1, '250.00', 1, 1, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(24, 'Electrical Check', 'فحص كهرباء', 'PSK-HOTEL-MNT-ELE-CHK', 'fas fa-bolt', 3, NULL, 1, 0, 1, '200.00', 1, 1, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(25, 'Appliance Repair', 'إصلاح أجهزة', 'PSK-HOTEL-MNT-APP-REP', 'fas fa-tools', 4, NULL, 1, 0, 1, '350.00', 1, 1, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(26, 'Extra Cleaning', 'تنظيف إضافي', 'PSK-HOTEL-HKP-EXT-CLN', 'fas fa-broom', 5, NULL, 1, 0, 1, '150.00', 1, 2, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(27, 'Linen Change', 'تغيير مفروشات', 'PSK-HOTEL-HKP-LIN-CHG', 'fas fa-bed', 6, NULL, 1, 0, 1, '100.00', 1, 2, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(28, 'Deep Cleaning', 'تنظيف عميق', 'PSK-HOTEL-HKP-DEEP-CLN', 'fas fa-spray-can', 7, NULL, 1, 0, 1, '400.00', 1, 2, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(29, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'PSK-HOTEL-ENG-HVAC', 'fas fa-wind', 8, NULL, 1, 0, 1, '500.00', 1, 5, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(30, 'Generator Check', 'فحص مولد كهربائي', 'PSK-HOTEL-ENG-GEN', 'fas fa-plug', 9, NULL, 1, 0, 1, '400.00', 1, 5, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(31, 'Lock Change', 'تغيير قفل', 'PSK-HOTEL-SEC-LOCK', 'fas fa-key', 10, NULL, 1, 0, 1, '150.00', 1, 3, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(32, 'CCTV Check', 'فحص كاميرات', 'PSK-HOTEL-SEC-CCTV', 'fas fa-video', 11, NULL, 1, 0, 1, '200.00', 1, 3, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(33, 'Late Checkout', 'تأخر مغادرة', 'PSK-HOTEL-FDK-LATE', 'fas fa-clock', 12, NULL, 1, 0, 1, '200.00', 1, 4, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(34, 'Early Check-in', 'تسجيل دخول مبكر', 'PSK-HOTEL-FDK-EARLY', 'fas fa-door-open', 13, NULL, 1, 0, 1, '150.00', 1, 4, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(35, 'Luggage Storage', 'تخزين أمتعة', 'PSK-HOTEL-FDK-LUG', 'fas fa-suitcase', 14, NULL, 1, 0, 1, '50.00', 1, 4, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(36, 'Airport Pickup', 'استقبال من المطار', 'PSK-HOTEL-GST-AIR-PICK', 'fas fa-car', 15, NULL, 1, 0, 1, '800.00', 1, 7, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(37, 'Airport Drop-off', 'توصيل للمطار', 'PSK-HOTEL-GST-AIR-DROP', 'fas fa-car-side', 16, NULL, 1, 0, 1, '600.00', 1, 7, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(38, 'Extra Bed', 'سرير إضافي', 'PSK-HOTEL-GST-EXT-BED', 'fas fa-bed', 17, NULL, 1, 0, 1, '250.00', 1, 7, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(39, 'Baby Cot', 'سرير طفل', 'PSK-HOTEL-GST-COT', 'fas fa-baby', 18, NULL, 1, 0, 1, '100.00', 1, 7, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(40, 'Room Breakfast', 'إفطار بالغرفة', 'PSK-HOTEL-FNB-RM-BRK', 'fas fa-mug-hot', 19, NULL, 1, 0, 1, '180.00', 1, 6, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(41, 'Room Dinner', 'عشاء بالغرفة', 'PSK-HOTEL-FNB-RM-DIN', 'fas fa-utensils', 20, NULL, 1, 0, 1, '350.00', 1, 6, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(42, 'Minibar Refill', 'تعبئة ميني بار', 'PSK-HOTEL-FNB-MINI-RFL', 'fas fa-wine-bottle', 21, NULL, 1, 0, 1, '200.00', 1, 6, 2, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(43, 'AC Repair', 'إصلاح تكييف', 'PSK-GOLF-MNT-AC-REP', 'fas fa-snowflake', 1, NULL, 1, 0, 1, '300.00', 1, 1, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(44, 'Plumbing Fix', 'إصلاح سباكة', 'PSK-GOLF-MNT-PLB-FIX', 'fas fa-faucet', 2, NULL, 1, 0, 1, '250.00', 1, 1, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(45, 'Electrical Check', 'فحص كهرباء', 'PSK-GOLF-MNT-ELE-CHK', 'fas fa-bolt', 3, NULL, 1, 0, 1, '200.00', 1, 1, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(46, 'Appliance Repair', 'إصلاح أجهزة', 'PSK-GOLF-MNT-APP-REP', 'fas fa-tools', 4, NULL, 1, 0, 1, '350.00', 1, 1, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(47, 'Extra Cleaning', 'تنظيف إضافي', 'PSK-GOLF-HKP-EXT-CLN', 'fas fa-broom', 5, NULL, 1, 0, 1, '150.00', 1, 2, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(48, 'Linen Change', 'تغيير مفروشات', 'PSK-GOLF-HKP-LIN-CHG', 'fas fa-bed', 6, NULL, 1, 0, 1, '100.00', 1, 2, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(49, 'Deep Cleaning', 'تنظيف عميق', 'PSK-GOLF-HKP-DEEP-CLN', 'fas fa-spray-can', 7, NULL, 1, 0, 1, '400.00', 1, 2, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(50, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'PSK-GOLF-ENG-HVAC', 'fas fa-wind', 8, NULL, 1, 0, 1, '500.00', 1, 5, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(51, 'Generator Check', 'فحص مولد كهربائي', 'PSK-GOLF-ENG-GEN', 'fas fa-plug', 9, NULL, 1, 0, 1, '400.00', 1, 5, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(52, 'Lock Change', 'تغيير قفل', 'PSK-GOLF-SEC-LOCK', 'fas fa-key', 10, NULL, 1, 0, 1, '150.00', 1, 3, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(53, 'CCTV Check', 'فحص كاميرات', 'PSK-GOLF-SEC-CCTV', 'fas fa-video', 11, NULL, 1, 0, 1, '200.00', 1, 3, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(54, 'Late Checkout', 'تأخر مغادرة', 'PSK-GOLF-FDK-LATE', 'fas fa-clock', 12, NULL, 1, 0, 1, '200.00', 1, 4, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(55, 'Early Check-in', 'تسجيل دخول مبكر', 'PSK-GOLF-FDK-EARLY', 'fas fa-door-open', 13, NULL, 1, 0, 1, '150.00', 1, 4, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(56, 'Luggage Storage', 'تخزين أمتعة', 'PSK-GOLF-FDK-LUG', 'fas fa-suitcase', 14, NULL, 1, 0, 1, '50.00', 1, 4, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(57, 'Airport Pickup', 'استقبال من المطار', 'PSK-GOLF-GST-AIR-PICK', 'fas fa-car', 15, NULL, 1, 0, 1, '800.00', 1, 7, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(58, 'Airport Drop-off', 'توصيل للمطار', 'PSK-GOLF-GST-AIR-DROP', 'fas fa-car-side', 16, NULL, 1, 0, 1, '600.00', 1, 7, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(59, 'Extra Bed', 'سرير إضافي', 'PSK-GOLF-GST-EXT-BED', 'fas fa-bed', 17, NULL, 1, 0, 1, '250.00', 1, 7, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(60, 'Baby Cot', 'سرير طفل', 'PSK-GOLF-GST-COT', 'fas fa-baby', 18, NULL, 1, 0, 1, '100.00', 1, 7, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(61, 'Room Breakfast', 'إفطار بالغرفة', 'PSK-GOLF-FNB-RM-BRK', 'fas fa-mug-hot', 19, NULL, 1, 0, 1, '180.00', 1, 6, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(62, 'Room Dinner', 'عشاء بالغرفة', 'PSK-GOLF-FNB-RM-DIN', 'fas fa-utensils', 20, NULL, 1, 0, 1, '350.00', 1, 6, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(63, 'Minibar Refill', 'تعبئة ميني بار', 'PSK-GOLF-FNB-MINI-RFL', 'fas fa-wine-bottle', 21, NULL, 1, 0, 1, '200.00', 1, 6, 3, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(64, 'AC Repair', 'إصلاح تكييف', 'PSB-GENWA-MNT-AC-REP', 'fas fa-snowflake', 1, NULL, 1, 0, 1, '300.00', 1, 1, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(65, 'Plumbing Fix', 'إصلاح سباكة', 'PSB-GENWA-MNT-PLB-FIX', 'fas fa-faucet', 2, NULL, 1, 0, 1, '250.00', 1, 1, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(66, 'Electrical Check', 'فحص كهرباء', 'PSB-GENWA-MNT-ELE-CHK', 'fas fa-bolt', 3, NULL, 1, 0, 1, '200.00', 1, 1, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(67, 'Appliance Repair', 'إصلاح أجهزة', 'PSB-GENWA-MNT-APP-REP', 'fas fa-tools', 4, NULL, 1, 0, 1, '350.00', 1, 1, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(68, 'Extra Cleaning', 'تنظيف إضافي', 'PSB-GENWA-HKP-EXT-CLN', 'fas fa-broom', 5, NULL, 1, 0, 1, '150.00', 1, 2, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(69, 'Linen Change', 'تغيير مفروشات', 'PSB-GENWA-HKP-LIN-CHG', 'fas fa-bed', 6, NULL, 1, 0, 1, '100.00', 1, 2, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(70, 'Deep Cleaning', 'تنظيف عميق', 'PSB-GENWA-HKP-DEEP-CLN', 'fas fa-spray-can', 7, NULL, 1, 0, 1, '400.00', 1, 2, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(71, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'PSB-GENWA-ENG-HVAC', 'fas fa-wind', 8, NULL, 1, 0, 1, '500.00', 1, 5, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(72, 'Generator Check', 'فحص مولد كهربائي', 'PSB-GENWA-ENG-GEN', 'fas fa-plug', 9, NULL, 1, 0, 1, '400.00', 1, 5, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(73, 'Lock Change', 'تغيير قفل', 'PSB-GENWA-SEC-LOCK', 'fas fa-key', 10, NULL, 1, 0, 1, '150.00', 1, 3, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(74, 'CCTV Check', 'فحص كاميرات', 'PSB-GENWA-SEC-CCTV', 'fas fa-video', 11, NULL, 1, 0, 1, '200.00', 1, 3, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(75, 'Late Checkout', 'تأخر مغادرة', 'PSB-GENWA-FDK-LATE', 'fas fa-clock', 12, NULL, 1, 0, 1, '200.00', 1, 4, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(76, 'Early Check-in', 'تسجيل دخول مبكر', 'PSB-GENWA-FDK-EARLY', 'fas fa-door-open', 13, NULL, 1, 0, 1, '150.00', 1, 4, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(77, 'Luggage Storage', 'تخزين أمتعة', 'PSB-GENWA-FDK-LUG', 'fas fa-suitcase', 14, NULL, 1, 0, 1, '50.00', 1, 4, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(78, 'Airport Pickup', 'استقبال من المطار', 'PSB-GENWA-GST-AIR-PICK', 'fas fa-car', 15, NULL, 1, 0, 1, '800.00', 1, 7, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(79, 'Airport Drop-off', 'توصيل للمطار', 'PSB-GENWA-GST-AIR-DROP', 'fas fa-car-side', 16, NULL, 1, 0, 1, '600.00', 1, 7, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(80, 'Extra Bed', 'سرير إضافي', 'PSB-GENWA-GST-EXT-BED', 'fas fa-bed', 17, NULL, 1, 0, 1, '250.00', 1, 7, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(81, 'Baby Cot', 'سرير طفل', 'PSB-GENWA-GST-COT', 'fas fa-baby', 18, NULL, 1, 0, 1, '100.00', 1, 7, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(82, 'Room Breakfast', 'إفطار بالغرفة', 'PSB-GENWA-FNB-RM-BRK', 'fas fa-mug-hot', 19, NULL, 1, 0, 1, '180.00', 1, 6, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(83, 'Room Dinner', 'عشاء بالغرفة', 'PSB-GENWA-FNB-RM-DIN', 'fas fa-utensils', 20, NULL, 1, 0, 1, '350.00', 1, 6, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(84, 'Minibar Refill', 'تعبئة ميني بار', 'PSB-GENWA-FNB-MINI-RFL', 'fas fa-wine-bottle', 21, NULL, 1, 0, 1, '200.00', 1, 6, 4, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(85, 'AC Repair', 'إصلاح تكييف', 'PSB-PVC-MNT-AC-REP', 'fas fa-snowflake', 1, NULL, 1, 0, 1, '300.00', 1, 1, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(86, 'Plumbing Fix', 'إصلاح سباكة', 'PSB-PVC-MNT-PLB-FIX', 'fas fa-faucet', 2, NULL, 1, 0, 1, '250.00', 1, 1, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(87, 'Electrical Check', 'فحص كهرباء', 'PSB-PVC-MNT-ELE-CHK', 'fas fa-bolt', 3, NULL, 1, 0, 1, '200.00', 1, 1, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(88, 'Appliance Repair', 'إصلاح أجهزة', 'PSB-PVC-MNT-APP-REP', 'fas fa-tools', 4, NULL, 1, 0, 1, '350.00', 1, 1, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(89, 'Extra Cleaning', 'تنظيف إضافي', 'PSB-PVC-HKP-EXT-CLN', 'fas fa-broom', 5, NULL, 1, 0, 1, '150.00', 1, 2, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(90, 'Linen Change', 'تغيير مفروشات', 'PSB-PVC-HKP-LIN-CHG', 'fas fa-bed', 6, NULL, 1, 0, 1, '100.00', 1, 2, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(91, 'Deep Cleaning', 'تنظيف عميق', 'PSB-PVC-HKP-DEEP-CLN', 'fas fa-spray-can', 7, NULL, 1, 0, 1, '400.00', 1, 2, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(92, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'PSB-PVC-ENG-HVAC', 'fas fa-wind', 8, NULL, 1, 0, 1, '500.00', 1, 5, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(93, 'Generator Check', 'فحص مولد كهربائي', 'PSB-PVC-ENG-GEN', 'fas fa-plug', 9, NULL, 1, 0, 1, '400.00', 1, 5, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(94, 'Lock Change', 'تغيير قفل', 'PSB-PVC-SEC-LOCK', 'fas fa-key', 10, NULL, 1, 0, 1, '150.00', 1, 3, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(95, 'CCTV Check', 'فحص كاميرات', 'PSB-PVC-SEC-CCTV', 'fas fa-video', 11, NULL, 1, 0, 1, '200.00', 1, 3, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(96, 'Late Checkout', 'تأخر مغادرة', 'PSB-PVC-FDK-LATE', 'fas fa-clock', 12, NULL, 1, 0, 1, '200.00', 1, 4, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(97, 'Early Check-in', 'تسجيل دخول مبكر', 'PSB-PVC-FDK-EARLY', 'fas fa-door-open', 13, NULL, 1, 0, 1, '150.00', 1, 4, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(98, 'Luggage Storage', 'تخزين أمتعة', 'PSB-PVC-FDK-LUG', 'fas fa-suitcase', 14, NULL, 1, 0, 1, '50.00', 1, 4, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(99, 'Airport Pickup', 'استقبال من المطار', 'PSB-PVC-GST-AIR-PICK', 'fas fa-car', 15, NULL, 1, 0, 1, '800.00', 1, 7, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(100, 'Airport Drop-off', 'توصيل للمطار', 'PSB-PVC-GST-AIR-DROP', 'fas fa-car-side', 16, NULL, 1, 0, 1, '600.00', 1, 7, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(101, 'Extra Bed', 'سرير إضافي', 'PSB-PVC-GST-EXT-BED', 'fas fa-bed', 17, NULL, 1, 0, 1, '250.00', 1, 7, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(102, 'Baby Cot', 'سرير طفل', 'PSB-PVC-GST-COT', 'fas fa-baby', 18, NULL, 1, 0, 1, '100.00', 1, 7, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(103, 'Room Breakfast', 'إفطار بالغرفة', 'PSB-PVC-FNB-RM-BRK', 'fas fa-mug-hot', 19, NULL, 1, 0, 1, '180.00', 1, 6, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(104, 'Room Dinner', 'عشاء بالغرفة', 'PSB-PVC-FNB-RM-DIN', 'fas fa-utensils', 20, NULL, 1, 0, 1, '350.00', 1, 6, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(105, 'Minibar Refill', 'تعبئة ميني بار', 'PSB-PVC-FNB-MINI-RFL', 'fas fa-wine-bottle', 21, NULL, 1, 0, 1, '200.00', 1, 6, 5, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(106, 'AC Repair', 'إصلاح تكييف', 'PMR-TOWERS-MNT-AC-REP', 'fas fa-snowflake', 1, NULL, 1, 0, 1, '300.00', 1, 1, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(107, 'Plumbing Fix', 'إصلاح سباكة', 'PMR-TOWERS-MNT-PLB-FIX', 'fas fa-faucet', 2, NULL, 1, 0, 1, '250.00', 1, 1, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(108, 'Electrical Check', 'فحص كهرباء', 'PMR-TOWERS-MNT-ELE-CHK', 'fas fa-bolt', 3, NULL, 1, 0, 1, '200.00', 1, 1, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(109, 'Appliance Repair', 'إصلاح أجهزة', 'PMR-TOWERS-MNT-APP-REP', 'fas fa-tools', 4, NULL, 1, 0, 1, '350.00', 1, 1, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(110, 'Extra Cleaning', 'تنظيف إضافي', 'PMR-TOWERS-HKP-EXT-CLN', 'fas fa-broom', 5, NULL, 1, 0, 1, '150.00', 1, 2, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(111, 'Linen Change', 'تغيير مفروشات', 'PMR-TOWERS-HKP-LIN-CHG', 'fas fa-bed', 6, NULL, 1, 0, 1, '100.00', 1, 2, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(112, 'Deep Cleaning', 'تنظيف عميق', 'PMR-TOWERS-HKP-DEEP-CLN', 'fas fa-spray-can', 7, NULL, 1, 0, 1, '400.00', 1, 2, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(113, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'PMR-TOWERS-ENG-HVAC', 'fas fa-wind', 8, NULL, 1, 0, 1, '500.00', 1, 5, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(114, 'Generator Check', 'فحص مولد كهربائي', 'PMR-TOWERS-ENG-GEN', 'fas fa-plug', 9, NULL, 1, 0, 1, '400.00', 1, 5, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(115, 'Lock Change', 'تغيير قفل', 'PMR-TOWERS-SEC-LOCK', 'fas fa-key', 10, NULL, 1, 0, 1, '150.00', 1, 3, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(116, 'CCTV Check', 'فحص كاميرات', 'PMR-TOWERS-SEC-CCTV', 'fas fa-video', 11, NULL, 1, 0, 1, '200.00', 1, 3, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(117, 'Late Checkout', 'تأخر مغادرة', 'PMR-TOWERS-FDK-LATE', 'fas fa-clock', 12, NULL, 1, 0, 1, '200.00', 1, 4, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(118, 'Early Check-in', 'تسجيل دخول مبكر', 'PMR-TOWERS-FDK-EARLY', 'fas fa-door-open', 13, NULL, 1, 0, 1, '150.00', 1, 4, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(119, 'Luggage Storage', 'تخزين أمتعة', 'PMR-TOWERS-FDK-LUG', 'fas fa-suitcase', 14, NULL, 1, 0, 1, '50.00', 1, 4, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(120, 'Airport Pickup', 'استقبال من المطار', 'PMR-TOWERS-GST-AIR-PICK', 'fas fa-car', 15, NULL, 1, 0, 1, '800.00', 1, 7, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(121, 'Airport Drop-off', 'توصيل للمطار', 'PMR-TOWERS-GST-AIR-DROP', 'fas fa-car-side', 16, NULL, 1, 0, 1, '600.00', 1, 7, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(122, 'Extra Bed', 'سرير إضافي', 'PMR-TOWERS-GST-EXT-BED', 'fas fa-bed', 17, NULL, 1, 0, 1, '250.00', 1, 7, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(123, 'Baby Cot', 'سرير طفل', 'PMR-TOWERS-GST-COT', 'fas fa-baby', 18, NULL, 1, 0, 1, '100.00', 1, 7, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(124, 'Room Breakfast', 'إفطار بالغرفة', 'PMR-TOWERS-FNB-RM-BRK', 'fas fa-mug-hot', 19, NULL, 1, 0, 1, '180.00', 1, 6, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(125, 'Room Dinner', 'عشاء بالغرفة', 'PMR-TOWERS-FNB-RM-DIN', 'fas fa-utensils', 20, NULL, 1, 0, 1, '350.00', 1, 6, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(126, 'Minibar Refill', 'تعبئة ميني بار', 'PMR-TOWERS-FNB-MINI-RFL', 'fas fa-wine-bottle', 21, NULL, 1, 0, 1, '200.00', 1, 6, 6, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(127, 'AC Repair', 'إصلاح تكييف', 'PMR-HOTEL-MNT-AC-REP', 'fas fa-snowflake', 1, NULL, 1, 0, 1, '300.00', 1, 1, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(128, 'Plumbing Fix', 'إصلاح سباكة', 'PMR-HOTEL-MNT-PLB-FIX', 'fas fa-faucet', 2, NULL, 1, 0, 1, '250.00', 1, 1, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(129, 'Electrical Check', 'فحص كهرباء', 'PMR-HOTEL-MNT-ELE-CHK', 'fas fa-bolt', 3, NULL, 1, 0, 1, '200.00', 1, 1, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(130, 'Appliance Repair', 'إصلاح أجهزة', 'PMR-HOTEL-MNT-APP-REP', 'fas fa-tools', 4, NULL, 1, 0, 1, '350.00', 1, 1, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(131, 'Extra Cleaning', 'تنظيف إضافي', 'PMR-HOTEL-HKP-EXT-CLN', 'fas fa-broom', 5, NULL, 1, 0, 1, '150.00', 1, 2, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(132, 'Linen Change', 'تغيير مفروشات', 'PMR-HOTEL-HKP-LIN-CHG', 'fas fa-bed', 6, NULL, 1, 0, 1, '100.00', 1, 2, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(133, 'Deep Cleaning', 'تنظيف عميق', 'PMR-HOTEL-HKP-DEEP-CLN', 'fas fa-spray-can', 7, NULL, 1, 0, 1, '400.00', 1, 2, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(134, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'PMR-HOTEL-ENG-HVAC', 'fas fa-wind', 8, NULL, 1, 0, 1, '500.00', 1, 5, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(135, 'Generator Check', 'فحص مولد كهربائي', 'PMR-HOTEL-ENG-GEN', 'fas fa-plug', 9, NULL, 1, 0, 1, '400.00', 1, 5, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(136, 'Lock Change', 'تغيير قفل', 'PMR-HOTEL-SEC-LOCK', 'fas fa-key', 10, NULL, 1, 0, 1, '150.00', 1, 3, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(137, 'CCTV Check', 'فحص كاميرات', 'PMR-HOTEL-SEC-CCTV', 'fas fa-video', 11, NULL, 1, 0, 1, '200.00', 1, 3, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(138, 'Late Checkout', 'تأخر مغادرة', 'PMR-HOTEL-FDK-LATE', 'fas fa-clock', 12, NULL, 1, 0, 1, '200.00', 1, 4, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(139, 'Early Check-in', 'تسجيل دخول مبكر', 'PMR-HOTEL-FDK-EARLY', 'fas fa-door-open', 13, NULL, 1, 0, 1, '150.00', 1, 4, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(140, 'Luggage Storage', 'تخزين أمتعة', 'PMR-HOTEL-FDK-LUG', 'fas fa-suitcase', 14, NULL, 1, 0, 1, '50.00', 1, 4, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(141, 'Airport Pickup', 'استقبال من المطار', 'PMR-HOTEL-GST-AIR-PICK', 'fas fa-car', 15, NULL, 1, 0, 1, '800.00', 1, 7, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(142, 'Airport Drop-off', 'توصيل للمطار', 'PMR-HOTEL-GST-AIR-DROP', 'fas fa-car-side', 16, NULL, 1, 0, 1, '600.00', 1, 7, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(143, 'Extra Bed', 'سرير إضافي', 'PMR-HOTEL-GST-EXT-BED', 'fas fa-bed', 17, NULL, 1, 0, 1, '250.00', 1, 7, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(144, 'Baby Cot', 'سرير طفل', 'PMR-HOTEL-GST-COT', 'fas fa-baby', 18, NULL, 1, 0, 1, '100.00', 1, 7, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(145, 'Room Breakfast', 'إفطار بالغرفة', 'PMR-HOTEL-FNB-RM-BRK', 'fas fa-mug-hot', 19, NULL, 1, 0, 1, '180.00', 1, 6, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(146, 'Room Dinner', 'عشاء بالغرفة', 'PMR-HOTEL-FNB-RM-DIN', 'fas fa-utensils', 20, NULL, 1, 0, 1, '350.00', 1, 6, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(147, 'Minibar Refill', 'تعبئة ميني بار', 'PMR-HOTEL-FNB-MINI-RFL', 'fas fa-wine-bottle', 21, NULL, 1, 0, 1, '200.00', 1, 6, 7, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(148, 'AC Repair', 'إصلاح تكييف', 'PMR-GOLF-MNT-AC-REP', 'fas fa-snowflake', 1, NULL, 1, 0, 1, '300.00', 1, 1, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(149, 'Plumbing Fix', 'إصلاح سباكة', 'PMR-GOLF-MNT-PLB-FIX', 'fas fa-faucet', 2, NULL, 1, 0, 1, '250.00', 1, 1, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(150, 'Electrical Check', 'فحص كهرباء', 'PMR-GOLF-MNT-ELE-CHK', 'fas fa-bolt', 3, NULL, 1, 0, 1, '200.00', 1, 1, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(151, 'Appliance Repair', 'إصلاح أجهزة', 'PMR-GOLF-MNT-APP-REP', 'fas fa-tools', 4, NULL, 1, 0, 1, '350.00', 1, 1, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(152, 'Extra Cleaning', 'تنظيف إضافي', 'PMR-GOLF-HKP-EXT-CLN', 'fas fa-broom', 5, NULL, 1, 0, 1, '150.00', 1, 2, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(153, 'Linen Change', 'تغيير مفروشات', 'PMR-GOLF-HKP-LIN-CHG', 'fas fa-bed', 6, NULL, 1, 0, 1, '100.00', 1, 2, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(154, 'Deep Cleaning', 'تنظيف عميق', 'PMR-GOLF-HKP-DEEP-CLN', 'fas fa-spray-can', 7, NULL, 1, 0, 1, '400.00', 1, 2, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(155, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'PMR-GOLF-ENG-HVAC', 'fas fa-wind', 8, NULL, 1, 0, 1, '500.00', 1, 5, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(156, 'Generator Check', 'فحص مولد كهربائي', 'PMR-GOLF-ENG-GEN', 'fas fa-plug', 9, NULL, 1, 0, 1, '400.00', 1, 5, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(157, 'Lock Change', 'تغيير قفل', 'PMR-GOLF-SEC-LOCK', 'fas fa-key', 10, NULL, 1, 0, 1, '150.00', 1, 3, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(158, 'CCTV Check', 'فحص كاميرات', 'PMR-GOLF-SEC-CCTV', 'fas fa-video', 11, NULL, 1, 0, 1, '200.00', 1, 3, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(159, 'Late Checkout', 'تأخر مغادرة', 'PMR-GOLF-FDK-LATE', 'fas fa-clock', 12, NULL, 1, 0, 1, '200.00', 1, 4, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(160, 'Early Check-in', 'تسجيل دخول مبكر', 'PMR-GOLF-FDK-EARLY', 'fas fa-door-open', 13, NULL, 1, 0, 1, '150.00', 1, 4, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(161, 'Luggage Storage', 'تخزين أمتعة', 'PMR-GOLF-FDK-LUG', 'fas fa-suitcase', 14, NULL, 1, 0, 1, '50.00', 1, 4, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(162, 'Airport Pickup', 'استقبال من المطار', 'PMR-GOLF-GST-AIR-PICK', 'fas fa-car', 15, NULL, 1, 0, 1, '800.00', 1, 7, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(163, 'Airport Drop-off', 'توصيل للمطار', 'PMR-GOLF-GST-AIR-DROP', 'fas fa-car-side', 16, NULL, 1, 0, 1, '600.00', 1, 7, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(164, 'Extra Bed', 'سرير إضافي', 'PMR-GOLF-GST-EXT-BED', 'fas fa-bed', 17, NULL, 1, 0, 1, '250.00', 1, 7, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(165, 'Baby Cot', 'سرير طفل', 'PMR-GOLF-GST-COT', 'fas fa-baby', 18, NULL, 1, 0, 1, '100.00', 1, 7, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(166, 'Room Breakfast', 'إفطار بالغرفة', 'PMR-GOLF-FNB-RM-BRK', 'fas fa-mug-hot', 19, NULL, 1, 0, 1, '180.00', 1, 6, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(167, 'Room Dinner', 'عشاء بالغرفة', 'PMR-GOLF-FNB-RM-DIN', 'fas fa-utensils', 20, NULL, 1, 0, 1, '350.00', 1, 6, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(168, 'Minibar Refill', 'تعبئة ميني بار', 'PMR-GOLF-FNB-MINI-RFL', 'fas fa-wine-bottle', 21, NULL, 1, 0, 1, '200.00', 1, 6, 8, NULL, '2026-05-23 00:27:06', '2026-05-23 00:27:06');

-- --------------------------------------------------------

--
-- Table structure for table `service_requests`
--

CREATE TABLE IF NOT EXISTS `service_requests` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `requested_by` bigint UNSIGNED DEFAULT NULL,
  `assigned_to` bigint UNSIGNED DEFAULT NULL,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `outlet_id` bigint UNSIGNED DEFAULT NULL,
  `branch_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Branch (for multi-branch hotels flexibility)',
  `status` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `origin` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'staff_panel',
  `preferred_date` datetime DEFAULT NULL,
  `subtotal` decimal(12,2) NOT NULL DEFAULT '0.00',
  `discount_type` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `discount_value` decimal(10,2) DEFAULT NULL,
  `discount_amount` decimal(10,2) DEFAULT NULL,
  `total_cost` decimal(12,2) NOT NULL DEFAULT '0.00',
  `refunded_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `remaining_balance` decimal(12,2) NOT NULL DEFAULT '0.00',
  `qr_token` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `qr_expires_at` datetime DEFAULT NULL,
  `business_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `service_requests_code_unique` (`code`),
  KEY `service_requests_assigned_to_foreign` (`assigned_to`),
  KEY `service_requests_unit_id_foreign` (`unit_id`),
  KEY `service_requests_branch_id_index` (`branch_id`),
  KEY `service_requests_zone_id_index` (`zone_id`),
  KEY `service_requests_outlet_id_index` (`outlet_id`),
  KEY `requests_zone_business_idx` (`zone_id`,`business_date`),
  KEY `service_requests_requested_by_foreign` (`requested_by`),
  KEY `service_requests_origin_index` (`origin`),
  KEY `service_requests_department_id_foreign` (`department_id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `service_requests`
--

INSERT INTO `service_requests` (`id`, `code`, `requested_by`, `assigned_to`, `unit_id`, `zone_id`, `outlet_id`, `branch_id`, `status`, `origin`, `preferred_date`, `subtotal`, `discount_type`, `discount_value`, `discount_amount`, `total_cost`, `refunded_amount`, `remaining_balance`, `qr_token`, `qr_expires_at`, `business_date`, `created_at`, `updated_at`, `department_id`) VALUES
(1, 'SR-20260523-0001', 2, NULL, 1, 1, NULL, NULL, 6, 'staff_panel', NULL, '250.00', NULL, NULL, NULL, '324.90', '0.00', '0.00', '3cb34f19-26ef-4880-adb4-77d006a09196', '2026-05-26 14:02:17', '2026-05-23', '2026-05-23 11:02:17', '2026-05-24 05:26:01', NULL),
(2, 'SR-20260523-0002', 1, NULL, 2, 1, NULL, NULL, 6, 'staff_panel', NULL, '650.00', NULL, NULL, NULL, '844.74', '844.74', '0.00', '526575a7-83b1-4d97-b079-920fd5e92ee8', '2026-05-26 20:24:37', '2026-05-23', '2026-05-23 17:24:37', '2026-05-23 17:24:51', NULL),
(3, 'SR-20260523-0003', 2, NULL, 1, 1, NULL, NULL, 6, 'staff_panel', NULL, '100.00', NULL, NULL, NULL, '129.96', '129.96', '0.00', 'b75bb237-192e-44d9-a141-344cfc293b77', '2026-05-27 01:25:12', '2026-05-23', '2026-05-23 22:25:12', '2026-05-24 03:31:47', NULL),
(4, 'SR-20260523-0004', 1, NULL, 1, 1, NULL, NULL, 6, 'staff_panel', NULL, '150.00', NULL, NULL, NULL, '194.94', '194.94', '-194.94', 'a8a5b0f9-f86c-4b1e-8a35-3057a12de798', '2026-05-27 03:49:30', '2026-05-23', '2026-05-24 03:49:30', '2026-05-24 03:49:37', NULL),
(5, 'SR-20260523-0005', 1, NULL, 1, 1, NULL, NULL, 6, 'staff_panel', NULL, '150.00', NULL, NULL, NULL, '194.94', '0.00', '0.00', '58d22c6f-ab69-400e-a4e4-46ab49e95d01', '2026-05-27 05:01:07', '2026-05-23', '2026-05-24 05:01:07', '2026-05-24 05:25:45', NULL),
(6, 'SR-20260523-0006', 1, NULL, 1, 1, NULL, NULL, 6, 'staff_panel', NULL, '350.00', NULL, NULL, NULL, '454.86', '0.00', '0.00', '6df9bc24-2dad-420b-b6d1-f38a60b4f56e', '2026-05-27 05:09:24', '2026-05-23', '2026-05-24 05:09:24', '2026-05-24 05:25:53', NULL),
(7, 'SR-20260523-0007', 1, NULL, 2, 1, NULL, NULL, 6, 'staff_panel', NULL, '150.00', NULL, NULL, NULL, '194.94', '194.94', '-194.94', '51c97bea-b778-4e78-9982-f05ac36ede25', '2026-05-27 05:12:21', '2026-05-23', '2026-05-24 05:12:21', '2026-05-24 05:12:28', NULL),
(8, 'SR-20260523-0008', 1, NULL, 1, 1, 16, NULL, 6, 'staff_panel', NULL, '100.00', NULL, NULL, NULL, '129.96', '129.96', '-129.96', '9e9c793c-f7f9-4a31-a473-9b26c904ba9f', '2026-05-27 05:14:20', '2026-05-23', '2026-05-24 05:14:20', '2026-06-18 16:16:19', NULL),
(9, 'SR-20260523-0009', 1, NULL, 1, 1, NULL, NULL, 4, 'guest_web', NULL, '150.00', NULL, NULL, '0.00', '194.94', '0.00', '0.00', '74b2d131-66f6-4202-9a2a-80a23dd6ea3a', '2026-05-28 13:37:42', '2026-05-23', '2026-05-25 10:37:42', '2026-05-26 18:44:50', NULL),
(10, 'SR-20260523-0010', 2, NULL, 1, 1, NULL, NULL, 4, 'staff_panel', NULL, '100.00', NULL, NULL, NULL, '129.96', '0.00', '0.00', 'd53be6dc-bb1b-46bb-b31a-48b3540ddc9c', '2026-05-29 21:43:17', '2026-05-23', '2026-05-26 18:43:17', '2026-05-26 18:44:23', NULL),
(11, 'SR-20260523-0011', 2, NULL, 1, 1, 16, NULL, 6, 'staff_panel', NULL, '350.00', NULL, NULL, NULL, '454.86', '454.86', '0.00', '14a7a232-6151-435d-bdd6-8f3f25378464', '2026-05-29 21:52:07', '2026-05-23', '2026-05-26 18:52:07', '2026-06-18 14:02:47', NULL),
(12, 'SR-20260523-0012', 1, NULL, 1, 1, 16, NULL, 6, 'guest_web', NULL, '150.00', NULL, NULL, '0.00', '194.94', '194.94', '0.00', '4d556a5c-c6ef-4f47-9ad7-e156ec422caf', '2026-06-01 14:26:20', '2026-05-23', '2026-05-29 11:26:20', '2026-06-18 14:03:34', NULL),
(13, 'SR-20260523-0013', 3, NULL, 1, 1, 16, NULL, 4, 'guest_web', NULL, '400.00', NULL, NULL, '0.00', '519.84', '0.00', '0.00', '022cb13a-9036-4cf8-b465-c99f3d458431', '2026-06-06 10:38:29', '2026-05-23', '2026-06-03 07:38:29', '2026-06-18 12:52:20', NULL),
(14, 'SR-20260524-0001', 1, NULL, 1, 1, NULL, NULL, 6, 'guest_web', NULL, '400.00', NULL, NULL, '0.00', '519.84', '519.84', '0.00', 'c7c01eed-3d14-4f0d-bb25-4407ca4f567f', '2026-06-08 01:00:46', '2026-05-24', '2026-06-04 22:00:46', '2026-06-12 13:58:38', NULL),
(15, 'SR-20260524-0002', 2, NULL, 2, 1, NULL, NULL, 6, 'staff_panel', NULL, '250.00', NULL, NULL, NULL, '324.90', '324.90', '0.00', 'bf9170fa-265d-43f6-b2ed-9741759d5002', '2026-06-09 03:03:24', '2026-05-24', '2026-06-06 03:03:24', '2026-06-06 03:07:31', NULL),
(16, 'SR-20260526-0001', 2, NULL, 2, 1, 16, NULL, 4, 'staff_panel', NULL, '250.00', NULL, NULL, NULL, '285.00', '0.00', '0.00', 'd9c6dd80-b09a-4612-927c-a870ef2d4ac9', '2026-06-17 00:37:50', '2026-05-26', '2026-06-13 21:37:50', '2026-06-18 14:05:31', NULL),
(17, 'SR-20260527-0001', 2, NULL, 2, 1, 16, NULL, 4, 'staff_panel', NULL, '150.00', NULL, NULL, NULL, '271.00', '0.00', '0.00', 'c42c5eff-72e6-4149-991b-b29440f90f1b', '2026-06-21 15:53:16', '2026-05-27', '2026-06-18 12:53:16', '2026-06-18 12:53:38', NULL),
(18, 'SR-20260530-0001', 2, NULL, 2, 1, 16, NULL, 4, 'staff_panel', NULL, '250.00', NULL, NULL, NULL, '385.00', '0.00', '0.00', 'e540bf96-4d79-48d5-ade0-a64f1270854c', '2026-06-21 17:03:16', '2026-05-30', '2026-06-18 14:03:16', '2026-06-18 14:05:23', NULL),
(19, 'SR-20260531-0001', 2, NULL, 1, 1, 16, NULL, 6, 'staff_panel', NULL, '100.00', NULL, NULL, NULL, '214.00', '214.00', '0.00', '0e36b98a-047c-4aba-acd3-037f2b852441', '2026-06-21 19:16:40', '2026-05-31', '2026-06-18 16:16:40', '2026-06-18 16:16:55', NULL),
(20, 'SR-20260531-0002', 2, NULL, 2, 1, 16, NULL, 6, 'staff_panel', NULL, '250.00', NULL, NULL, NULL, '385.00', '385.00', '0.00', 'f6f85eba-ed91-4536-881c-659d485c1a40', '2026-06-21 19:21:26', '2026-05-31', '2026-06-18 16:21:26', '2026-06-18 16:21:57', NULL),
(21, 'SR-20260531-0003', 2, NULL, 2, 1, 16, NULL, 2, 'staff_panel', NULL, '1550.00', NULL, NULL, NULL, '1867.00', '1084.07', '-120.45', '9b9b9e7c-59d9-4609-9a99-51dff0ac48a5', '2026-06-21 19:37:00', '2026-05-31', '2026-06-18 16:37:00', '2026-06-18 16:39:40', NULL),
(22, 'SR-20260531-0004', 2, NULL, 2, 1, 16, NULL, 1, 'staff_panel', NULL, '300.00', NULL, NULL, NULL, '442.00', '0.00', '342.00', '4d8b6848-1f5a-4aeb-b697-9bd42681001e', '2026-06-21 20:19:43', '2026-05-31', '2026-06-18 17:19:43', '2026-06-18 17:19:51', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `sessions`
--

CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `payload` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_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=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('zMY2W5t5SRzDw5sO1jnJu3lzd9cCfCBNtwgkCwfI', 2, '41.33.179.50', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0', 'YTo3OntzOjY6Il90b2tlbiI7czo0MDoiY0M4Q1RGeHYwd1ZDQnNnbTNtVDY4U3lVSUdEdXV5M2ZQREpmUDRhcCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NTU6Imh0dHBzOi8vd2VjYXJlLnB2Yy1wc2IuY29tLz9jb21wb25lbnQ9Y3JlYXRlLWNhcnQtb3JkZXIiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToyO3M6MTg6InNpZGViYXJfb3Blbl9tZW51cyI7YTozOntpOjA7czo5OiJkYXNoYm9hcmQiO2k6MTtzOjE1OiJtZW51LW1hbmFnZW1lbnQiO2k6MjtzOjEyOiJzeXN0ZW0tYWRtaW4iO31zOjE3OiJwcmV2aW91c0NvbXBvbmVudCI7czoxMzoiY2FydC1yZXF1ZXN0cyI7czoxNDoiY3VycmVudE9yZGVySWQiO2k6Nzk7fQ==', 1781450753),
('t9FOIez7Nh2OQNsP1484eYjI6Q44C4sQJhACX5w3', NULL, '105.46.5.218', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.4 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.4 facebookexternalhit/1.1 Facebot Twitterbot/1.0', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiMHZMekRsUzFVczYyTkdhVlRsdzFJakM3SDdLZXpmaEhuWE8wYW1GaiI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NTQ6Imh0dHBzOi8vd2VjYXJlLnB2Yy1wc2IuY29tL2d1ZXN0L21lbnU/YWN0aXZlQ2F0ZWdvcnk9MiI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1781447805),
('uG91cS7SG3vGWIGh7xtQlbfWL0ERwN7SEBjBLxgZ', NULL, '41.33.179.50', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.4 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.4 facebookexternalhit/1.1 Facebot Twitterbot/1.0', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiY0tkTEhFNDFGcnNqWEFMRnlMQ29qazkwdkdNczBJU1NrSE9FVmtodyI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzI6Imh0dHBzOi8vd2VjYXJlLnB2Yy1wc2IuY29tL2d1ZXN0Ijt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1781449359),
('7GEtAuJomVZGc6TYmri1smP12v6qrUYi0XAu2ZIn', NULL, '41.33.179.51', 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiOFJvTDhxcFNaN1RiUVpVVUZYTWZFNTJ5bmJQeE1ZOWhNMUtlMG1iNyI7czoxMzoiZ3Vlc3RfY29udGV4dCI7YTo4OntzOjc6InpvbmVfaWQiO2k6MTtzOjE0OiJ6b25lX2xvY2tlZF9hdCI7czoyNToiMjAyNi0wNi0xNFQxODoxMDoyNCswMzowMCI7czo0OiJyb29tIjthOjM6e3M6NzoidW5pdF9pZCI7aToxO3M6MTE6InVuaXRfbnVtYmVyIjtzOjM6IjEwMSI7czoxMDoic2Nhbm5lZF9hdCI7czoyNToiMjAyNi0wNi0xNFQxODoxMDoyNCswMzowMCI7fXM6MTA6ImV4cGlyZXNfYXQiO3M6MjU6IjIwMjYtMDYtMjFUMTg6MTE6MTYrMDM6MDAiO3M6MTA6InVwZGF0ZWRfYXQiO3M6MjU6IjIwMjYtMDYtMTRUMTg6MTE6MTYrMDM6MDAiO3M6MTU6InNlcnZpY2VfY29udGV4dCI7YTo1OntzOjQ6InR5cGUiO3M6MTI6InJvb21fc2VydmljZSI7czo5OiJvdXRsZXRfaWQiO2k6MTY7czoxNjoic2VydmljZV9wb2ludF9pZCI7TjtzOjU6ImxhYmVsIjtzOjg6IlJvb20gMTAxIjtzOjEwOiJzY2FubmVkX2F0IjtzOjI1OiIyMDI2LTA2LTE0VDE4OjEwOjI0KzAzOjAwIjt9czo3OiJjYXJ0X2lkIjtpOjIyO3M6NzoiY29udGFjdCI7YTo0OntzOjI6ImlkIjtpOjc7czo1OiJwaG9uZSI7czoxMDoiMTAwMDIwNTE0NiI7czo0OiJuYW1lIjtzOjEwOiJaaWFkIFRhcmVrIjtzOjU6ImVtYWlsIjtzOjA6IiI7fX1zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjk6Il9wcmV2aW91cyI7YToxOntzOjM6InVybCI7czozMjoiaHR0cHM6Ly93ZWNhcmUucHZjLXBzYi5jb20vZ3Vlc3QiO319', 1781449876),
('vqYxzUkkPS3QKTIaox0xDgotTwG9FnedEGcjq4SG', 2, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiSnp5Qk9sSFJGTDdrRXRjTkp4Umh6eGpwRUt4SVBSWDVxdVJDYk5IRyI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzI6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMS91bml0L3FyLzE1Ijt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MjtzOjE4OiJzaWRlYmFyX29wZW5fbWVudXMiO2E6Mzp7aTowO3M6OToiZGFzaGJvYXJkIjtpOjE7czoxNToidXNlci1tYW5hZ2VtZW50IjtpOjI7czoxNjoic2l0ZXMtcHJvcGVydGllcyI7fX0=', 1781511786);

-- --------------------------------------------------------

--
-- Table structure for table `sites`
--

CREATE TABLE IF NOT EXISTS `sites` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `area_id` bigint UNSIGNED DEFAULT NULL,
  `code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sites_name_unique` (`name`),
  UNIQUE KEY `sites_code_unique` (`code`),
  KEY `sites_area_id_foreign` (`area_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sites`
--

INSERT INTO `sites` (`id`, `area_id`, `code`, `name`, `name_ar`, `description`, `created_at`, `updated_at`) VALUES
(1, 1, 'PSK', 'Porto Sokhna', 'بورتو السخنة', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(2, 1, 'PSB', 'Porto South Beach', 'بورتو ساوث بيتش', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(3, 2, 'PMR', 'Porto Marina', 'بورتو مارينا', NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02');

-- --------------------------------------------------------

--
-- Table structure for table `site_settings`
--

CREATE TABLE IF NOT EXISTS `site_settings` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `site_name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'AOT Services',
  `site_name_ar` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'AOT',
  `company_name_ar` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_tagline` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `support_email` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'support@example.com',
  `mail_from_name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail_from_address` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail_enabled` tinyint(1) NOT NULL DEFAULT '1',
  `mail_provider` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'custom',
  `mail_mailer` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'smtp',
  `mail_host` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail_port` smallint UNSIGNED DEFAULT NULL,
  `mail_encryption` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail_username` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail_password` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `mail_timeout` smallint UNSIGNED NOT NULL DEFAULT '10',
  `mail_ehlo_domain` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `whatsapp` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_ar` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_path` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `favicon_path` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `social_links` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `guest_session_days` smallint UNSIGNED NOT NULL DEFAULT '7',
  `survey_settings` json DEFAULT NULL,
  `max_image_upload_mb` smallint UNSIGNED NOT NULL DEFAULT '10',
  `system_timezone` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Africa/Cairo',
  `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=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `site_settings`
--

INSERT INTO `site_settings` (`id`, `site_name`, `site_name_ar`, `company_name`, `company_name_ar`, `company_tagline`, `support_email`, `mail_from_name`, `mail_from_address`, `mail_enabled`, `mail_provider`, `mail_mailer`, `mail_host`, `mail_port`, `mail_encryption`, `mail_username`, `mail_password`, `mail_timeout`, `mail_ehlo_domain`, `phone`, `whatsapp`, `address`, `address_ar`, `logo_path`, `favicon_path`, `social_links`, `guest_session_days`, `survey_settings`, `max_image_upload_mb`, `system_timezone`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'AOT Services', 'خدمات AOT', 'AOT', 'AOT', 'A Capital Holding', 'hello@example.com', 'AOT Services', 'hello@example.com', 1, 'custom', 'smtp', 'sandbox.smtp.mailtrap.io', 2525, 'tls', 'e12535409e8dc3', NULL, 10, NULL, '+20 2 1234 5678', '+20 100 123 4567', 'Cairo Business District, New Cairo, Egypt', 'منطقة الأعمال بالقاهرة، القاهرة الجديدة، مصر', 'images/logo-500x500.png', 'assets/images/favicon.png', '[{\"url\": \"#\", \"icon\": \"fa-facebook-f\", \"label\": \"Facebook\"}, {\"url\": \"#\", \"icon\": \"fa-instagram\", \"label\": \"Instagram\"}, {\"url\": \"#\", \"icon\": \"fa-linkedin-in\", \"label\": \"LinkedIn\"}]', 7, NULL, 3, 'Etc/GMT-3', 1, '2026-06-04 07:42:46', '2026-06-12 16:24:04');

-- --------------------------------------------------------

--
-- Table structure for table `survey_questions`
--

CREATE TABLE IF NOT EXISTS `survey_questions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dimension` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `question_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `question_text_ar` text COLLATE utf8mb4_unicode_ci,
  `response_type` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` json DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` smallint UNSIGNED NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `survey_questions_code_unique` (`code`),
  KEY `survey_questions_dimension_index` (`dimension`),
  KEY `survey_questions_is_active_index` (`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `survey_questions`
--

INSERT INTO `survey_questions` (`id`, `code`, `dimension`, `question_text`, `question_text_ar`, `response_type`, `options`, `is_active`, `sort_order`, `created_at`, `updated_at`) VALUES
(1, 'overall_service_rating', 'overall', 'How was this service?', 'ما تقييمك لهذه الخدمة؟', 'star5', '{\"reasons\": [\"fast\", \"slow\", \"clean\", \"quality\", \"staff\"]}', 1, 1, '2026-06-19 12:18:51', '2026-06-19 12:18:51');

-- --------------------------------------------------------

--
-- Table structure for table `survey_templates`
--

CREATE TABLE IF NOT EXISTS `survey_templates` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `name` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_ar` varchar(125) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trigger_type` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_kind` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `max_questions` smallint UNSIGNED NOT NULL DEFAULT '3',
  `cooldown_hours` smallint UNSIGNED DEFAULT NULL,
  `config` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `survey_templates`
--

INSERT INTO `survey_templates` (`id`, `zone_id`, `name`, `name_ar`, `trigger_type`, `source_kind`, `is_active`, `max_questions`, `cooldown_hours`, `config`, `created_at`, `updated_at`) VALUES
(1, NULL, 'Mini post-service survey', 'تقييم مصغر بعد الخدمة', 'post_service', NULL, 1, 3, NULL, '{\"channels\": [\"portal\"]}', '2026-06-19 12:18:51', '2026-06-19 12:18:51');

-- --------------------------------------------------------

--
-- Table structure for table `survey_template_question`
--

CREATE TABLE IF NOT EXISTS `survey_template_question` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `survey_template_id` bigint UNSIGNED NOT NULL,
  `survey_question_id` bigint UNSIGNED NOT NULL,
  `sort_order` smallint UNSIGNED NOT NULL DEFAULT '0',
  `is_required` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `survey_tpl_question_unique` (`survey_template_id`,`survey_question_id`),
  KEY `survey_template_question_survey_question_id_foreign` (`survey_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `survey_template_question`
--

INSERT INTO `survey_template_question` (`id`, `survey_template_id`, `survey_question_id`, `sort_order`, `is_required`) VALUES
(1, 1, 1, 1, 1);

-- --------------------------------------------------------

--
-- Table structure for table `template_replies`
--

CREATE TABLE IF NOT EXISTS `template_replies` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `content` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` enum('initial','follow_up','completion','general') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'general',
  `is_global` tinyint(1) NOT NULL DEFAULT '0',
  `attachments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `status_change` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `template_replies_is_global_is_active_index` (`is_global`,`is_active`),
  KEY `template_replies_service_category_id_is_active_index` (`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `template_replies`
--

INSERT INTO `template_replies` (`id`, `name`, `content`, `category`, `is_global`, `attachments`, `status_change`, `is_active`, `sort_order`, `created_at`, `updated_at`) VALUES
(1, 'Work In Progress', 'We are working on this issue.', 'general', 1, NULL, '2', 1, 1, '2026-05-23 00:27:03', '2026-06-18 12:25:18'),
(2, 'Technician Assigned', 'A technician has been assigned.', 'general', 1, NULL, 'in_progress', 0, 2, '2026-05-23 00:27:03', '2026-05-24 18:32:08'),
(3, 'Technician En Route', 'The technician is on the way.', 'general', 1, NULL, 'in_progress', 0, 3, '2026-05-23 00:27:03', '2026-05-24 18:32:11'),
(4, 'Assessment Complete', 'The issue was checked and work is in progress.', 'general', 1, NULL, 'in_progress', 0, 4, '2026-05-23 00:27:03', '2026-05-24 18:32:18'),
(5, 'Spare Parts Required', 'We are waiting for spare parts.', 'initial', 0, NULL, 'on_hold', 1, 10, '2026-05-23 00:27:03', '2026-05-24 18:32:43'),
(6, 'Waiting for External Vendor', 'We are waiting for the vendor response.', 'general', 1, NULL, 'on_hold', 0, 11, '2026-05-23 00:27:03', '2026-05-24 18:32:56'),
(7, 'Pending Approval', 'This request is waiting for approval.', 'general', 1, NULL, 'on_hold', 0, 12, '2026-05-23 00:27:03', '2026-05-24 18:33:03'),
(8, 'Awaiting Customer Response', 'We are waiting for your reply.', 'general', 1, NULL, NULL, 1, 13, '2026-05-23 00:27:03', '2026-05-24 18:33:29'),
(9, 'Issue Resolved', 'The issue has been resolved.', 'general', 1, NULL, 'resolved', 0, 20, '2026-05-23 00:27:03', '2026-05-24 18:34:44'),
(10, 'Repair Completed', 'The repair has been completed.', 'general', 1, NULL, 'resolved', 0, 21, '2026-05-23 00:27:03', '2026-05-24 18:33:47'),
(11, 'Service Completed', 'The service has been completed.', 'general', 1, NULL, 'resolved', 1, 22, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(12, 'Duplicate Ticket Closed', 'This ticket was closed as duplicate.', 'general', 1, NULL, 'closed', 0, 30, '2026-05-23 00:27:03', '2026-05-24 18:34:32'),
(13, 'Issue Resolved - Closed', 'This ticket was resolved and closed.', 'general', 1, NULL, 'closed', 0, 31, '2026-05-23 00:27:03', '2026-05-24 18:34:27'),
(14, 'No Response - Auto Closed', 'This ticket was closed due to no response.', 'general', 1, NULL, 'closed', 0, 32, '2026-05-23 00:27:03', '2026-05-24 18:34:23'),
(15, 'Request Cancelled', 'This request was cancelled.', 'general', 1, NULL, 'closed', 1, 33, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(16, 'Out of Scope', 'This request is out of scope.', 'general', 1, NULL, 'closed', 0, 34, '2026-05-23 00:27:03', '2026-05-24 18:34:02'),
(17, 'Ticket Assigned', 'This ticket has been assigned.', 'general', 1, NULL, 'assigned', 0, 40, '2026-05-23 00:27:03', '2026-05-24 18:34:00'),
(18, 'Follow-up Required', 'A follow-up is needed.', 'general', 1, NULL, NULL, 0, 50, '2026-05-23 00:27:03', '2026-05-24 18:33:58'),
(19, 'Customer Notified', 'The customer has been notified.', 'general', 1, NULL, NULL, 0, 51, '2026-05-23 00:27:03', '2026-05-24 18:33:56'),
(20, 'Quality Check Passed', 'The quality check was completed.', 'general', 1, NULL, NULL, 0, 52, '2026-05-23 00:27:03', '2026-05-24 18:33:55');

-- --------------------------------------------------------

--
-- Table structure for table `template_reply_department`
--

CREATE TABLE IF NOT EXISTS `template_reply_department` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `template_reply_id` bigint UNSIGNED NOT NULL,
  `department_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `template_reply_department_template_reply_id_department_id_unique` (`template_reply_id`,`department_id`),
  KEY `template_reply_department_department_id_foreign` (`department_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `template_reply_department`
--

INSERT INTO `template_reply_department` (`id`, `template_reply_id`, `department_id`, `created_at`, `updated_at`) VALUES
(1, 5, 1, '2026-05-24 18:32:43', '2026-05-24 18:32:43');

-- --------------------------------------------------------

--
-- Table structure for table `tickets`
--

CREATE TABLE IF NOT EXISTS `tickets` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `site_id` bigint UNSIGNED NOT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `service_item_id` bigint UNSIGNED DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `location` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `requester_id` bigint UNSIGNED NOT NULL,
  `is_guest_ticket` tinyint(1) NOT NULL DEFAULT '0',
  `origin` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'staff_panel',
  `technician_id` bigint UNSIGNED DEFAULT NULL,
  `status` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `priority` tinyint UNSIGNED NOT NULL DEFAULT '2',
  `title` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `opened_at` timestamp NULL DEFAULT NULL,
  `assigned_at` timestamp NULL DEFAULT NULL,
  `closed_at` timestamp NULL DEFAULT NULL,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tickets_code_unique` (`code`),
  KEY `tickets_unit_id_foreign` (`unit_id`),
  KEY `tickets_site_id_status_index` (`site_id`),
  KEY `tickets_requester_id_index` (`requester_id`),
  KEY `tickets_technician_id_index` (`technician_id`),
  KEY `tickets_service_item_id_foreign` (`service_item_id`),
  KEY `tickets_zone_id_status_index` (`zone_id`),
  KEY `tickets_origin_index` (`origin`),
  KEY `fk_tickets_department_id` (`department_id`),
  KEY `idx_tickets_zone_status_priority` (`zone_id`,`status`,`priority`,`created_at`),
  KEY `idx_tickets_department_status` (`department_id`,`status`,`created_at`),
  KEY `idx_tickets_requester_status` (`requester_id`,`status`,`created_at`),
  KEY `idx_tickets_unit_status` (`unit_id`,`status`,`created_at`),
  KEY `idx_tickets_sla_due` (`status`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tickets`
--

INSERT INTO `tickets` (`id`, `code`, `site_id`, `zone_id`, `service_item_id`, `department_id`, `unit_id`, `location`, `requester_id`, `is_guest_ticket`, `origin`, `technician_id`, `status`, `priority`, `title`, `description`, `opened_at`, `assigned_at`, `closed_at`, `meta`, `created_at`, `updated_at`) VALUES
(1, 'TKT-20260523-1631', 1, 1, 1, 1, 1, NULL, 2, 0, 'staff_panel', NULL, 1, 2, 'Request: AC Repair', 'Service: AC Repair\nDetails:\n—', '2026-05-23 10:14:54', NULL, NULL, '{\"due_date\": null, \"notify_requester\": true, \"visible_in_portal\": false}', '2026-05-23 10:14:54', '2026-05-23 10:14:54'),
(2, 'TKT-20260524-52MI', 1, 1, 8, 1, 1, '101', 1, 1, 'guest_web', NULL, 12, 3, 'Request: Door/Window Repair', 'ddddddddddddd', '2026-05-24 18:35:01', NULL, '2026-05-26 18:25:03', NULL, '2026-05-24 18:35:01', '2026-05-26 18:25:03'),
(3, 'TKT-20260526-XRBD', 1, 1, 1, 1, 5, '105', 2, 1, 'guest_web', NULL, 1, 2, 'Request: AC Repair', 'issue in AC', '2026-05-26 15:12:00', NULL, NULL, NULL, '2026-05-26 15:12:00', '2026-05-26 15:12:00'),
(4, 'TKT-20260526-6ZV8', 1, 1, 1, 1, 1, NULL, 2, 0, 'staff_panel', NULL, 1, 2, 'Request: AC Repair', 'Service: AC Repair\nDetails:\n—', '2026-05-26 17:19:49', NULL, NULL, '{\"notify_requester\":true,\"visible_in_portal\":false,\"due_date\":null}', '2026-05-26 17:19:49', '2026-05-26 17:19:49'),
(5, 'TKT-20260526-GOWN', 1, 1, 3, 1, 1, NULL, 2, 0, 'staff_panel', NULL, 1, 3, 'Request: Plumbing Repair', 'Service: Plumbing Repair\nDetails:\n—', '2026-05-26 18:13:45', NULL, NULL, '{\"notify_requester\":true,\"visible_in_portal\":false,\"due_date\":null}', '2026-05-26 18:13:45', '2026-05-26 18:13:45'),
(6, 'TKT-20260526-AUMX', 1, 1, 8, 1, 1, NULL, 2, 0, 'staff_panel', NULL, 1, 1, 'Request: Door/Window Repair', 'Service: Door/Window Repair\nDetails:\n—', '2026-05-26 18:37:50', NULL, NULL, '{\"notify_requester\":true,\"visible_in_portal\":false,\"due_date\":null}', '2026-05-26 18:37:50', '2026-05-26 18:37:50'),
(7, 'TKT-20260526-UAOL', 1, 1, 21, 3, 1, NULL, 2, 0, 'staff_panel', NULL, 1, 2, 'Request: Lost Key', 'Service: Lost Key\nDetails:\n—', '2026-05-26 18:40:40', NULL, NULL, '{\"notify_requester\":true,\"visible_in_portal\":false,\"due_date\":null}', '2026-05-26 18:40:40', '2026-05-26 18:40:40'),
(8, 'TKT-20260526-CEDQ', 1, 1, 1, 1, 1, NULL, 2, 0, 'staff_panel', NULL, 1, 2, 'Request: AC Repair', 'Service: AC Repair\nDetails:\n—', '2026-05-26 18:41:18', NULL, NULL, '{\"notify_requester\":true,\"visible_in_portal\":false,\"due_date\":null}', '2026-05-26 18:41:18', '2026-05-26 18:41:18'),
(9, 'TKT-20260529-O9BX', 1, 1, 1, 1, 1, '101', 1, 1, 'guest_web', NULL, 2, 3, 'Request: AC Repair', 'ffgfgfgfhgfhfghgfh', '2026-05-29 11:16:13', NULL, NULL, NULL, '2026-05-29 11:16:14', '2026-06-18 09:08:39'),
(10, 'TKT-20260603-LVBU', 1, 1, 5, 1, 1, '101', 3, 1, 'guest_web', NULL, 2, 3, 'Request: Electrical Fault', 'rfgfdfdhfhfdh', '2026-06-03 07:38:01', NULL, NULL, NULL, '2026-06-03 07:38:01', '2026-06-03 07:42:29'),
(11, 'TKT-20260605-Y7ZJ', 1, 1, 1, 1, 2, '102', 1, 1, 'guest_web', NULL, 1, 2, 'Request: AC Repair', 'cdffffffffffffffffffffff', '2026-06-05 18:39:35', NULL, NULL, NULL, '2026-06-05 18:39:36', '2026-06-05 18:39:36'),
(12, 'TKT-20260606-F2G6', 1, 1, 4, 1, 2, '102', 1, 1, 'guest_web', NULL, 1, 3, 'Request: Water Leak', 'Water fixed', '2026-06-06 01:39:10', NULL, NULL, NULL, '2026-06-06 01:39:10', '2026-06-06 01:39:10'),
(13, 'TKT-20260606-ID8J', 1, 1, 8, 1, 2, '102', 5, 1, 'guest_qr', NULL, 11, 3, 'Request: Door/Window Repair', 'I can’t open the door ', '2026-06-06 01:45:44', NULL, NULL, NULL, '2026-06-06 01:45:44', '2026-06-19 13:02:38'),
(14, 'TKT-20260606-DOIO', 1, 1, NULL, NULL, 3, NULL, 2, 0, 'staff_panel', NULL, 2, 2, 'house keeping', 'clean room', '2026-06-06 02:43:15', NULL, NULL, '{\"notify_requester\":true,\"visible_in_portal\":false,\"due_date\":\"2026-06-07\"}', '2026-06-06 02:43:15', '2026-06-06 02:43:48'),
(15, 'TKT-20260618-IU2A', 1, 1, 1, 1, 1, NULL, 2, 0, 'staff_panel', NULL, 12, 2, 'Request: AC Repair', 'Service: AC Repair\nDetails:\n—test', '2026-06-18 09:10:10', NULL, '2026-06-18 09:11:09', '{\"notify_requester\":true,\"visible_in_portal\":false,\"due_date\":null}', '2026-06-18 09:10:10', '2026-06-18 09:11:09'),
(16, 'TKT-20260618-MW3F', 1, 1, 1, 1, 1, NULL, 2, 0, 'staff_panel', NULL, 12, 1, 'Request: AC Repair', 'testبيلبيل بيل بيل يبل يل يب ', '2026-06-18 11:16:04', NULL, '2026-06-18 11:16:20', '{\"notify_requester\":true,\"visible_in_portal\":false,\"due_date\":null}', '2026-06-18 11:16:04', '2026-06-18 11:16:20'),
(17, 'TKT-20260618-PKG7', 1, 1, 1, 1, NULL, 'في الشارع', 2, 0, 'staff_panel', NULL, 1, 1, 'Request: AC Repair', '#TKT-20260618-MW3F dds gds gdf fdg ', '2026-06-18 11:20:02', NULL, NULL, '{\"notify_requester\":false,\"visible_in_portal\":false,\"due_date\":null}', '2026-06-18 11:20:02', '2026-06-18 11:20:02');

-- --------------------------------------------------------

--
-- Table structure for table `tickets_archive`
--

CREATE TABLE IF NOT EXISTS `tickets_archive` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `site_id` bigint UNSIGNED NOT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `service_item_id` bigint UNSIGNED DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `unit_id` bigint UNSIGNED DEFAULT NULL,
  `location` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `requester_id` bigint UNSIGNED NOT NULL,
  `is_guest_ticket` tinyint(1) NOT NULL DEFAULT '0',
  `origin` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'staff_panel',
  `technician_id` bigint UNSIGNED DEFAULT NULL,
  `status` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `priority` tinyint UNSIGNED NOT NULL DEFAULT '2',
  `title` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `opened_at` timestamp NULL DEFAULT NULL,
  `assigned_at` timestamp NULL DEFAULT NULL,
  `closed_at` timestamp NULL DEFAULT NULL,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `archived_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tickets_code_unique` (`code`),
  KEY `tickets_unit_id_foreign` (`unit_id`),
  KEY `tickets_site_id_status_index` (`site_id`),
  KEY `tickets_requester_id_index` (`requester_id`),
  KEY `tickets_technician_id_index` (`technician_id`),
  KEY `tickets_service_item_id_foreign` (`service_item_id`),
  KEY `tickets_zone_id_status_index` (`zone_id`),
  KEY `tickets_origin_index` (`origin`),
  KEY `fk_tickets_department_id` (`department_id`),
  KEY `idx_tickets_zone_status_priority` (`zone_id`,`status`,`priority`,`created_at`),
  KEY `idx_tickets_department_status` (`department_id`,`status`,`created_at`),
  KEY `idx_tickets_requester_status` (`requester_id`,`status`,`created_at`),
  KEY `idx_tickets_unit_status` (`unit_id`,`status`,`created_at`),
  KEY `idx_tickets_sla_due` (`status`,`created_at`),
  KEY `idx_archived_at` (`archived_at`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `ticket_field_history`
--

CREATE TABLE IF NOT EXISTS `ticket_field_history` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint UNSIGNED NOT NULL,
  `field` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `old_value` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `new_value` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `changed_by` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `ticket_field_history_changed_by_foreign` (`changed_by`),
  KEY `ticket_field_history_ticket_id_created_at_index` (`ticket_id`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `ticket_files`
--

CREATE TABLE IF NOT EXISTS `ticket_files` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint UNSIGNED NOT NULL,
  `attachment_id` bigint UNSIGNED DEFAULT NULL,
  `file_path` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `original_name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `mime_type` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `size` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_files_attachment_id_foreign` (`attachment_id`),
  KEY `ticket_files_ticket_id_index` (`ticket_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `ticket_items`
--

CREATE TABLE IF NOT EXISTS `ticket_items` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `code` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `icon` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `color` varchar(7) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `priority` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'medium',
  `sla_minutes` int NOT NULL DEFAULT '60',
  `default_template_subject` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `template_body` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `template_body_ar` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `sort_order` int NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `is_visible_to_guest` tinyint NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_items_code_unique` (`code`),
  KEY `ticket_items_zone_id_foreign` (`zone_id`),
  KEY `fk_ticket_items_department_id` (`department_id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `ticket_items`
--

INSERT INTO `ticket_items` (`id`, `department_id`, `zone_id`, `name`, `name_ar`, `code`, `description`, `icon`, `color`, `priority`, `sla_minutes`, `default_template_subject`, `template_body`, `template_body_ar`, `sort_order`, `active`, `is_visible_to_guest`, `created_at`, `updated_at`) VALUES
(1, 1, NULL, 'AC Repair', 'إصلاح تكييف', 'MNT-AC', NULL, 'fas fa-snowflake', '#4f46e5', '1', 60, NULL, 'test', NULL, 1, 1, 1, '2026-05-23 00:27:02', '2026-06-18 10:18:50'),
(3, 1, NULL, 'Plumbing Repair', 'إصلاح سباكة', 'MNT-PLB', NULL, 'fas fa-faucet', NULL, '3', 60, NULL, NULL, NULL, 3, 1, 1, '2026-05-23 00:27:02', '2026-05-24 18:31:00'),
(4, 1, NULL, 'Water Leak', 'تسريب مياه', 'MNT-LEAK', NULL, 'fas fa-droplet', NULL, '3', 60, NULL, NULL, NULL, 4, 1, 1, '2026-05-23 00:27:02', '2026-06-06 02:44:08'),
(5, 1, NULL, 'Electrical Fault', 'أعطال كهربائية', 'MNT-ELE', NULL, 'fas fa-bolt', NULL, '3', 60, NULL, NULL, NULL, 5, 1, 1, '2026-05-23 00:27:02', '2026-05-24 18:31:08'),
(6, 1, NULL, 'Light Fixture', 'إصلاح إضاءة', 'MNT-LIGHT', NULL, 'fas fa-lightbulb', NULL, '1', 60, NULL, NULL, NULL, 6, 1, 1, '2026-05-23 00:27:02', '2026-05-24 18:31:10'),
(7, 1, NULL, 'Appliance Repair', 'إصلاح أجهزة', 'MNT-APP', NULL, 'fas fa-tools', NULL, '2', 60, NULL, NULL, NULL, 7, 1, 0, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(8, 1, NULL, 'Door/Window Repair', 'إصلاح أبواب/نوافذ', 'MNT-DR', NULL, 'fas fa-door-open', NULL, '1', 60, NULL, NULL, NULL, 8, 1, 1, '2026-05-23 00:27:02', '2026-05-24 18:31:14'),
(9, 2, NULL, 'Deep Cleaning', 'تنظيف عميق', 'HKP-DCL', NULL, 'fas fa-soap', NULL, '1', 60, NULL, NULL, NULL, 9, 1, 0, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(10, 2, NULL, 'Urgent Cleaning', 'تنظيف مستعجل', 'HKP-UCL', NULL, 'fas fa-broom', NULL, '3', 60, NULL, NULL, NULL, 10, 1, 0, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(11, 2, NULL, 'Laundry Service', 'مغسلة ملابس', 'HKP-LND', NULL, 'fas fa-shirt', NULL, '1', 60, NULL, NULL, NULL, 11, 1, 0, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(12, 2, NULL, 'Carpet Cleaning', 'تنظيف سجاد', 'HKP-CARP', NULL, 'fas fa-brush', NULL, '2', 60, NULL, NULL, NULL, 12, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(13, 2, NULL, 'Window Cleaning', 'تنظيف نوافذ', 'HKP-WIN', NULL, 'fas fa-spray-can-sparkles', NULL, '1', 60, NULL, NULL, NULL, 13, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(14, 2, NULL, 'Pest Control', 'مكافحة حشرات', 'HKP-PEST', NULL, 'fas fa-bug', NULL, '3', 60, NULL, NULL, NULL, 14, 1, 1, '2026-05-23 00:27:03', '2026-05-24 18:31:31'),
(15, 5, NULL, 'HVAC Maintenance', 'صيانة تكييف مركزي', 'ENG-HVAC', NULL, 'fas fa-wind', NULL, '2', 60, NULL, NULL, NULL, 15, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(16, 5, NULL, 'Generator Check', 'فحص مولد كهربائي', 'ENG-GEN', NULL, 'fas fa-plug', NULL, '2', 60, NULL, NULL, NULL, 16, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(17, 5, NULL, 'Elevator Issue', 'مشكلة مصعد', 'ENG-ELEV', NULL, 'fas fa-building', NULL, '3', 60, NULL, NULL, NULL, 17, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(18, 5, NULL, 'Fire Safety Check', 'فحص سلامة حريق', 'ENG-FIRE', NULL, 'fas fa-fire-extinguisher', NULL, '3', 60, NULL, NULL, NULL, 18, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(19, 5, NULL, 'Pump Maintenance', 'صيانة مضخات', 'ENG-PUMP', NULL, 'fas fa-gauge-high', NULL, '2', 60, NULL, NULL, NULL, 19, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(20, 3, NULL, 'Access Issue', 'مشكلة دخول', 'SEC-ACC', NULL, 'fas fa-id-card', NULL, '3', 60, NULL, NULL, NULL, 20, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(21, 3, NULL, 'Lost Key', 'مفتاح مفقود', 'SEC-KEY', NULL, 'fas fa-key', NULL, '2', 60, NULL, NULL, NULL, 21, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(22, 3, NULL, 'Lock Change', 'تغيير قفل', 'SEC-LOCK', NULL, 'fas fa-lock', NULL, '2', 60, NULL, NULL, NULL, 22, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(23, 3, NULL, 'CCTV Issue', 'مشكلة كاميرات', 'SEC-CCTV', NULL, 'fas fa-video', NULL, '2', 60, NULL, NULL, NULL, 23, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(24, 3, NULL, 'Security Patrol', 'دورية أمنية', 'SEC-PATROL', NULL, 'fas fa-user-shield', NULL, '1', 60, NULL, NULL, NULL, 24, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(25, 4, NULL, 'Check-in Issue', 'مشكلة تسجيل دخول', 'FDK-CHK', NULL, 'fas fa-right-to-bracket', NULL, '3', 60, NULL, NULL, NULL, 25, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(26, 4, NULL, 'Check-out Issue', 'مشكلة تسجيل خروج', 'FDK-OUT', NULL, 'fas fa-right-from-bracket', NULL, '3', 60, NULL, NULL, NULL, 26, 1, 0, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(27, 4, NULL, 'Information Request', 'طلب معلومات', 'FDK-INF', NULL, 'fas fa-circle-info', NULL, '1', 60, NULL, NULL, NULL, 27, 1, 1, '2026-05-23 00:27:03', '2026-05-24 18:31:43'),
(28, 4, NULL, 'Complaint', 'شكوى', 'FDK-COMP', NULL, 'fas fa-comment-dots', NULL, '3', 60, NULL, NULL, NULL, 28, 1, 1, '2026-05-23 00:27:03', '2026-05-24 18:31:42'),
(29, 4, NULL, 'Lost & Found', 'مفقودات', 'FDK-LOST', NULL, 'fas fa-box-open', NULL, '2', 60, NULL, NULL, NULL, 29, 1, 1, '2026-05-23 00:27:03', '2026-05-24 18:31:41');

-- --------------------------------------------------------

--
-- Table structure for table `ticket_replies`
--

CREATE TABLE IF NOT EXISTS `ticket_replies` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `contact_id` bigint UNSIGNED DEFAULT NULL,
  `content` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `message` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `attachments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `status_before` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `status_after` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `template_id` bigint UNSIGNED DEFAULT NULL,
  `read` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_replies_template_id_foreign` (`template_id`),
  KEY `ticket_replies_ticket_id_created_at_index` (`ticket_id`,`created_at`),
  KEY `ticket_replies_user_id_index` (`user_id`),
  KEY `ticket_replies_contact_id_foreign` (`contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ticket_replies`
--

INSERT INTO `ticket_replies` (`id`, `ticket_id`, `user_id`, `contact_id`, `content`, `message`, `attachments`, `status_before`, `status_after`, `template_id`, `read`, `created_at`, `updated_at`) VALUES
(1, 1, 2, NULL, 'We are waiting for your reply.', 'We are waiting for your reply.', NULL, 'new', NULL, 8, 0, '2026-05-24 18:46:34', '2026-05-24 18:46:34'),
(2, 4, 2, NULL, 'We are working on this issue.', 'We are working on this issue.', NULL, '1', NULL, 1, 0, '2026-05-26 17:19:54', '2026-05-26 17:19:54'),
(3, 4, 2, NULL, 'We are waiting for spare parts.', 'We are waiting for spare parts.', NULL, '1', NULL, 5, 0, '2026-05-26 17:19:58', '2026-05-26 17:19:58'),
(4, 2, 2, NULL, 'We are working on this issue.', 'We are working on this issue.', NULL, '1', NULL, 1, 0, '2026-05-26 18:12:57', '2026-05-26 18:12:57'),
(5, 2, 2, NULL, 'We are working on this issue.', 'We are working on this issue.', NULL, '1', '2', 1, 0, '2026-05-26 18:24:55', '2026-05-26 18:24:55'),
(6, 2, 2, NULL, 'This request was cancelled.', 'This request was cancelled.', NULL, '2', '12', 15, 0, '2026-05-26 18:25:03', '2026-05-26 18:25:03'),
(7, 10, 2, NULL, 'We are working on this issue.', 'We are working on this issue.', NULL, '1', '2', 1, 0, '2026-06-03 07:42:29', '2026-06-03 07:42:29'),
(8, 14, 2, NULL, 'We are working on this issue.', 'We are working on this issue.', NULL, '1', '2', 1, 0, '2026-06-06 02:43:48', '2026-06-06 02:43:48'),
(9, 9, 2, NULL, 'We are working on this issue.', 'We are working on this issue.', NULL, '1', '2', 1, 0, '2026-06-18 09:08:39', '2026-06-18 09:08:39'),
(10, 15, 2, NULL, 'We are working on this issue.', 'We are working on this issue.', NULL, '1', '2', 1, 0, '2026-06-18 09:10:33', '2026-06-18 09:10:33'),
(11, 15, 2, NULL, 'This request was cancelled.', 'This request was cancelled.', NULL, '2', '12', 15, 0, '2026-06-18 09:11:09', '2026-06-18 09:11:09'),
(12, 16, 2, NULL, 'This request was cancelled.', 'This request was cancelled.', NULL, '1', '12', 15, 0, '2026-06-18 11:16:20', '2026-06-18 11:16:20'),
(13, 13, NULL, 5, 'This request has been completed. Thank you!', NULL, NULL, NULL, NULL, NULL, 0, '2026-06-19 13:02:38', '2026-06-19 13:02:38');

-- --------------------------------------------------------

--
-- Table structure for table `ticket_status_history`
--

CREATE TABLE IF NOT EXISTS `ticket_status_history` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `ticket_id` bigint UNSIGNED NOT NULL,
  `old_status` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `new_status` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `changed_by` bigint UNSIGNED DEFAULT NULL,
  `note` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `ticket_status_history_changed_by_foreign` (`changed_by`),
  KEY `ticket_status_history_ticket_id_created_at_index` (`ticket_id`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `ticket_status_history`
--

INSERT INTO `ticket_status_history` (`id`, `ticket_id`, `old_status`, `new_status`, `changed_by`, `note`, `created_at`) VALUES
(1, 1, NULL, 'new', 2, 'Ticket created', '2026-05-23 10:14:54'),
(2, 2, NULL, 'new', 1, 'Ticket created', '2026-05-24 18:35:01'),
(3, 2, 'new', 'new', NULL, 'auto_escalated|Low → High', '2026-05-24 20:25:55'),
(4, 3, NULL, 'new', 2, 'Ticket created', '2026-05-26 15:12:00'),
(5, 4, NULL, '1', 2, 'Ticket created', '2026-05-26 17:19:49'),
(6, 5, NULL, '1', 2, 'Ticket created', '2026-05-26 18:13:45'),
(7, 2, '1', '2', 2, NULL, '2026-05-26 18:24:55'),
(8, 2, '2', '12', 2, NULL, '2026-05-26 18:25:03'),
(9, 6, NULL, '1', 2, 'Ticket created', '2026-05-26 18:37:50'),
(10, 7, NULL, '1', 2, 'Ticket created', '2026-05-26 18:40:40'),
(11, 8, NULL, '1', 2, 'Ticket created', '2026-05-26 18:41:18'),
(12, 9, NULL, '1', 1, 'Ticket created', '2026-05-29 11:16:14'),
(13, 10, NULL, '1', 3, 'Ticket created', '2026-06-03 07:38:01'),
(14, 10, '1', '2', 2, NULL, '2026-06-03 07:42:29'),
(15, 9, '1', '1', NULL, 'auto_escalated|Medium → High', '2026-06-04 17:07:39'),
(16, 11, NULL, '1', 1, 'Ticket created', '2026-06-05 18:39:36'),
(17, 12, NULL, '1', 1, 'Ticket created', '2026-06-05 22:39:10'),
(18, 13, NULL, '1', 5, 'Ticket created', '2026-06-05 22:45:44'),
(19, 14, NULL, '1', 2, 'Ticket created', '2026-06-05 23:43:15'),
(20, 14, '1', '2', 2, NULL, '2026-06-05 23:43:48'),
(21, 9, '1', '2', 2, NULL, '2026-06-18 09:08:39'),
(22, 15, NULL, '1', 2, 'Ticket created', '2026-06-18 09:10:10'),
(23, 15, '1', '2', 2, NULL, '2026-06-18 09:10:33'),
(24, 15, '2', '12', 2, NULL, '2026-06-18 09:11:09'),
(25, 16, NULL, '1', 2, 'Ticket created', '2026-06-18 11:16:04'),
(26, 16, '1', '12', 2, NULL, '2026-06-18 11:16:20'),
(27, 17, NULL, '1', 2, 'Ticket created', '2026-06-18 11:20:02'),
(28, 13, '1', '1', NULL, 'auto_escalated|Low → High', '2026-06-19 13:02:35'),
(29, 13, '1', '11', NULL, 'guest_resolved|Guest marked this request as done.', '2026-06-19 13:02:38');

-- --------------------------------------------------------

--
-- Table structure for table `transactions`
--

CREATE TABLE IF NOT EXISTS `transactions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `payment_id` bigint UNSIGNED NOT NULL,
  `type` tinyint UNSIGNED NOT NULL DEFAULT '1',
  `amount` decimal(10,2) NOT NULL,
  `reason` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transactions_payment_id_foreign` (`payment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `transactions`
--

INSERT INTO `transactions` (`id`, `payment_id`, `type`, `amount`, `reason`, `created_at`, `updated_at`) VALUES
(1, 2, 3, '40.00', 'Refund: Item refund (including proportional adjustments)', '2026-05-23 17:06:45', '2026-05-23 17:06:45'),
(2, 1, 3, '250.00', 'Refund', '2026-05-23 17:09:16', '2026-05-23 17:09:16'),
(3, 4, 3, '129.96', 'Refund', '2026-05-24 03:30:44', '2026-05-24 03:30:44'),
(4, 7, 3, '194.94', 'Refund', '2026-05-24 03:49:37', '2026-05-24 03:49:37'),
(5, 8, 3, '57.68', 'Refund: Item refund (including proportional adjustments)', '2026-05-24 03:50:07', '2026-05-24 03:50:07'),
(6, 10, 3, '77.17', 'Full order refund (including proportional adjustments)', '2026-05-24 05:00:37', '2026-05-24 05:00:37'),
(7, 11, 3, '194.94', 'Refund', '2026-05-24 05:01:15', '2026-05-24 05:01:15'),
(8, 12, 3, '454.86', 'Refund', '2026-05-24 05:09:31', '2026-05-24 05:09:31'),
(9, 13, 3, '57.68', 'Full order refund (including proportional adjustments)', '2026-05-24 05:12:13', '2026-05-24 05:12:13'),
(10, 14, 3, '194.94', 'Refund', '2026-05-24 05:12:28', '2026-05-24 05:12:28'),
(11, 15, 3, '64.18', 'Refund: Item refund (including proportional adjustments)', '2026-05-24 05:14:07', '2026-05-24 05:14:07'),
(12, 16, 3, '129.96', 'Refund', '2026-05-24 05:14:27', '2026-05-24 05:14:27'),
(13, 19, 3, '86.84', 'Refund: Item refund (including proportional adjustments)', '2026-05-24 21:48:27', '2026-05-24 21:48:27'),
(14, 27, 3, '324.90', 'Refund', '2026-06-06 03:06:50', '2026-06-06 03:06:50'),
(15, 35, 3, '30.00', 'Refund: Item refund', '2026-06-13 20:23:33', '2026-06-13 20:23:33'),
(16, 35, 3, '20.00', 'Refund: Item refund', '2026-06-13 20:24:36', '2026-06-13 20:24:36'),
(17, 35, 3, '85.00', 'Refund: Item refund', '2026-06-13 20:24:45', '2026-06-13 20:24:45'),
(18, 37, 3, '57.00', 'Full order refund', '2026-06-14 13:25:19', '2026-06-14 13:25:19'),
(19, 19, 3, '145.51', 'Refund: Item refund', '2026-06-15 11:37:55', '2026-06-15 11:37:55'),
(20, 19, 3, '91.75', 'Refund: Item refund', '2026-06-15 11:38:07', '2026-06-15 11:38:07'),
(21, 19, 3, '0.00', 'Refund: Item refund', '2026-06-15 11:38:13', '2026-06-15 11:38:13'),
(22, 23, 3, '194.94', 'Refund', '2026-06-18 14:03:00', '2026-06-18 14:03:00'),
(23, 49, 3, '214.00', 'Refund', '2026-06-18 16:16:52', '2026-06-18 16:16:52'),
(24, 51, 3, '385.00', 'Refund', '2026-06-18 16:21:51', '2026-06-18 16:21:51'),
(25, 53, 3, '481.81', 'Refund', '2026-06-18 16:37:24', '2026-06-18 16:37:24'),
(26, 53, 3, '481.81', 'Refund', '2026-06-18 16:37:33', '2026-06-18 16:37:33'),
(27, 54, 3, '120.45', 'Refund', '2026-06-18 16:39:40', '2026-06-18 16:39:40'),
(28, 57, 3, '22.15', 'Refund: Item refund', '2026-06-18 17:41:06', '2026-06-18 17:41:06'),
(29, 57, 3, '55.37', 'Refund: Item refund', '2026-06-18 17:41:19', '2026-06-18 17:41:19');

-- --------------------------------------------------------

--
-- Table structure for table `units`
--

CREATE TABLE IF NOT EXISTS `units` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `property_id` bigint UNSIGNED DEFAULT NULL,
  `number` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` tinyint NOT NULL,
  `type` tinyint NOT NULL,
  `level` tinyint NOT NULL,
  `area` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `units_property_id_foreign` (`property_id`)
) ENGINE=InnoDB AUTO_INCREMENT=121 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`id`, `property_id`, `number`, `status`, `type`, `level`, `area`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(2, 1, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(3, 1, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(4, 1, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(5, 1, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(6, 2, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(7, 2, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(8, 2, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(9, 2, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(10, 2, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(11, 3, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(12, 3, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(13, 3, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(14, 3, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(15, 3, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(16, 4, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(17, 4, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(18, 4, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(19, 4, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(20, 4, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(21, 5, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(22, 5, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(23, 5, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(24, 5, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(25, 5, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(26, 6, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(27, 6, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(28, 6, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(29, 6, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(30, 6, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(31, 7, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(32, 7, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(33, 7, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(34, 7, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(35, 7, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(36, 8, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(37, 8, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(38, 8, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(39, 8, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(40, 8, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(41, 9, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(42, 9, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(43, 9, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(44, 9, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(45, 9, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(46, 10, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(47, 10, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(48, 10, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(49, 10, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(50, 10, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(51, 11, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(52, 11, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(53, 11, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(54, 11, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(55, 11, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(56, 12, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(57, 12, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(58, 12, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(59, 12, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(60, 12, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(61, 13, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(62, 13, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(63, 13, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(64, 13, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(65, 13, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(66, 14, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(67, 14, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(68, 14, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(69, 14, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(70, 14, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(71, 15, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(72, 15, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(73, 15, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(74, 15, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(75, 15, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(76, 16, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(77, 16, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(78, 16, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(79, 16, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(80, 16, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(81, 17, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(82, 17, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(83, 17, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(84, 17, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(85, 17, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(86, 18, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(87, 18, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(88, 18, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(89, 18, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(90, 18, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(91, 19, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(92, 19, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(93, 19, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(94, 19, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(95, 19, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(96, 20, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(97, 20, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(98, 20, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(99, 20, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(100, 20, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(101, 21, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(102, 21, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(103, 21, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(104, 21, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(105, 21, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(106, 22, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(107, 22, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(108, 22, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(109, 22, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(110, 22, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(111, 23, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(112, 23, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(113, 23, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(114, 23, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(115, 23, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(116, 24, '101', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(117, 24, '102', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(118, 24, '103', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(119, 24, '104', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(120, 24, '105', 1, 1, 1, NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02');

-- --------------------------------------------------------

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

CREATE TABLE IF NOT EXISTS `users` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `two_factor_secret` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `two_factor_recovery_codes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `two_factor_confirmed_at` timestamp NULL DEFAULT NULL,
  `remember_token` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `locked` tinyint(1) NOT NULL DEFAULT '0',
  `phone` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `title` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `status` enum('0','1') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `profile_photo_path` varchar(2048) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  KEY `users_department_id_foreign` (`department_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `two_factor_secret`, `two_factor_recovery_codes`, `two_factor_confirmed_at`, `remember_token`, `locked`, `phone`, `title`, `department_id`, `status`, `profile_photo_path`, `created_at`, `updated_at`) VALUES
(1, 'Super Admin', 'superadmin@demo.com', '2026-05-23 00:27:03', '$2y$10$UPSvns3hvZFLUg/Oo/UvfujUFLSNVuFsUkXEdrzAaX/UVk5qy3z1a', NULL, NULL, NULL, NULL, 0, '012', NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-06-17 17:48:59'),
(2, 'Admin User', 'admin@demo.com', '2026-05-23 00:27:03', '$2y$10$3ZYwQ64NKHKx8.Mn/OdmC.vq2L8XLmMUI2a6MeY/hOiyytdVm0WUK', NULL, NULL, NULL, 'kSpuONvmFpjiRYdg8McMFZl3xtCA9VmPqUER5YLRZ3NeX7v95ufFmmXsJ8OD', 0, '111111111111', NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:29:16'),
(3, 'Service Agent', 'serviceagent@demo.com', '2026-05-23 00:27:03', '$2y$10$yV/D6gbi8lNSQFATWtg.QeQi4.F9FaiCJdfbIqGtObJPk/NbNxyfy', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(4, 'Cashier', 'cashier@demo.com', '2026-05-23 00:27:03', '$2y$10$gp9o50t1E9OVDfzLcyvpD.Nf1zmyOCKk0RZzeLNYGtG4O2oabWKQW', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(5, 'Supervisor Cashier', 'supervisor@demo.com', '2026-05-23 00:27:03', '$2y$10$4Cm.uA.JieAlmOpf8aIukehVJ6r/.tjDjXywtVEvWnjbGfpG/N4rG', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(6, 'Night Editor', 'nighteditor@demo.com', '2026-05-23 00:27:03', '$2y$10$s4t2ZBcfC9QQhN1Ltnp2suFvv3egJWsxD/CzPBHR0HPBZexsIdNrK', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(7, 'General Cashier', 'generalcashier@demo.com', '2026-05-23 00:27:03', '$2y$10$DSUkpSCG9dpUTEExhbrbPuzSmMRXvBC64cFgeqOI7Egu3DvAJgyQm', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(8, 'Finance Manager', 'finance@demo.com', '2026-05-23 00:27:03', '$2y$10$lkibYUU5rXMP7SU1VTawf.G1Xd7wGqjESlXqUaclSBYtQL9nUjRgW', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(9, 'Tickets Manager', 'tickets@demo.com', '2026-05-23 00:27:03', '$2y$10$cf6ahwYErC1omyxw1ZyoveLmgqlFkNIir5itkaGc52DOj1Aj5jAwe', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(10, 'Technician', 'tech@demo.com', '2026-05-23 00:27:03', '$2y$10$dyX10hfJfTI1/Q4.iByiM.bNvDfYvqew5jr09lIsrSlvn6qtdtkF.', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(11, 'Unit Manager', 'unitmanager@demo.com', '2026-05-23 00:27:03', '$2y$10$fbXb2sk1Ci8yYd5MzCpgberle2NZh9GTUJdFAluyFTRfbZMbZBtcC', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '1', NULL, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(12, 'Pyramids Cashier', 'cashier.pyramids@demo.com', NULL, '$2y$10$/XqB8F/dcIXApzTkfrxXye1YQHLwaQakaRA03DojIcySXJCkU/fZS', NULL, NULL, NULL, NULL, 0, '+201234567890', NULL, NULL, NULL, NULL, '2026-05-23 01:06:41', '2026-05-23 01:06:41'),
(13, 'Pyramids Supervisor', 'supervisor.pyramids@demo.com', NULL, '$2y$10$fvmL.QZPNokU1z7EXve0Xef6Xw4otmsNY0KMSw3akxglTayFgb0zW', NULL, NULL, NULL, NULL, 0, '+201234567891', NULL, NULL, NULL, NULL, '2026-05-23 01:06:41', '2026-05-23 01:06:41'),
(14, 'Hotel Cashier', 'cashier.hotel@demo.com', NULL, '$2y$10$NQNrF99LPX71eZKosNLwAe.Ia57aV6ey2jhrjEFOg5aPDe2hsZvPG', NULL, NULL, NULL, NULL, 0, '+201234567892', NULL, NULL, NULL, NULL, '2026-05-23 01:06:42', '2026-05-23 01:06:42'),
(15, 'Multi-Zone Cashier', 'cashier.multi@demo.com', NULL, '$2y$10$sgKn8LLr4ON47j3KVPBtLel0t9PAcT9XKB2gOa6OSINz4vBACQIwG', NULL, NULL, NULL, NULL, 0, '+201234567893', NULL, NULL, NULL, NULL, '2026-05-23 01:06:42', '2026-05-23 01:06:42');

-- --------------------------------------------------------

--
-- Table structure for table `user_areas`
--

CREATE TABLE IF NOT EXISTS `user_areas` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NOT NULL,
  `area_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_areas_user_id_area_id_unique` (`user_id`,`area_id`),
  KEY `user_areas_area_id_foreign` (`area_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_departments`
--

CREATE TABLE IF NOT EXISTS `user_departments` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NOT NULL,
  `department_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_departments_user_id_department_id_unique` (`user_id`,`department_id`),
  KEY `user_departments_department_id_foreign` (`department_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_permission_overrides`
--

CREATE TABLE IF NOT EXISTS `user_permission_overrides` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NOT NULL,
  `permission_id` bigint UNSIGNED NOT NULL,
  `type` enum('allow','deny') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `created_by` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_permission_overrides_user_id_permission_id_unique` (`user_id`,`permission_id`),
  KEY `user_permission_overrides_permission_id_foreign` (`permission_id`),
  KEY `user_permission_overrides_created_by_foreign` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_sites`
--

CREATE TABLE IF NOT EXISTS `user_sites` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NOT NULL,
  `site_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_sites_user_id_site_id_unique` (`user_id`,`site_id`),
  KEY `user_sites_site_id_foreign` (`site_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `user_sites`
--

INSERT INTO `user_sites` (`id`, `user_id`, `site_id`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '2026-06-17 17:48:59', '2026-06-17 17:48:59');

-- --------------------------------------------------------

--
-- Table structure for table `user_unit_scopes`
--

CREATE TABLE IF NOT EXISTS `user_unit_scopes` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NOT NULL,
  `scope_type` enum('area','site','zone','property') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `scope_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_unit_scopes_user_id_scope_type_scope_id_unique` (`user_id`,`scope_type`,`scope_id`),
  KEY `user_unit_scopes_scope_type_index` (`scope_type`),
  KEY `user_unit_scopes_scope_id_index` (`scope_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_zones`
--

CREATE TABLE IF NOT EXISTS `user_zones` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NOT NULL,
  `zone_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_zones_user_id_zone_id_unique` (`user_id`,`zone_id`),
  KEY `user_zones_zone_id_foreign` (`zone_id`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `user_zones`
--

INSERT INTO `user_zones` (`id`, `user_id`, `zone_id`, `created_at`, `updated_at`) VALUES
(1, 3, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(2, 3, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(3, 3, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(4, 3, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(5, 3, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(6, 3, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(7, 3, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(8, 3, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(9, 4, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(10, 4, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(11, 4, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(12, 4, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(13, 4, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(14, 4, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(15, 4, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(16, 4, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(17, 5, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(18, 5, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(19, 5, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(20, 5, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(21, 5, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(22, 5, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(23, 5, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(24, 5, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(25, 6, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(26, 6, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(27, 6, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(28, 6, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(29, 6, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(30, 6, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(31, 6, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(32, 6, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(33, 7, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(34, 7, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(35, 7, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(36, 7, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(37, 7, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(38, 7, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(39, 7, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(40, 7, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(41, 8, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(42, 8, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(43, 8, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(44, 8, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(45, 8, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(46, 8, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(47, 8, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(48, 8, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(49, 9, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(50, 9, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(51, 9, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(52, 9, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(53, 9, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(54, 9, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(55, 9, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(56, 9, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(57, 10, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(58, 10, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(59, 10, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(60, 10, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(61, 10, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(62, 10, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(63, 10, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(64, 10, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(65, 11, 1, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(66, 11, 2, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(67, 11, 3, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(68, 11, 4, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(69, 11, 5, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(70, 11, 6, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(71, 11, 7, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(72, 11, 8, '2026-05-23 00:27:03', '2026-05-23 00:27:03'),
(73, 2, 1, '2026-05-23 00:29:16', '2026-05-23 00:29:16'),
(74, 12, 1, '2026-05-23 01:06:41', '2026-05-23 01:06:41'),
(75, 13, 1, '2026-05-23 01:06:41', '2026-05-23 01:06:41'),
(76, 14, 2, '2026-05-23 01:06:42', '2026-05-23 01:06:42'),
(77, 15, 1, '2026-05-23 01:06:42', '2026-05-23 01:06:42'),
(78, 15, 2, '2026-05-23 01:06:42', '2026-05-23 01:06:42');

-- --------------------------------------------------------

--
-- Table structure for table `visitors`
--

CREATE TABLE IF NOT EXISTS `visitors` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `phone` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qr_code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `allowed_entries` int NOT NULL DEFAULT '1',
  `valid_from` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `valid_until` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `visitors_qr_code_unique` (`qr_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `visitor_entries`
--

CREATE TABLE IF NOT EXISTS `visitor_entries` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `visitor_id` bigint UNSIGNED NOT NULL,
  `gate_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `visitor_entries_visitor_id_foreign` (`visitor_id`),
  KEY `visitor_entries_gate_id_foreign` (`gate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `visitor_zones`
--

CREATE TABLE IF NOT EXISTS `visitor_zones` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `visitor_id` bigint UNSIGNED NOT NULL,
  `zone_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `visitor_zones_visitor_id_foreign` (`visitor_id`),
  KEY `idx_visitor_zones_zone_id` (`zone_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `zones`
--

CREATE TABLE IF NOT EXISTS `zones` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `site_id` bigint UNSIGNED DEFAULT NULL,
  `name` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name_ar` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `code` varchar(125) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `zones_code_unique` (`code`),
  KEY `zones_site_id_foreign` (`site_id`)
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `zones`
--

INSERT INTO `zones` (`id`, `site_id`, `name`, `name_ar`, `code`, `created_at`, `updated_at`) VALUES
(1, 1, 'Porto Sokhna - Pyramids', 'بورتو السخنة - ', 'PSK-PYR', '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(2, 1, 'Porto Sokhna - Hotel', 'بورتو السخنة - ', 'PSK-HOTEL', '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(3, 1, 'Porto Sokhna - Golf', 'بورتو السخنة - ', 'PSK-GOLF', '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(4, 2, 'Porto South Beach - Genwa', 'بورتو ساوث بيتش - ', 'PSB-GENWA', '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(5, 2, 'Porto South Beach - PVC Timeshare', 'بورتو ساوث بيتش - ', 'PSB-PVC', '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(6, 3, 'Porto Marina - Towers', 'بورتو مارينا - ', 'PMR-TOWERS', '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(7, 3, 'Porto Marina - Hotel', 'بورتو مارينا - ', 'PMR-HOTEL', '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(8, 3, 'Porto Marina - Golf', 'بورتو مارينا - ', 'PMR-GOLF', '2026-05-23 00:27:02', '2026-05-23 00:27:02');

-- --------------------------------------------------------

--
-- Table structure for table `zone_adjustments`
--

CREATE TABLE IF NOT EXISTS `zone_adjustments` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `adjustment_definition_id` bigint UNSIGNED NOT NULL,
  `zone_id` bigint UNSIGNED DEFAULT NULL,
  `value` decimal(10,4) NOT NULL,
  `is_percentage` tinyint(1) NOT 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 `zone_adjustments_adjustment_definition_id_foreign` (`adjustment_definition_id`),
  KEY `idx_zone_adjustments_zone_id` (`zone_id`)
) ENGINE=InnoDB AUTO_INCREMENT=84 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `zone_adjustments`
--

INSERT INTO `zone_adjustments` (`id`, `adjustment_definition_id`, `zone_id`, `value`, `is_percentage`, `is_active`, `created_at`, `updated_at`) VALUES
(51, 1, 1, '14.0000', 1, 1, '2026-06-13 12:58:06', '2026-06-13 12:58:06'),
(52, 2, 1, '5.0000', 0, 1, '2026-06-13 12:58:11', '2026-06-13 12:58:11'),
(53, 3, 1, '14.0000', 1, 1, '2026-06-13 12:58:22', '2026-06-13 12:58:22'),
(4, 4, 2, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(5, 5, 2, '5.0000', 0, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(6, 6, 2, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(7, 7, 3, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(8, 8, 3, '5.0000', 0, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(9, 9, 3, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(10, 10, 4, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(11, 11, 4, '10.0000', 0, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(12, 12, 4, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(13, 13, 5, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(14, 14, 5, '10.0000', 0, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(15, 15, 5, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(16, 16, 6, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(17, 17, 6, '15.0000', 0, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(18, 18, 6, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(19, 19, 7, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(20, 20, 7, '15.0000', 0, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(21, 21, 7, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(22, 22, 8, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(23, 23, 8, '15.0000', 0, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(24, 24, 8, '14.0000', 1, 1, '2026-05-23 00:27:06', '2026-05-23 00:27:06'),
(54, 43, 1, '0.0000', 1, 1, '2026-06-13 13:00:30', '2026-06-13 13:00:30');

-- --------------------------------------------------------

--
-- Table structure for table `zone_business_dates`
--

CREATE TABLE IF NOT EXISTS `zone_business_dates` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `zone_id` bigint UNSIGNED NOT NULL,
  `business_date` date NOT NULL,
  `last_night_run_at` timestamp NULL DEFAULT NULL,
  `last_night_run_by` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `zone_business_dates_zone_id_unique` (`zone_id`),
  KEY `zone_business_dates_last_night_run_by_foreign` (`last_night_run_by`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `zone_business_dates`
--

INSERT INTO `zone_business_dates` (`id`, `zone_id`, `business_date`, `last_night_run_at`, `last_night_run_by`, `created_at`, `updated_at`) VALUES
(1, 1, '2026-05-31', '2026-06-18 14:04:07', 2, '2026-05-23 00:27:02', '2026-06-18 14:04:07'),
(2, 2, '2026-05-23', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(3, 3, '2026-05-23', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(4, 4, '2026-05-23', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(5, 5, '2026-05-23', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(6, 6, '2026-05-23', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(7, 7, '2026-05-23', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02'),
(8, 8, '2026-05-23', NULL, NULL, '2026-05-23 00:27:02', '2026-05-23 00:27:02');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `guest_survey_instances`
--
ALTER TABLE `guest_survey_instances`
  ADD CONSTRAINT `guest_survey_instances_survey_template_id_foreign` FOREIGN KEY (`survey_template_id`) REFERENCES `survey_templates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `guest_survey_responses`
--
ALTER TABLE `guest_survey_responses`
  ADD CONSTRAINT `guest_survey_responses_guest_survey_instance_id_foreign` FOREIGN KEY (`guest_survey_instance_id`) REFERENCES `guest_survey_instances` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `guest_survey_responses_survey_question_id_foreign` FOREIGN KEY (`survey_question_id`) REFERENCES `survey_questions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pms_rate_plans`
--
ALTER TABLE `pms_rate_plans`
  ADD CONSTRAINT `pms_rate_plans_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `pms_rate_plans_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `pms_rate_plans_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `pms_reservations`
--
ALTER TABLE `pms_reservations`
  ADD CONSTRAINT `pms_reservations_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `pms_reservations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `pms_reservations_rate_plan_id_foreign` FOREIGN KEY (`rate_plan_id`) REFERENCES `pms_rate_plans` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `pms_reservations_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `pms_reservations_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `pms_reservations_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pms_reservation_action_logs`
--
ALTER TABLE `pms_reservation_action_logs`
  ADD CONSTRAINT `pms_reservation_action_logs_reservation_id_foreign` FOREIGN KEY (`reservation_id`) REFERENCES `pms_reservations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `pms_reservation_action_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `survey_template_question`
--
ALTER TABLE `survey_template_question`
  ADD CONSTRAINT `survey_template_question_survey_question_id_foreign` FOREIGN KEY (`survey_question_id`) REFERENCES `survey_questions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `survey_template_question_survey_template_id_foreign` FOREIGN KEY (`survey_template_id`) REFERENCES `survey_templates` (`id`) ON DELETE CASCADE;
COMMIT;

