CREATE DATABASE laundry_app;
USE laundry_app;

START TRANSACTION;



--
-- Database: `laundry_app`
--

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

--
-- Table structure for table `cart`
--

CREATE TABLE `cart` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `service_id` int(11) NOT NULL,
  `quantity` int(11) NOT NULL DEFAULT 1,
  `selected_option` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cart`
--

INSERT INTO `cart` (`id`, `user_id`, `service_id`, `quantity`, `selected_option`, `created_at`, `updated_at`) VALUES
(592, 1, 4, 1, '124,120,112,115,121', '2025-11-04 17:51:56', '2025-11-04 17:51:56'),
(593, 1, 2, 5, '40,33,30,37', '2025-11-04 17:51:56', '2025-11-04 17:51:56'),
(596, 12, 4, 1, '124,120,111,115,122', '2025-11-04 17:54:45', '2025-11-04 17:54:45');

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

--
-- Table structure for table `contact_messages`
--

CREATE TABLE `contact_messages` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `subject` varchar(200) NOT NULL,
  `message` text NOT NULL,
  `status` enum('new','read','replied') DEFAULT 'new',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `contact_messages`
--

INSERT INTO `contact_messages` (`id`, `name`, `email`, `phone`, `subject`, `message`, `status`, `created_at`) VALUES
(1, 'John Smith', 'john@email.com', '0501111111', 'Service Inquiry', 'What are your working hours?', 'new', '2025-10-14 20:53:53'),
(2, 'Sarah Johnson', 'sarah@email.com', '0502222222', 'Complaint', 'My order was delayed by 2 hours', 'read', '2025-10-14 20:53:53'),
(3, 'Mike Wilson', 'mike@email.com', '0503333333', 'Praise', 'Excellent service, thank you!', 'replied', '2025-10-14 20:53:53'),
(4, 'Lisa Brown', 'lisa@email.com', '0504444444', 'Question', 'Do you offer pickup service?', 'new', '2025-10-14 20:53:53'),
(5, 'David Davis', 'david@email.com', '0505555555', 'Feedback', 'Very satisfied with the quality', 'replied', '2025-10-14 20:53:53');

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

--
-- Table structure for table `delivery_codes`
--

CREATE TABLE `delivery_codes` (
  `id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `code` varchar(6) NOT NULL,
  `used` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `delivery_codes`
--

INSERT INTO `delivery_codes` (`id`, `order_id`, `code`, `used`, `created_at`) VALUES
(20, 35, '552830', 1, '2025-10-29 14:41:34'),
(21, 34, '477383', 1, '2025-10-30 18:53:03');

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

--
-- Table structure for table `delivery_staff`
--

CREATE TABLE `delivery_staff` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `status` enum('available','busy','offline') DEFAULT 'available',
  `current_location` varchar(255) DEFAULT NULL,
  `total_deliveries` int(11) DEFAULT 0,
  `average_delivery_time` int(11) DEFAULT 0,
  `rating` decimal(3,2) DEFAULT 0.00,
  `last_login` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `delivery_staff`
--

INSERT INTO `delivery_staff` (`id`, `name`, `phone`, `email`, `password`, `status`, `current_location`, `total_deliveries`, `average_delivery_time`, `rating`, `last_login`, `created_at`) VALUES
(1, 'Test Delivery Staff', '0508765432', 'delivery@allura.com', '$2y$10$uEIzM8lJBsBFkb8srH7FmuM.bHRzvrwkeEi5/n63xDX0pbnKGVHoe', 'available', NULL, 7, 0, 0.00, '2025-10-30 18:52:58', '2025-10-14 20:53:52');

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

--
-- Table structure for table `expenses`
--

CREATE TABLE `expenses` (
  `id` int(11) NOT NULL,
  `category` enum('materials','salaries','fuel','utilities','maintenance','other') NOT NULL,
  `description` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `expense_date` date NOT NULL,
  `receipt_number` varchar(100) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `expenses`
--

INSERT INTO `expenses` (`id`, `category`, `description`, `amount`, `expense_date`, `receipt_number`, `notes`, `created_at`, `updated_at`) VALUES
(1, 'materials', 'Detergent and cleaning supplies', 450.00, '2024-01-15', 'REC-001', 'Monthly supply purchase', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(2, 'salaries', 'Staff salaries - January', 3500.00, '2024-01-31', 'SAL-001', 'Monthly payroll', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(3, 'fuel', 'Delivery vehicle fuel', 280.00, '2024-01-20', 'FUEL-001', 'Weekly fuel refill', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(4, 'utilities', 'Electricity bill', 320.00, '2024-01-25', 'ELEC-001', 'Monthly electricity', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(5, 'maintenance', 'Washing machine maintenance', 150.00, '2024-01-18', 'MAINT-001', 'Routine maintenance', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(6, 'materials', 'Fabric softener and starch', 180.00, '2024-01-22', 'REC-002', 'Additional supplies', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(7, 'fuel', 'Delivery vehicle fuel', 290.00, '2024-01-27', 'FUEL-002', 'Weekly fuel refill', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(8, 'other', 'Office supplies', 75.00, '2024-01-12', 'OFF-001', 'Stationery and forms', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(9, 'utilities', 'Water bill', 120.00, '2024-01-28', 'WATER-001', 'Monthly water usage', '2025-10-14 20:53:52', '2025-10-14 20:53:52'),
(10, 'maintenance', 'Dryer repair', 200.00, '2024-01-30', 'MAINT-002', 'Emergency repair', '2025-10-14 20:53:52', '2025-10-14 20:53:52');

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

--
-- Table structure for table `laundry_staff`
--

CREATE TABLE `laundry_staff` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `status` enum('active','inactive') DEFAULT 'active',
  `last_login` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `laundry_staff`
--

INSERT INTO `laundry_staff` (`id`, `name`, `phone`, `email`, `password`, `status`, `last_login`, `created_at`) VALUES
(1, 'Ahmed Al-Rashid', '0501234567', 'ahmed@allura.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'active', NULL, '2025-11-04 15:00:00'),
(2, 'iAz', '0543453184', 'skolr7780xx@gmail.com', '$2y$10$JotNDVxGB3WJ31N6ydBgDe9h5WfKydjzRLQHOgX2Njl8ZaW9BBv.O', 'active', '2025-10-30 18:52:12', '2025-10-27 23:10:00');

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

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

CREATE TABLE `notifications` (
  `id` int(11) NOT NULL,
  `title` varchar(200) NOT NULL,
  `message` text NOT NULL,
  `type` enum('info','warning','success','error') DEFAULT 'info',
  `is_read` tinyint(1) DEFAULT 0,
  `user_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `notifications` (`id`, `title`, `message`, `type`, `is_read`, `user_id`, `created_at`) VALUES
(34, 'Delivery Code', 'Your delivery code for order #35 is: 655464. Share this code with the delivery person.', 'info', 1, 12, '2025-10-29 14:41:28'),
(35, 'Delivery Code', 'Your delivery code for order #35 is: 552830. Share this code with the delivery person.', 'info', 1, 12, '2025-10-29 14:41:34'),
(36, 'Order Delivered!', 'Your order #35 has been delivered. Thank you!', 'success', 1, 12, '2025-10-29 14:41:42'),
(37, 'Order Picked Up', 'Your order #32 has been picked up by our delivery staff and processing has started. We will notify you when it\'s ready for delivery.', 'info', 1, 12, '2025-10-30 18:47:49'),
(38, 'Order Picked Up', 'Your order #31 has been picked up by our delivery staff and processing has started. We will notify you when it\'s ready for delivery.', 'info', 1, 12, '2025-10-30 18:50:35'),
(39, 'Order Picked Up', 'Your order #34 has been picked up by our delivery staff and processing has started. We will notify you when it\'s ready for delivery.', 'info', 1, 12, '2025-10-30 18:51:19'),
(40, 'Order Status Updated', 'Order #34: Your order is ready for delivery', 'info', 1, 12, '2025-10-30 18:52:22'),
(41, 'Delivery Code', 'Your delivery code for order #34 is: 477383. Share this code with the delivery person.', 'info', 1, 12, '2025-10-30 18:53:03'),
(42, 'Order Delivered!', 'Your order #34 has been delivered. Thank you!', 'success', 1, 12, '2025-10-30 18:53:14');

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

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

CREATE TABLE `offers` (
  `id` int(11) NOT NULL,
  `title` varchar(200) NOT NULL,
  `description` text DEFAULT NULL,
  `discount_type` enum('percentage','fixed_amount') NOT NULL,
  `discount_value` decimal(10,2) NOT NULL,
  `min_order_amount` decimal(10,2) DEFAULT 0.00,
  `max_discount_amount` decimal(10,2) DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `usage_limit` int(11) DEFAULT NULL,
  `used_count` int(11) DEFAULT 0,
  `status` enum('active','inactive','expired') DEFAULT 'active',
  `target_customers` enum('all','new','normal','regular','subscribed') DEFAULT 'all',
  `applicable_services` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `offers` (`id`, `title`, `description`, `discount_type`, `discount_value`, `min_order_amount`, `max_discount_amount`, `start_date`, `end_date`, `usage_limit`, `used_count`, `status`, `target_customers`, `applicable_services`, `created_at`, `updated_at`) VALUES
(1, 'New Customer Discount', 'Get 20% off your first order! Welcome to Allura Dry Clean.', 'percentage', 20.00, 25.00, 50.00, '2025-01-01', '2025-12-31', NULL, 1, 'active', 'new', NULL, '2025-10-14 20:53:52', '2025-10-22 15:57:46'),
(2, 'Weekend Special', 'Save $10 on orders over $50 during weekends', 'fixed_amount', 10.00, 50.00, NULL, '2025-01-01', '2025-12-31', NULL, 5, 'active', 'all', NULL, '2025-10-14 20:53:52', '2025-11-03 19:16:47'),
(3, 'Dry Cleaning Premium', '15% off all dry cleaning services', 'percentage', 15.00, 0.00, 25.00, '2025-01-01', '2025-03-31', 100, 0, 'expired', 'all', '[2]', '2025-10-14 20:53:52', '2025-10-14 20:54:03'),
(4, 'Bulk Order Discount', '25% off orders over $100', 'percentage', 25.00, 100.00, 75.00, '2025-01-01', '2025-06-30', NULL, 0, 'expired', 'all', NULL, '2025-10-14 20:53:52', '2025-10-14 20:54:03'),
(5, 'Loyalty Reward', 'Exclusive $15 off for our regular customers', 'fixed_amount', 15.00, 30.00, NULL, '2025-01-01', '2025-03-31', 50, 0, 'expired', 'regular', NULL, '2025-10-14 20:53:52', '2025-10-14 20:54:03');

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

--
-- Table structure for table `offer_usage`
--

CREATE TABLE `offer_usage` (
  `id` int(11) NOT NULL,
  `offer_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `discount_amount` decimal(10,2) NOT NULL,
  `used_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `offer_usage`
--

INSERT INTO `offer_usage` (`id`, `offer_id`, `user_id`, `order_id`, `discount_amount`, `used_at`) VALUES
(1, 1, 12, 26, 5.50, '2025-10-14 21:09:51'),
(2, 2, 12, 29, 10.00, '2025-10-18 10:29:05'),
(3, 2, 12, 30, 10.00, '2025-10-18 15:19:11'),
(4, 2, 12, 31, 10.00, '2025-10-22 15:51:25'),
(5, 2, 12, 36, 10.00, '2025-11-03 19:13:12'),
(6, 2, 12, 38, 10.00, '2025-11-03 19:16:47');

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

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

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `customer_name` varchar(100) DEFAULT NULL,
  `customer_phone` varchar(20) DEFAULT NULL,
  `customer_address` text DEFAULT NULL,
  `customer_location` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`customer_location`)),
  `total_amount` decimal(10,2) NOT NULL,
  `status` enum('pending','processing','ready','delivered','cancelled') DEFAULT 'pending',
  `payment_method` enum('cash','card','online') DEFAULT 'cash',
  `delivery_date` date DEFAULT NULL,
  `delivery_time` time DEFAULT NULL,
  `delivery_staff_id` int(11) DEFAULT NULL,
  `delivered_at` timestamp NULL DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `picked_up_at` timestamp NULL DEFAULT NULL,
  `processing_started_at` timestamp NULL DEFAULT NULL,
  `ready_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `orders` (`id`, `user_id`, `customer_name`, `customer_phone`, `customer_address`, `customer_location`, `total_amount`, `status`, `payment_method`, `delivery_date`, `delivery_time`, `delivery_staff_id`, `delivered_at`, `notes`, `created_at`, `updated_at`, `picked_up_at`, `processing_started_at`, `ready_at`) VALUES
(1, 1, 'John Smith', '0501111111', '123 Main St, Downtown', NULL, 75.50, '', 'card', '2024-01-20', '14:30:00', NULL, NULL, 'Handle with care', '2024-01-20 07:30:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(2, 2, 'Sarah Johnson', '0502222222', '456 Oak Ave, North District', NULL, 120.00, 'processing', 'cash', '2024-01-21', '10:00:00', NULL, NULL, 'Express service', '2024-01-21 05:15:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(3, 3, 'Mike Wilson', '0503333333', '789 Pine St, East Side', NULL, 95.75, 'ready', 'online', '2024-01-21', '16:00:00', NULL, NULL, 'Special instructions', '2024-01-21 09:45:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(4, 4, 'Lisa Brown', '0504444444', '321 Elm St, West Area', NULL, 60.25, 'pending', 'card', '2024-01-22', '11:30:00', NULL, NULL, 'Fragile items', '2024-01-22 06:20:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(5, 5, 'David Davis', '0505555555', '654 Maple Dr, South Zone', NULL, 85.00, 'delivered', 'cash', '2024-01-19', '15:45:00', NULL, NULL, 'Completed successfully', '2024-01-19 08:30:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(6, 6, 'Emma Taylor', '0506666666', '987 Cedar Ln, Central', NULL, 110.50, 'processing', 'online', '2024-01-22', '09:15:00', NULL, NULL, 'Rush order', '2024-01-22 04:45:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(7, 7, 'James Miller', '0507777777', '147 Birch St, North', NULL, 70.25, 'pending', 'card', '2024-01-23', '13:20:00', NULL, NULL, 'Regular service', '2024-01-23 07:15:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(8, 8, 'Anna Garcia', '0508888888', '258 Spruce Ave, East', NULL, 135.75, 'ready', 'cash', '2024-01-21', '17:30:00', NULL, NULL, 'Premium service', '2024-01-21 11:20:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(9, 9, 'Robert Martinez', '0509999999', '369 Willow Way, West', NULL, 55.00, '', 'online', '2024-01-18', '12:00:00', NULL, NULL, 'Standard cleaning', '2024-01-18 06:30:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(10, 10, 'Jennifer Anderson', '0500000000', '741 Poplar Pl, South', NULL, 90.50, 'delivered', 'card', '2024-01-20', '14:15:00', NULL, NULL, 'Express delivery', '2024-01-20 09:00:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(11, 1, 'John Smith', '0501111111', '123 Main St, Downtown', NULL, 65.00, '', 'card', '2024-01-15', '16:00:00', NULL, NULL, 'Regular service', '2024-01-15 10:30:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(12, 2, 'Sarah Johnson', '0502222222', '456 Oak Ave, North District', NULL, 95.75, '', 'cash', '2024-01-14', '11:30:00', NULL, NULL, 'Express cleaning', '2024-01-14 06:15:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(13, 3, 'Mike Wilson', '0503333333', '789 Pine St, East Side', NULL, 80.25, '', 'online', '2024-01-13', '14:45:00', NULL, NULL, 'Special care', '2024-01-13 08:20:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(14, 4, 'Lisa Brown', '0504444444', '321 Elm St, West Area', NULL, 45.50, '', 'card', '2024-01-12', '10:15:00', NULL, NULL, 'Basic service', '2024-01-12 05:45:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(15, 5, 'David Davis', '0505555555', '654 Maple Dr, South Zone', NULL, 110.00, '', 'cash', '2024-01-11', '15:30:00', NULL, NULL, 'Premium package', '2024-01-11 09:00:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(16, 6, 'Emma Taylor', '0506666666', '987 Cedar Ln, Central', NULL, 75.25, '', 'online', '2024-01-10', '13:20:00', NULL, NULL, 'Standard delivery', '2024-01-10 07:30:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(17, 7, 'James Miller', '0507777777', '147 Birch St, North', NULL, 85.50, '', 'card', '2024-01-09', '16:45:00', NULL, NULL, 'Express service', '2024-01-09 11:15:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(18, 8, 'Anna Garcia', '0508888888', '258 Spruce Ave, East', NULL, 100.75, '', 'cash', '2024-01-08', '12:00:00', NULL, NULL, 'Special treatment', '2024-01-08 06:30:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(19, 9, 'Robert Martinez', '0509999999', '369 Willow Way, West', NULL, 60.00, '', 'online', '2024-01-07', '11:15:00', NULL, NULL, 'Regular cleaning', '2024-01-07 05:45:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(20, 10, 'Jennifer Anderson', '0500000000', '741 Poplar Pl, South', NULL, 70.25, '', 'card', '2024-01-06', '14:30:00', NULL, NULL, 'Standard service', '2024-01-06 08:20:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(21, 1, 'John Smith', '0501111111', '123 Main St, Downtown', NULL, 90.50, '', 'card', '2024-01-05', '15:45:00', NULL, NULL, 'Premium cleaning', '2024-01-05 09:30:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(22, 2, 'Sarah Johnson', '0502222222', '456 Oak Ave, North District', NULL, 55.75, '', 'cash', '2024-01-04', '10:30:00', NULL, NULL, 'Basic package', '2024-01-04 05:15:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(23, 3, 'Mike Wilson', '0503333333', '789 Pine St, East Side', NULL, 105.25, '', 'online', '2024-01-03', '17:00:00', NULL, NULL, 'Express delivery', '2024-01-03 11:45:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(24, 4, 'Lisa Brown', '0504444444', '321 Elm St, West Area', NULL, 65.00, '', 'card', '2024-01-02', '13:15:00', NULL, NULL, 'Regular service', '2024-01-02 07:30:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(25, 5, 'David Davis', '0505555555', '654 Maple Dr, South Zone', NULL, 80.75, '', 'cash', '2024-01-01', '16:30:00', NULL, NULL, 'New Year special', '2024-01-01 10:20:00', '2025-10-14 20:53:52', NULL, NULL, NULL),
(26, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 23.76, 'pending', 'cash', '2025-10-16', NULL, NULL, NULL, NULL, '2025-10-14 21:09:51', '2025-10-14 21:09:51', NULL, NULL, NULL),
(27, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', '{\"latitude\":24.7136,\"longitude\":46.6753,\"address\":\"Lat: 24.713600, Lng: 46.675300\",\"updated_at\":\"2025-10-18 11:44:20\"}', 24.30, 'ready', 'cash', '2025-10-19', NULL, NULL, NULL, NULL, '2025-10-18 09:43:52', '2025-10-29 14:31:33', NULL, NULL, NULL),
(29, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 178.20, 'pending', 'cash', '2025-10-22', NULL, NULL, NULL, NULL, '2025-10-18 10:29:05', '2025-10-18 10:29:05', NULL, NULL, NULL),
(30, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 226.80, 'pending', 'cash', '2025-10-22', NULL, NULL, NULL, NULL, '2025-10-18 15:19:11', '2025-10-18 15:19:11', NULL, NULL, NULL),
(31, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 259.20, 'processing', 'cash', '2025-10-23', NULL, 1, NULL, NULL, '2025-10-22 15:51:25', '2025-10-30 18:50:35', '2025-10-30 18:50:35', '2025-10-30 18:50:35', NULL),
(32, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 35.64, 'processing', 'online', '2025-10-23', NULL, 1, NULL, NULL, '2025-10-22 17:26:03', '2025-10-30 18:47:49', '2025-10-30 18:47:49', '2025-10-30 18:47:49', NULL),
(33, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 48.60, 'delivered', 'cash', '2025-10-26', NULL, 1, '2025-10-24 03:24:42', NULL, '2025-10-24 03:15:55', '2025-10-24 03:24:42', NULL, NULL, NULL),
(34, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', '{\"latitude\":25.386294190746185,\"longitude\":49.56404685974122,\"address\":\"Lat: 25.386294, Lng: 49.564047\",\"updated_at\":\"2025-10-28 01:41:15\"}', 32.40, 'delivered', 'cash', '2025-10-25', NULL, 1, '2025-10-30 18:53:14', NULL, '2025-10-24 03:32:28', '2025-10-30 18:53:14', '2025-10-30 18:51:19', '2025-10-30 18:51:19', NULL),
(35, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', '{\"latitude\":25.3880001179767,\"longitude\":49.61022377014161,\"address\":\"Lat: 25.388000, Lng: 49.610224\",\"updated_at\":\"2025-10-28 01:42:04\"}', 48.60, 'delivered', 'cash', '2025-10-25', NULL, 1, '2025-10-29 14:41:42', NULL, '2025-10-24 03:43:53', '2025-10-29 14:41:42', NULL, NULL, NULL),
(36, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 216.00, 'pending', 'cash', '2025-11-04', NULL, NULL, NULL, NULL, '2025-11-03 19:13:12', '2025-11-03 19:13:12', NULL, NULL, NULL),
(37, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 25.92, 'pending', 'cash', '2025-11-04', NULL, NULL, NULL, NULL, '2025-11-03 19:16:05', '2025-11-03 19:16:05', NULL, NULL, NULL),
(38, 12, 'Admin User', '0501234567', 'Admin Office, Allura HQ', NULL, 86.40, 'pending', 'cash', '2025-11-04', NULL, NULL, NULL, NULL, '2025-11-03 19:16:47', '2025-11-03 19:16:47', NULL, NULL, NULL),
(39, 1, 'John Smith', '0501111111', '123 Main St, Downtown', NULL, 19.44, 'pending', 'cash', '2025-11-09', NULL, NULL, NULL, NULL, '2025-11-04 16:27:23', '2025-11-04 16:27:23', NULL, NULL, NULL);

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

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

CREATE TABLE `order_items` (
  `id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `service_id` int(11) NOT NULL,
  `quantity` int(11) NOT NULL DEFAULT 1,
  `price` decimal(10,2) NOT NULL,
  `selected_options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`selected_options`)),
  `weight_kg` decimal(5,2) DEFAULT NULL,
  `pieces_count` int(11) DEFAULT NULL,
  `special_instructions` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `order_items` (`id`, `order_id`, `service_id`, `quantity`, `price`, `selected_options`, `weight_kg`, `pieces_count`, `special_instructions`) VALUES
(1, 1, 1, 3, 4.50, NULL, NULL, NULL, NULL),
(2, 1, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(4, 2, 1, 5, 7.50, NULL, NULL, NULL, NULL),
(5, 2, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(7, 3, 1, 4, 6.00, NULL, NULL, NULL, NULL),
(8, 3, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(10, 4, 1, 2, 3.00, NULL, NULL, NULL, NULL),
(11, 4, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(13, 5, 1, 3, 4.50, NULL, NULL, NULL, NULL),
(14, 5, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(16, 6, 1, 6, 9.00, NULL, NULL, NULL, NULL),
(17, 6, 2, 3, 45.00, NULL, NULL, NULL, NULL),
(19, 7, 1, 3, 4.50, NULL, NULL, NULL, NULL),
(20, 7, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(22, 8, 1, 7, 10.50, NULL, NULL, NULL, NULL),
(23, 8, 2, 4, 60.00, NULL, NULL, NULL, NULL),
(25, 9, 1, 2, 3.00, NULL, NULL, NULL, NULL),
(26, 9, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(28, 10, 1, 4, 6.00, NULL, NULL, NULL, NULL),
(29, 10, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(31, 11, 1, 3, 4.50, NULL, NULL, NULL, NULL),
(32, 11, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(34, 12, 1, 4, 6.00, NULL, NULL, NULL, NULL),
(35, 12, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(37, 13, 1, 3, 4.50, NULL, NULL, NULL, NULL),
(38, 13, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(40, 14, 1, 2, 3.00, NULL, NULL, NULL, NULL),
(41, 14, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(43, 15, 1, 5, 7.50, NULL, NULL, NULL, NULL),
(44, 15, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(46, 16, 1, 3, 4.50, NULL, NULL, NULL, NULL),
(47, 16, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(49, 17, 1, 4, 6.00, NULL, NULL, NULL, NULL),
(50, 17, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(52, 18, 1, 5, 7.50, NULL, NULL, NULL, NULL),
(53, 18, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(55, 19, 1, 2, 3.00, NULL, NULL, NULL, NULL),
(56, 19, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(58, 20, 1, 3, 4.50, NULL, NULL, NULL, NULL),
(59, 20, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(61, 21, 1, 4, 6.00, NULL, NULL, NULL, NULL),
(62, 21, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(64, 22, 1, 2, 3.00, NULL, NULL, NULL, NULL),
(65, 22, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(67, 23, 1, 5, 7.50, NULL, NULL, NULL, NULL),
(68, 23, 2, 2, 30.00, NULL, NULL, NULL, NULL),
(70, 24, 1, 3, 4.50, NULL, NULL, NULL, NULL),
(71, 24, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(73, 25, 1, 4, 6.00, NULL, NULL, NULL, NULL),
(74, 25, 2, 1, 15.00, NULL, NULL, NULL, NULL),
(76, 26, 1, 2, 10.00, NULL, NULL, NULL, NULL),
(77, 26, 2, 1, 7.50, NULL, NULL, NULL, NULL),
(78, 27, 2, 3, 7.50, NULL, NULL, NULL, NULL),
(79, 29, 6, 1, 15.00, '{\"item_type\":{\"id\":57,\"name\":\"carpets\",\"price\":0},\"carpet_type\":{\"id\":\"89\",\"name\":\"Wool or Handmade Carpets\",\"price\":85},\"cleaning_preference\":{\"id\":\"94\",\"name\":\"Dry Cleaning\",\"price\":25},\"pickup_time\":{\"id\":\"98\",\"name\":\"Choose time slot\",\"price\":0},\"delivery_speed\":{\"id\":\"100\",\"name\":\"Express\",\"price\":5},\"addons\":[{\"id\":\"96\",\"name\":\"Deodorizing & Fresh Scent Finish - Carpets\",\"price\":10},{\"id\":\"95\",\"name\":\"Anti-bacterial Treatment - Carpets\",\"price\":15},{\"id\":\"97\",\"name\":\"Moth & Dust Mite Protection - Carpets\",\"price\":20}]}', NULL, NULL, NULL),
(80, 30, 6, 2, 15.00, '{\"item_type\":{\"id\":54,\"name\":\"pillows\",\"price\":0},\"pillow_type\":{\"id\":\"60\",\"name\":\"Luxury or Medical Pillows\",\"price\":35},\"cleaning_preference\":{\"id\":\"94\",\"name\":\"Dry Cleaning\",\"price\":25},\"pickup_time\":{\"id\":\"98\",\"name\":\"Choose time slot\",\"price\":0},\"delivery_speed\":{\"id\":\"100\",\"name\":\"Express\",\"price\":5},\"addons\":[{\"id\":\"65\",\"name\":\"Reshaping\",\"price\":10},{\"id\":\"64\",\"name\":\"Pillow Restuffing\",\"price\":20}]}', NULL, NULL, NULL),
(81, 31, 5, 1, 100.00, '{\"subscription_type\":{\"id\":\"55\",\"name\":\"Monthly Package (+SAR 150.00) - SAR 250.00\",\"price\":150}}', NULL, NULL, NULL),
(82, 32, 1, 1, 10.00, '{\"detergent\":{\"id\":\"4\",\"name\":\"Hypoallergenic (Sensitive Skin) (+SAR 3.00)\",\"price\":3},\"delivery_time\":{\"id\":\"28\",\"name\":\"24 Hours\",\"price\":0},\"fabric_type\":{\"id\":\"15\",\"name\":\"T-Shirt (+SAR 4.00)\",\"price\":4},\"service_type\":{\"id\":\"1\",\"name\":\"Regular Wash & Dry (per piece)\",\"price\":0},\"cleaning_method\":{\"id\":\"19\",\"name\":\"Dry Clean (+SAR 8.00)\",\"price\":8},\"temperature\":{\"id\":\"22\",\"name\":\"Hot (+SAR 1.00)\",\"price\":1},\"optional_ironing\":{\"id\":\"25\",\"name\":\"Steam Ironing (+SAR 7.00)\",\"price\":7},\"gender\":{\"id\":\"110\",\"name\":\"Women\",\"price\":0}}', NULL, NULL, NULL),
(83, 33, 4, 3, 15.00, NULL, NULL, NULL, NULL),
(84, 34, 4, 2, 15.00, NULL, NULL, NULL, NULL),
(85, 35, 4, 1, 15.00, '{\"delivery_time\":{\"id\":\"123\",\"name\":\"Standard Delivery \\u2013 3-5 Days\",\"price\":0},\"cleaning_method\":{\"id\":\"120\",\"name\":\"Full cleaning +Polishing (+SAR 15.00)\",\"price\":15},\"shoe_type\":{\"id\":\"113\",\"name\":\"Formal (+SAR 2.00)\",\"price\":2},\"shoe_material\":{\"id\":\"116\",\"name\":\"Suede (+SAR 8.00)\",\"price\":8},\"additional_service\":{\"id\":\"122\",\"name\":\"Polish leather (+SAR 5.00)\",\"price\":5}}', NULL, NULL, NULL),
(86, 36, 2, 20, 7.50, '{\"delivery_time\":{\"id\":\"40\",\"name\":\"24 Hours\",\"price\":0},\"ironing_type\":{\"id\":\"33\",\"name\":\"Regular\",\"price\":0},\"fabric_type\":{\"id\":\"30\",\"name\":\"Silk (+SAR 3.00)\",\"price\":3},\"drying_level\":{\"id\":\"36\",\"name\":\"Fully Dried\",\"price\":0}}', NULL, NULL, NULL),
(87, 37, 1, 20, 10.00, '{\"detergent\":{\"id\":\"3\",\"name\":\"Regular\",\"price\":0},\"delivery_time\":{\"id\":\"28\",\"name\":\"24 Hours\",\"price\":0},\"fabric_type\":{\"id\":\"11\",\"name\":\"Lace (+SAR 6.00)\",\"price\":6},\"service_type\":{\"id\":\"1\",\"name\":\"Regular Wash & Dry (per piece)\",\"price\":0},\"cleaning_method\":{\"id\":\"18\",\"name\":\"Wet Wash\",\"price\":0},\"temperature\":{\"id\":\"20\",\"name\":\"Cold\",\"price\":0},\"optional_ironing\":{\"id\":\"23\",\"name\":\"No Ironing\",\"price\":0}}', NULL, NULL, NULL),
(88, 38, 4, 5, 15.00, '{\"delivery_time\":{\"id\":\"123\",\"name\":\"Standard Delivery \\u2013 48 Hours\",\"price\":0},\"cleaning_method\":{\"id\":\"118\",\"name\":\"Standard cleaning\",\"price\":0},\"shoe_type\":{\"id\":\"111\",\"name\":\"Heels\",\"price\":0},\"shoe_material\":{\"id\":\"117\",\"name\":\"Fabric\",\"price\":0},\"additional_service\":{\"id\":\"121\",\"name\":\"Replace shoelaces (+SAR 3.00)\",\"price\":3}}', NULL, NULL, NULL),
(89, 39, 1, 5, 10.00, '{\"detergent\":{\"id\":\"3\",\"name\":\"Regular\",\"price\":0},\"delivery_time\":{\"id\":\"28\",\"name\":\"24 Hours\",\"price\":0},\"fabric_type\":{\"id\":\"7\",\"name\":\"Cotton\",\"price\":0},\"service_type\":{\"id\":\"1\",\"name\":\"Regular Wash & Dry (per piece)\",\"price\":0},\"cleaning_method\":{\"id\":\"18\",\"name\":\"Wet Wash\",\"price\":0},\"temperature\":{\"id\":\"20\",\"name\":\"Cold\",\"price\":0},\"optional_ironing\":{\"id\":\"23\",\"name\":\"No Ironing\",\"price\":0}}', NULL, NULL, NULL);

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

--
-- Table structure for table `reviews`
--

CREATE TABLE `reviews` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `service_rating` int(11) NOT NULL CHECK (`service_rating` >= 1 and `service_rating` <= 5),
  `delivery_rating` int(11) NOT NULL CHECK (`delivery_rating` >= 1 and `delivery_rating` <= 5),
  `comment` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `reviews`
--

INSERT INTO `reviews` (`id`, `user_id`, `order_id`, `service_rating`, `delivery_rating`, `comment`, `created_at`) VALUES
(1, 1, 1, 5, 5, 'Excellent service, very satisfied!', '2025-10-14 20:53:52'),
(2, 2, 2, 4, 4, 'Good quality, fast delivery', '2025-10-14 20:53:52'),
(3, 3, 3, 5, 5, 'Perfect cleaning, highly recommended', '2025-10-14 20:53:52'),
(4, 4, 4, 3, 3, 'Average service, could be better', '2025-10-14 20:53:52'),
(5, 5, 5, 4, 4, 'Good experience overall', '2025-10-14 20:53:52'),
(6, 6, 6, 5, 5, 'Outstanding service, will use again', '2025-10-14 20:53:52'),
(7, 7, 7, 4, 4, 'Very good quality and fast delivery', '2025-10-14 20:53:52'),
(8, 8, 8, 5, 5, 'Perfect cleaning, exceeded expectations', '2025-10-14 20:53:52'),
(9, 9, 9, 4, 4, 'Good service overall', '2025-10-14 20:53:52'),
(10, 10, 10, 5, 5, 'Excellent work, highly recommended', '2025-10-14 20:53:52');

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

--
-- Table structure for table `services`
--

CREATE TABLE `services` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `category` varchar(50) DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `services`
--

INSERT INTO `services` (`id`, `name`, `description`, `price`, `category`, `image`, `created_at`) VALUES
(1, 'Regular & Specialized Cleaning', 'Professional washing service combining regular daily washing and specialized cleaning for delicate and luxury garments using latest techniques and safe eco-friendly detergents', 8.50, 'complete_washing', 'img/wash-fold.jpg', '2025-10-14 20:53:52'),
(2, 'Ironing Service', 'Professional ironing that maintains fabric smoothness and quality', 6.38, 'ironing', 'img/laundrybasket.jpg', '2025-10-14 20:53:52'),
(4, 'Shoe Cleaning', 'A specialized service for washing and cleaning all types of shoes with sterilization and internal drying to maintain cleanliness and freshness.', 0.00, 'shoe_cleaning', 'img/shoecleaningservice.jpg', '2025-10-14 20:53:52'),
(5, 'Monthly Subscriptions', 'Weekly or monthly packages for greater convenience with special discounts for loyal customers', 85.00, 'subscription', 'img/graphic1.png', '2025-10-14 20:53:52'),
(6, 'Household Items', 'Cleaning household items like curtains, pillows, and blankets', 0.00, 'household', 'img/household-items.jpg', '2025-10-14 20:53:52');

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

--
-- Table structure for table `service_options`
--

CREATE TABLE `service_options` (
  `id` int(11) NOT NULL,
  `service_id` int(11) NOT NULL,
  `option_type` enum('detergent','delivery_time','ironing_type','carpet_material','carpet_size','cleaning_material','specialized_type','subscription_type','pickup_time','fabric_type','drying_level','service_type','cleaning_method','temperature','optional_ironing','item_type','pillow_type','blanket_type','curtain_type','carpet_type','cleaning_preference','optional_addon','delivery_speed','curtain_material','number_of_windows','garment_size','gender','shoe_type','shoe_material','additional_service') NOT NULL,
  `option_name` varchar(100) NOT NULL,
  `option_value` varchar(100) NOT NULL,
  `price_modifier` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `service_options`
--

INSERT INTO `service_options` (`id`, `service_id`, `option_type`, `option_name`, `option_value`, `price_modifier`, `created_at`) VALUES
(1, 1, 'service_type', 'Regular Wash & Dry (per piece)', 'regular_wash', 0.00, '2025-10-14 20:53:52'),
(2, 1, 'service_type', 'Specialized Cleaning (per piece)', 'specialized_clean', 6.80, '2025-10-14 20:53:52'),
(3, 1, 'detergent', 'Regular', 'regular', 0.00, '2025-10-14 20:53:52'),
(4, 1, 'detergent', 'Hypoallergenic (Sensitive Skin)', 'hypoallergenic', 1.28, '2025-10-14 20:53:52'),
(5, 1, 'detergent', 'Scented', 'scented', 0.43, '2025-10-14 20:53:52'),
(6, 1, 'detergent', 'Unscented', 'unscented', 0.00, '2025-10-14 20:53:52'),
(7, 1, 'fabric_type', 'Cotton', 'cotton', 0.00, '2025-10-14 20:53:52'),
(8, 1, 'fabric_type', 'Polyester', 'polyester', 0.00, '2025-10-14 20:53:52'),
(9, 1, 'fabric_type', 'Silk', 'silk', 1.70, '2025-10-14 20:53:52'),
(10, 1, 'fabric_type', 'Wool', 'wool', 1.28, '2025-10-14 20:53:52'),
(11, 1, 'fabric_type', 'Lace', 'lace', 2.13, '2025-10-14 20:53:52'),
(12, 1, 'fabric_type', 'Abaya', 'abaya', 2.55, '2025-10-14 20:53:52'),
(13, 1, 'fabric_type', 'Undershirt/Vest', 'undershirt', 0.85, '2025-10-14 20:53:52'),
(14, 1, 'fabric_type', 'Jeans', 'jeans', 1.70, '2025-10-22 09:46:00'),
(15, 1, 'fabric_type', 'T-Shirt', 'tshirt', 0.85, '2025-10-22 09:46:00'),
(16, 1, 'fabric_type', 'Shemagh', 'shemagh', 2.13, '2025-10-22 09:46:00'),
(17, 1, 'fabric_type', 'Thobe', 'thobe', 2.98, '2025-10-22 09:46:00'),
(18, 1, 'cleaning_method', 'Wet Wash', 'wet_wash', 0.00, '2025-10-14 20:53:52'),
(19, 1, 'cleaning_method', 'Dry Clean', 'dry_clean', 2.55, '2025-10-14 20:53:52'),
(20, 1, 'temperature', 'Cold', 'cold', 0.00, '2025-10-14 20:53:52'),
(21, 1, 'temperature', 'Warm', 'warm', 0.00, '2025-10-14 20:53:52'),
(22, 1, 'temperature', 'Hot', 'hot', 0.43, '2025-10-14 20:53:52'),
(23, 1, 'optional_ironing', 'No Ironing', 'no_ironing', 0.00, '2025-10-14 20:53:52'),
(24, 1, 'optional_ironing', 'Regular Ironing', 'regular_ironing', 4.25, '2025-10-14 20:53:52'),
(25, 1, 'optional_ironing', 'Steam Ironing', 'steam_ironing', 2.13, '2025-10-14 20:53:52'),
(26, 1, 'delivery_time', 'Express (6 Hours)', 'express_6h', 12.75, '2025-10-14 20:53:52'),
(27, 1, 'delivery_time', 'Same Day (12 Hours)', 'same_day', 4.25, '2025-10-14 20:53:52'),
(28, 1, 'delivery_time', '24 Hours', '24_hours', 0.00, '2025-10-14 20:53:52'),
(29, 2, 'fabric_type', 'Cotton', 'cotton', 0.00, '2025-10-14 20:53:52'),
(30, 2, 'fabric_type', 'Silk', 'silk', 1.70, '2025-10-14 20:53:52'),
(31, 2, 'fabric_type', 'Wool', 'wool', 1.28, '2025-10-14 20:53:52'),
(32, 2, 'fabric_type', 'Blend', 'blend', 0.85, '2025-10-14 20:53:52'),
(33, 2, 'ironing_type', 'Regular', 'regular', 0.00, '2025-10-14 20:53:52'),
(34, 2, 'ironing_type', 'Steam', 'steam', 1.70, '2025-10-14 20:53:52'),
(35, 2, 'ironing_type', 'No Steam', 'no_steam', 0.85, '2025-10-14 20:53:52'),
(36, 2, 'drying_level', 'Fully Dried', 'fully_dried', 0.00, '2025-10-14 20:53:52'),
(37, 2, 'drying_level', 'Slightly Damp', 'slightly_damp', 0.43, '2025-10-14 20:53:52'),
(38, 2, 'drying_level', 'No Drying Needed', 'no_drying', 0.00, '2025-10-14 20:53:52'),
(39, 2, 'delivery_time', '12 Hours', '12_hours', 2.55, '2025-10-14 20:53:52'),
(40, 2, 'delivery_time', '24 Hours', '24_hours', 0.00, '2025-10-14 20:53:52'),
(54, 5, 'subscription_type', 'Weekly Package', 'weekly', 0.00, '2025-10-14 20:53:52'),
(55, 5, 'subscription_type', 'Monthly Package', 'monthly', 170.00, '2025-10-14 20:53:52'),
(56, 6, 'item_type', 'Pillows', 'pillows', 0.00, '2025-10-18 08:34:46'),
(57, 6, 'item_type', 'Blankets', 'blankets', 0.00, '2025-10-18 08:34:46'),
(58, 6, 'item_type', 'Curtains', 'curtains', 0.00, '2025-10-18 08:34:46'),
(59, 6, 'item_type', 'Carpets', 'carpets', 0.00, '2025-10-18 08:34:46'),
(60, 6, 'pillow_type', 'Cotton Pillows', 'cotton_pillows', 21.25, '2025-10-18 08:34:46'),
(61, 6, 'pillow_type', 'Fiber / Polyester Pillows', 'fiber_polyester', 25.50, '2025-10-18 08:34:46'),
(62, 6, 'pillow_type', 'Luxury or Medical Pillows', 'luxury_medical', 12.75, '2025-10-18 08:34:46'),
(63, 6, 'cleaning_preference', 'Standard Cleaning - Pillows', 'standard_pillows', 0.00, '2025-10-18 08:34:46'),
(64, 6, 'cleaning_preference', 'Deep Cleaning - Pillows', 'deep_pillows', 8.50, '2025-10-18 08:34:46'),
(65, 6, 'cleaning_preference', 'Sanitization (Steam or UV Light) - Pillows', 'sanitization_pillows', 4.25, '2025-10-18 08:34:46'),
(66, 6, 'optional_addon', 'Pillow Restuffing', 'restuffing', 6.80, '2025-10-18 08:34:46'),
(67, 6, 'optional_addon', 'Reshaping', 'reshaping', 3.40, '2025-10-18 08:34:46'),
(68, 6, 'blanket_type', 'Cotton Blankets', 'cotton_blankets', 25.50, '2025-10-18 08:34:46'),
(69, 6, 'blanket_type', 'Wool Blankets', 'wool_blankets', 34.00, '2025-10-18 08:34:46'),
(70, 6, 'blanket_type', 'Heavy Winter Comforters', 'heavy_winter', 38.25, '2025-10-18 08:34:46'),
(71, 6, 'blanket_type', 'Electric Blankets (Dry Clean Only)', 'electric_blankets', 42.50, '2025-10-18 08:34:46'),
(72, 6, 'blanket_type', 'Baby or Delicate Blankets', 'baby_delicate', 35.70, '2025-10-18 08:34:46'),
(73, 6, 'cleaning_preference', 'Standard Wash & Dry - Blankets', 'standard_blankets', 0.00, '2025-10-18 08:34:47'),
(74, 6, 'cleaning_preference', 'Deep Cleaning with Stain Removal - Blankets', 'deep_blankets', 12.75, '2025-10-18 08:34:47'),
(75, 6, 'cleaning_preference', 'Dry Cleaning (for delicate or electric blankets)', 'dry_blankets', 8.50, '2025-10-18 08:34:47'),
(76, 6, 'cleaning_preference', 'Hypoallergenic Wash (for sensitive skin)', 'hypoallergenic_blankets', 15.30, '2025-10-18 08:34:47'),
(77, 6, 'optional_addon', 'Steam Sanitization - Blankets', 'steam_blankets', 12.75, '2025-10-18 08:34:47'),
(78, 6, 'optional_addon', 'Deodorizing & Fresh Scent - Blankets', 'deodorizing_blankets', 4.25, '2025-10-18 08:34:47'),
(79, 6, 'curtain_type', 'Cotton Curtains', 'cotton_curtains', 34.00, '2025-10-18 08:34:47'),
(80, 6, 'curtain_type', 'Velvet Curtains', 'velvet_curtains', 51.00, '2025-10-18 08:34:47'),
(81, 6, 'curtain_type', 'Blackout Curtains', 'blackout_curtains', 46.75, '2025-10-18 08:34:47'),
(82, 6, 'curtain_type', 'Silk Curtains', 'silk_curtains', 55.25, '2025-10-18 08:34:47'),
(83, 6, 'curtain_type', 'Voile / Sheer Curtains', 'voile_sheer', 42.50, '2025-10-18 08:34:47'),
(84, 6, 'curtain_type', 'Embroidered / Decorative Curtains', 'embroidered_curtains', 59.50, '2025-10-18 08:34:47'),
(85, 6, 'cleaning_preference', 'Regular Water Wash - Curtains', 'regular_curtains', 0.00, '2025-10-18 08:34:47'),
(86, 6, 'cleaning_preference', 'Steam Cleaning - Curtains', 'steam_curtains', 4.25, '2025-10-18 08:34:47'),
(87, 6, 'cleaning_preference', 'Dry Cleaning - Curtains', 'dry_curtains', 8.50, '2025-10-18 08:34:47'),
(88, 6, 'carpet_type', 'Regular Carpets', 'regular_carpets', 55.25, '2025-10-18 08:34:47'),
(89, 6, 'carpet_type', 'Persian / Oriental Rugs', 'persian_rugs', 88.40, '2025-10-18 08:34:47'),
(90, 6, 'carpet_type', 'Wool or Handmade Carpets', 'wool_handmade', 38.68, '2025-10-18 08:34:47'),
(91, 6, 'carpet_type', 'Prayer Rugs or Small Mats', 'prayer_rugs', 71.83, '2025-10-18 08:34:47'),
(92, 6, 'cleaning_preference', 'Standard Surface Cleaning - Carpets', 'standard_carpets', 0.00, '2025-10-18 08:34:47'),
(93, 6, 'cleaning_preference', 'Deep Cleaning with Stain Removal - Carpets', 'deep_carpets', 17.00, '2025-10-18 08:34:47'),
(94, 6, 'cleaning_preference', 'Steam Cleaning - Carpets', 'steam_carpets', 4.25, '2025-10-18 08:34:47'),
(95, 6, 'cleaning_preference', 'Dry Cleaning (for delicate or handmade rugs)', 'dry_carpets', 8.50, '2025-10-18 08:34:47'),
(96, 6, 'optional_addon', 'Anti-bacterial Treatment - Carpets', 'antibacterial_carpets', 6.80, '2025-10-18 08:34:47'),
(97, 6, 'optional_addon', 'Deodorizing & Fresh Scent Finish - Carpets', 'deodorizing_carpets', 4.25, '2025-10-18 08:34:47'),
(98, 6, 'optional_addon', 'Moth & Dust Mite Protection - Carpets', 'moth_protection', 8.50, '2025-10-18 08:34:47'),
(99, 6, 'pickup_time', 'Morning (10 AM - 12 PM)', 'morning_slot', 0.00, '2025-10-18 08:34:47'),
(100, 6, 'pickup_time', 'Afternoon (1 PM - 3 PM)', 'afternoon_slot', 0.00, '2025-10-18 08:34:47'),
(101, 6, 'pickup_time', 'Evening (4 PM - 6 PM)', 'evening_slot', 0.00, '2025-10-18 08:34:47'),
(102, 6, 'delivery_speed', 'Standard (2-5 Days) Free', 'standard', 0.00, '2025-10-18 08:34:47'),
(103, 6, 'delivery_speed', 'Express (Within 24-48 Hours)', 'express', 6.80, '2025-10-18 08:34:47'),
(104, 6, 'garment_size', 'Small (< 80cm)', 'size_small', 5.00, '2025-10-22 09:30:00'),
(105, 6, 'garment_size', 'Medium (80-120cm)', 'size_medium', 10.00, '2025-10-22 09:30:00'),
(106, 6, 'garment_size', 'Large (120-160cm)', 'size_large', 15.00, '2025-10-22 09:30:00'),
(107, 6, 'garment_size', 'Extra Large (> 160cm)', 'size_xlarge', 25.00, '2025-10-22 09:30:00'),
(108, 1, 'fabric_type', 'Dress', 'dress', 8.50, '2025-10-22 09:46:00'),
(109, 1, 'gender', 'Men', 'men', 0.00, '2025-10-22 09:46:00'),
(110, 1, 'gender', 'Women', 'women', 0.00, '2025-10-22 09:46:00'),
(111, 4, 'shoe_type', 'Heels', 'heels', 2.00, '2025-10-24 03:42:50'),
(112, 4, 'shoe_type', 'Sports', 'sports', 3.00, '2025-10-24 03:42:50'),
(113, 4, 'shoe_type', 'Formal', 'formal', 2.50, '2025-10-24 03:42:50'),
(114, 4, 'shoe_type', 'Casual', 'casual', 1.50, '2025-10-24 03:42:50'),
(115, 4, 'shoe_material', 'Leather', 'leather', 0.85, '2025-10-24 03:42:50'),
(116, 4, 'shoe_material', 'Suede', 'suede', 2.55, '2025-10-24 03:42:50'),
(117, 4, 'shoe_material', 'Fabric', 'fabric', 0.00, '2025-10-24 03:42:50'),
(118, 4, 'cleaning_method', 'Standard cleaning', 'standard_cleaning', 0.00, '2025-10-24 03:42:50'),
(119, 4, 'cleaning_method', 'Deep cleaning +Disinfection', 'deep_cleaning_disinfection', 8.50, '2025-10-24 03:42:50'),
(120, 4, 'cleaning_method', 'Full cleaning +Polishing', 'full_cleaning_polishing', 4.25, '2025-10-24 03:42:50'),
(121, 4, 'additional_service', 'Replace shoelaces', 'replace_shoelaces', 2.55, '2025-10-24 03:42:50'),
(122, 4, 'additional_service', 'Polish leather', 'polish_leather', 1.70, '2025-10-24 03:42:50'),
(123, 4, 'delivery_time', 'Standard Delivery – 48 Hours', 'standard_delivery', 0.00, '2025-10-24 03:42:50'),
(124, 4, 'delivery_time', 'Express Delivery – 24 Hours', 'express_delivery', 8.50, '2025-10-24 03:42:50'),
(125, 4, 'delivery_time', 'Same-Day Delivery (Premium)', 'same_day_delivery', 21.25, '2025-10-24 03:42:50');

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

--
-- Table structure for table `subscriptions`
--

CREATE TABLE `subscriptions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `plan_name` varchar(100) NOT NULL,
  `plan_type` enum('weekly','monthly') NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `status` enum('active','expired','cancelled') DEFAULT 'active',
  `usage_count` int(11) DEFAULT 0,
  `max_usage` int(11) DEFAULT 10,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subscriptions`
--

INSERT INTO `subscriptions` (`id`, `user_id`, `plan_name`, `plan_type`, `price`, `start_date`, `end_date`, `status`, `usage_count`, `max_usage`, `created_at`) VALUES
(1, 12, 'Monthly Subscription', 'monthly', 250.00, '2025-10-23', '2025-11-22', 'active', 6, 10, '2025-10-22 15:51:25');

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

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

CREATE TABLE `system_settings` (
  `id` int(11) NOT NULL,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text DEFAULT NULL,
  `setting_type` enum('text','number','boolean','json') DEFAULT 'text',
  `description` text DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `system_settings` (`id`, `setting_key`, `setting_value`, `setting_type`, `description`, `updated_at`) VALUES
(1, 'working_hours_start', '08:00', 'text', 'Working hours start', '2025-10-14 20:53:52'),
(2, 'working_hours_end', '18:00', 'text', 'Working hours end', '2025-10-14 20:53:52'),
(3, 'working_days', '[\"sunday\",\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\"]', 'json', 'Working days', '2025-10-14 20:53:52'),
(4, 'delivery_fee', '15.00', 'number', 'Delivery fee', '2025-10-14 20:53:52'),
(5, 'min_order_amount', '50.00', 'number', 'Minimum order amount', '2025-10-14 20:53:52'),
(6, 'max_delivery_time', '60', 'number', 'Maximum delivery time in minutes', '2025-10-14 20:53:52'),
(7, 'notification_email', 'admin@allura.com', 'text', 'Notification email', '2025-10-14 20:53:52'),
(8, 'company_phone', '0501234567', 'text', 'Company phone', '2025-10-14 20:53:52'),
(9, 'company_address', 'Riyadh, Saudi Arabia', 'text', 'Company address', '2025-10-14 20:53:52');

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `adress` varchar(255) DEFAULT NULL,
  `role` enum('user','admin') DEFAULT 'user',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`id`, `name`, `email`, `password`, `phone`, `adress`, `role`, `created_at`) VALUES
(1, 'John Smith', 'john@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0501111111', '123 Main St, Downtown', 'user', '2025-10-14 20:53:52'),
(2, 'Sarah Johnson', 'sarah@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0502222222', '456 Oak Ave, North District', 'user', '2025-10-14 20:53:52'),
(3, 'Mike Wilson', 'mike@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0503333333', '789 Pine St, East Side', 'user', '2025-10-14 20:53:52'),
(4, 'Lisa Brown', 'lisa@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0504444444', '321 Elm St, West Area', 'user', '2025-10-14 20:53:52'),
(5, 'David Davis', 'david@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0505555555', '654 Maple Dr, South Zone', 'user', '2025-10-14 20:53:52'),
(6, 'Emma Taylor', 'emma@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0506666666', '987 Cedar Ln, Central', 'user', '2025-10-14 20:53:52'),
(7, 'James Miller', 'james@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0507777777', '147 Birch St, North', 'user', '2025-10-14 20:53:52'),
(8, 'Anna Garcia', 'anna@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0508888888', '258 Spruce Ave, East', 'user', '2025-10-14 20:53:52'),
(9, 'Robert Martinez', 'robert@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0509999999', '369 Willow Way, West', 'user', '2025-10-14 20:53:52'),
(10, 'Jennifer Anderson', 'jennifer@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '0500000000', '741 Poplar Pl, South', 'user', '2025-10-14 20:53:52'),
(11, 'Test Customer', 'customer@test.com', '$2y$10$r1VXhixiSvJGhriQ/Ooli.Kw7BunwsVsyB780K91JoRyn3qP.eOoW', '0509876543', 'Test Address, Riyadh', 'user', '2025-10-14 20:53:52'),
(12, 'Admin User', 'admin@allura.com', '$2y$10$ey7BHKM6VUbXjujbJN4SA.vpnxanZlfCA9LdFWhV9pH7x0H.8DJ0C', '0501234567', 'Admin Office, Allura HQ', 'admin', '2025-10-14 20:53:52');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `cart`
--
ALTER TABLE `cart`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_user_service` (`user_id`,`service_id`),
  ADD KEY `service_id` (`service_id`);

--
-- Indexes for table `contact_messages`
--
ALTER TABLE `contact_messages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `delivery_codes`
--
ALTER TABLE `delivery_codes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`);

--
-- Indexes for table `delivery_staff`
--
ALTER TABLE `delivery_staff`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `expenses`
--
ALTER TABLE `expenses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `laundry_staff`
--
ALTER TABLE `laundry_staff`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `offers`
--
ALTER TABLE `offers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `offer_usage`
--
ALTER TABLE `offer_usage`
  ADD PRIMARY KEY (`id`),
  ADD KEY `offer_id` (`offer_id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `order_id` (`order_id`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `delivery_staff_id` (`delivery_staff_id`);

--
-- Indexes for table `order_items`
--
ALTER TABLE `order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`),
  ADD KEY `service_id` (`service_id`);

--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `order_id` (`order_id`);

--
-- Indexes for table `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `service_options`
--
ALTER TABLE `service_options`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_id` (`service_id`);

--
-- Indexes for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `system_settings`
--
ALTER TABLE `system_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `setting_key` (`setting_key`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `cart`
--
ALTER TABLE `cart`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=597;

--
-- AUTO_INCREMENT for table `contact_messages`
--
ALTER TABLE `contact_messages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `delivery_codes`
--
ALTER TABLE `delivery_codes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `delivery_staff`
--
ALTER TABLE `delivery_staff`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `expenses`
--
ALTER TABLE `expenses`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `laundry_staff`
--
ALTER TABLE `laundry_staff`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;

--
-- AUTO_INCREMENT for table `offers`
--
ALTER TABLE `offers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `offer_usage`
--
ALTER TABLE `offer_usage`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;

--
-- AUTO_INCREMENT for table `order_items`
--
ALTER TABLE `order_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=90;

--
-- AUTO_INCREMENT for table `reviews`
--
ALTER TABLE `reviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `service_options`
--
ALTER TABLE `service_options`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=126;

--
-- AUTO_INCREMENT for table `subscriptions`
--
ALTER TABLE `subscriptions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `system_settings`
--
ALTER TABLE `system_settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `cart`
--
ALTER TABLE `cart`
  ADD CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `cart_ibfk_2` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `delivery_codes`
--
ALTER TABLE `delivery_codes`
  ADD CONSTRAINT `delivery_codes_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `notifications`
--
ALTER TABLE `notifications`
  ADD CONSTRAINT `notifications_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `offer_usage`
--
ALTER TABLE `offer_usage`
  ADD CONSTRAINT `offer_usage_ibfk_1` FOREIGN KEY (`offer_id`) REFERENCES `offers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `offer_usage_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `offer_usage_ibfk_3` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `orders`
--
ALTER TABLE `orders`
  ADD CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`delivery_staff_id`) REFERENCES `delivery_staff` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `order_items`
--
ALTER TABLE `order_items`
  ADD CONSTRAINT `order_items_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `order_items_ibfk_2` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `reviews`
--
ALTER TABLE `reviews`
  ADD CONSTRAINT `reviews_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `reviews_ibfk_2` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `service_options`
--
ALTER TABLE `service_options`
  ADD CONSTRAINT `service_options_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD CONSTRAINT `subscriptions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

