-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `od_cleans`
--

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

--
-- Table structure for table `additional_service_pricing`
--

CREATE TABLE `additional_service_pricing` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL,
  `service_id` int(11) NOT NULL,
  `base_price` decimal(10,2) NOT NULL,
  `description` text DEFAULT NULL,
  `unit` varchar(50) NOT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `is_optional` tinyint(1) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `additional_service_pricing`
--

INSERT INTO `additional_service_pricing` (`id`, `name`, `service_id`, `base_price`, `description`, `unit`, `is_active`, `is_optional`, `created_at`, `updated_at`) VALUES
(1, 'laundry', 1, 25.00, 'Washing, drying, and folding services', 'flat rate', 1, 0, '2025-09-03 09:39:58', '2025-09-03 09:39:58'),
(2, 'folding clothes', 1, 15.00, 'Professional folding and organization', 'flat rate', 1, 0, '2025-09-03 09:39:58', '2025-09-03 09:39:58'),
(3, 'fridge cleaning ', 1, 35.00, 'Deep cleaning of refrigerator interior ad arrangement of items ', 'flat rate', 1, 1, '2025-09-03 09:39:58', '2025-09-08 11:19:09'),
(4, 'Halimak E-Solutions ', 1, 20.00, 'Thorough cleaning of baseboards and trim', 'per square foot', 1, 0, '2025-09-03 09:39:58', '2025-11-19 18:40:17'),
(5, 'cabinet cleaning', 4, 30.00, 'Cleaning inside cabinets and drawers only', 'flat rate', 1, 0, '2025-09-03 09:39:58', '2025-09-08 10:17:08'),
(6, 'window cleanings', 4, 40.00, 'Cleaning of interior window surfaces', 'flat rate', 1, 0, '2025-09-03 09:39:58', '2025-09-08 12:21:02');

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

--
-- Table structure for table `admin_activity`
--

CREATE TABLE `admin_activity` (
  `id` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `action` varchar(255) NOT NULL,
  `type` varchar(50) NOT NULL,
  `details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`details`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `bookings`
--

CREATE TABLE `bookings` (
  `id` int(11) NOT NULL,
  `quote_request_id` int(11) NOT NULL,
  `scheduled_date` datetime NOT NULL,
  `status` enum('pending_schedule','scheduled','confirmed','completed','cancelled') NOT NULL DEFAULT 'pending_schedule',
  `completed_at` timestamp NULL 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 `bookings`
--

INSERT INTO `bookings` (`id`, `quote_request_id`, `scheduled_date`, `status`, `completed_at`, `created_at`, `updated_at`) VALUES
(16, 14, '2025-12-25 23:00:00', 'completed', NULL, '2025-12-14 14:10:56', '2025-12-15 14:52:47'),
(17, 13, '2025-12-16 00:00:00', 'scheduled', NULL, '2025-12-14 14:27:03', '2025-12-14 14:27:52');

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

--
-- Table structure for table `cleaners`
--

CREATE TABLE `cleaners` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `business_name` varchar(255) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `service_areas` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`service_areas`)),
  `services_offered` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`services_offered`)),
  `experience_years` int(11) DEFAULT NULL,
  `hourly_rate` decimal(10,2) DEFAULT NULL,
  `status` enum('pending','approved','rejected','suspended') DEFAULT 'pending',
  `is_available` tinyint(1) DEFAULT 1,
  `rating` decimal(3,2) DEFAULT 0.00,
  `admin_notes` text NOT NULL,
  `total_jobs` int(11) DEFAULT 0,
  `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 `cleaners`
--

INSERT INTO `cleaners` (`id`, `user_id`, `business_name`, `phone`, `address`, `service_areas`, `services_offered`, `experience_years`, `hourly_rate`, `status`, `is_available`, `rating`, `admin_notes`, `total_jobs`, `created_at`, `updated_at`) VALUES
(2, 1, '', '', '', '[]', '[]', 0, 0.00, 'approved', 0, 5.00, 'welcome to OD clean service', 0, '2025-11-27 11:59:10', '2025-12-07 14:20:56'),
(3, 3, 'OD cleaner', '08138018194', 'houston texas ', '[\"Downtown\",\"West End\"]', '[\"Residential Cleaning\",\"Deep Cleaning\"]', 2, 20.00, 'approved', 1, 0.00, 'welcome to OD Cleaning services ', 0, '2025-11-30 17:07:45', '2025-12-15 14:52:47');

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

--
-- Table structure for table `cleaner_assignments`
--

CREATE TABLE `cleaner_assignments` (
  `id` int(11) NOT NULL,
  `quote_request_id` int(11) NOT NULL,
  `cleaner_id` int(11) NOT NULL,
  `assigned_by` int(11) NOT NULL,
  `status` enum('pending','accepted','rejected','completed','cancelled') DEFAULT 'pending',
  `assigned_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `accepted_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `cleaner_notes` text DEFAULT NULL,
  `admin_notes` text DEFAULT NULL,
  `payment_status` enum('pending','paid','processing') DEFAULT 'pending',
  `payment_amount` decimal(10,2) DEFAULT NULL,
  `payment_date` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cleaner_assignments`
--

INSERT INTO `cleaner_assignments` (`id`, `quote_request_id`, `cleaner_id`, `assigned_by`, `status`, `assigned_date`, `accepted_at`, `completed_at`, `cleaner_notes`, `admin_notes`, `payment_status`, `payment_amount`, `payment_date`) VALUES
(12, 14, 3, 1, 'completed', '2025-12-14 15:04:20', '2025-12-14 15:05:23', '2025-12-15 14:52:46', NULL, NULL, 'pending', 100.00, NULL),
(13, 13, 3, 3, 'rejected', '2025-12-15 14:30:18', NULL, NULL, NULL, NULL, 'pending', NULL, NULL);

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

--
-- Table structure for table `cleaner_availability`
--

CREATE TABLE `cleaner_availability` (
  `id` int(11) NOT NULL,
  `cleaner_id` int(11) NOT NULL,
  `day_of_week` int(11) NOT NULL,
  `start_time` time DEFAULT NULL,
  `end_time` time DEFAULT NULL,
  `is_available` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `cleaner_reviews`
--

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

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

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

CREATE TABLE `notifications` (
  `id` int(11) NOT NULL,
  `type` enum('booking_reminder','new_quote','quote_accepted') NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `is_read` tinyint(1) DEFAULT 0,
  `related_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `quote_additional_services`
--

CREATE TABLE `quote_additional_services` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `quote_id` int(11) DEFAULT NULL,
  `service_type` varchar(50) NOT NULL CHECK (`service_type` in ('laundry','folding_clothes','fridge_cleaning','baseboard_cleaning','cabinet_cleaning','window_cleaning')),
  `price` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `quote_history`
--

CREATE TABLE `quote_history` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `quote_id` int(11) DEFAULT NULL,
  `field_name` varchar(100) NOT NULL,
  `old_value` text DEFAULT NULL,
  `new_value` text DEFAULT NULL,
  `changed_by` varchar(100) DEFAULT 'system',
  `changed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `quote_images`
--

CREATE TABLE `quote_images` (
  `id` int(11) NOT NULL,
  `quote_id` int(11) NOT NULL,
  `image_url` varchar(500) NOT NULL,
  `image_name` varchar(255) NOT NULL,
  `image_size` int(11) NOT NULL,
  `uploaded_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `quote_requests`
--

CREATE TABLE `quote_requests` (
  `id` int(20) UNSIGNED NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `status` enum('pending','quoted','accepted','declined','scheduled','completed','counter_offer','paid') NOT NULL DEFAULT 'pending',
  `service_type` varchar(50) NOT NULL CHECK (`service_type` in ('residential','commercial','deep','post_construction','move_in_out')),
  `property_type` varchar(50) NOT NULL CHECK (`property_type` in ('house','apartment','condo','office','retail','other')),
  `bedrooms` int(11) NOT NULL CHECK (`bedrooms` >= 0),
  `bathrooms` int(11) NOT NULL CHECK (`bathrooms` >= 0),
  `square_footage` int(11) DEFAULT NULL,
  `cleaning_type` varchar(50) NOT NULL CHECK (`cleaning_type` in ('standard','deep','post_construction')),
  `cleaning_frequency` varchar(20) DEFAULT NULL CHECK (`cleaning_frequency` in ('one_time','weekly','bi_weekly','monthly')),
  `has_pets` tinyint(1) DEFAULT 0,
  `desired_date` date DEFAULT NULL,
  `desired_date1` datetime DEFAULT NULL,
  `desired_date2` datetime DEFAULT NULL,
  `desired_date3` datetime DEFAULT NULL,
  `contact_name` varchar(255) NOT NULL,
  `contact_email` varchar(255) NOT NULL,
  `contact_phone` varchar(50) NOT NULL,
  `street_address` text NOT NULL,
  `city` varchar(100) NOT NULL,
  `state` char(2) NOT NULL,
  `zip_code` varchar(10) NOT NULL,
  `special_instructions` text DEFAULT NULL,
  `additional_details` text DEFAULT NULL,
  `base_price` decimal(10,2) DEFAULT NULL,
  `additional_services_price` decimal(10,2) DEFAULT NULL,
  `suggested_price` decimal(10,2) NOT NULL,
  `total_price` decimal(10,2) DEFAULT NULL,
  `discount` decimal(10,2) DEFAULT 0.00,
  `final_price` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `admin_notes` text NOT NULL,
  `user_notes` text NOT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `quoted_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `expires_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `quote_requests`
--

INSERT INTO `quote_requests` (`id`, `user_id`, `status`, `service_type`, `property_type`, `bedrooms`, `bathrooms`, `square_footage`, `cleaning_type`, `cleaning_frequency`, `has_pets`, `desired_date`, `desired_date1`, `desired_date2`, `desired_date3`, `contact_name`, `contact_email`, `contact_phone`, `street_address`, `city`, `state`, `zip_code`, `special_instructions`, `additional_details`, `base_price`, `additional_services_price`, `suggested_price`, `total_price`, `discount`, `final_price`, `created_at`, `admin_notes`, `user_notes`, `updated_at`, `quoted_at`, `expires_at`) VALUES
(11, 2, 'quoted', 'residential', 'house', 2, 1, 200, 'standard', 'bi_weekly', 1, NULL, '2025-12-05 00:00:00', '2025-12-06 00:00:00', '2025-12-07 00:00:00', 'mubarak abdulkadir', 'mubraksak@gmail.com', '08138018194', '19, Olubunmi Rotimi', 'Lekki', 'AR', '700321', NULL, 'hello ', 200.00, 25.00, 0.00, 200.00, 0.00, 25.00, '2025-11-28 09:39:34', 'all services', '', '2025-11-28 10:55:29', '2025-11-28 09:39:34', '2025-11-28 09:39:34'),
(12, 2, 'quoted', 'residential', 'house', 2, 1, 200, 'deep', 'one_time', 0, NULL, '2025-12-06 00:00:00', '2025-12-09 00:00:00', '2025-12-12 00:00:00', 'mubarak abdulkadir', 'mubraksak@gmail.com', '08138018194', '19, Olubunmi Rotimi', 'Lekki', 'AK', '700321', NULL, NULL, 500.00, 25.00, 0.00, 500.00, 0.00, 25.00, '2025-12-01 12:51:57', '', '', '2025-12-01 12:59:46', '2025-12-01 12:51:57', '2025-12-01 12:51:57'),
(13, 2, 'scheduled', 'residential', 'apartment', 1, 1, 200, 'standard', 'one_time', 0, NULL, '2025-12-10 00:00:00', '2025-12-17 00:00:00', '2025-12-25 00:00:00', 'mubarak abdulkadir', 'mubraksak@gmail.com', '08138018194', '19, Olubunmi Rotimi', 'Lekki', 'FL', '700321', 'HELLO', NULL, 200.00, 0.00, 285.00, 285.00, 0.00, 0.00, '2025-12-07 12:24:24', '', '', '2025-12-14 14:27:02', '2025-12-07 12:24:24', '2025-12-07 12:24:24'),
(14, 2, 'completed', 'residential', 'apartment', 3, 2, 2800, 'standard', 'one_time', 1, NULL, '2025-12-24 00:00:00', '2025-12-26 00:00:00', '2025-12-28 00:00:00', 'mubarak abdulkadir', 'mubraksak@gmail.com', '08138018194', '19, Olubunmi Rotimi', 'Lekki', 'HI', '700321', 'qwertyuiop', NULL, 350.00, 25.00, 0.00, 350.00, 0.00, 25.00, '2025-12-14 12:52:18', '', '', '2025-12-14 14:10:54', '2025-12-14 12:52:18', '2025-12-14 12:52:18');

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

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

CREATE TABLE `services` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `image_url` varchar(500) NOT NULL,
  `display_order` int(11) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `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 `services`
--

INSERT INTO `services` (`id`, `name`, `description`, `image_url`, `display_order`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'RESIDENTIAL CLEANING', 'Regular maintenance cleaning including dusting, vacuuming, mopping, and bathroom sanitization.', 'https://images.unsplash.com/photo-1648475237029-7f853809ca14?q=80&w=1171&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', 1, 1, '2025-08-24 09:23:07', '2025-09-16 09:02:01'),
(4, 'COMMERCIAL CLEANING', 'Professional commercial cleaning services to maintain a clean and productive work environment.', 'https://plus.unsplash.com/premium_photo-1661962229971-d4531b1db854?q=80&w=1255&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', 4, 1, '2025-08-24 09:23:07', '2025-09-16 09:01:41');

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

--
-- Table structure for table `service_pricing`
--

CREATE TABLE `service_pricing` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `service_type` varchar(50) NOT NULL,
  `base_price` decimal(10,2) NOT NULL,
  `price_per_bedroom` decimal(10,2) DEFAULT 0.00,
  `price_per_bathroom` decimal(10,2) DEFAULT 0.00,
  `price_per_sqft` decimal(10,6) DEFAULT 0.000000,
  `min_price` decimal(10,2) DEFAULT NULL,
  `max_price` decimal(10,2) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `service_pricing`
--

INSERT INTO `service_pricing` (`id`, `service_type`, `base_price`, `price_per_bedroom`, `price_per_bathroom`, `price_per_sqft`, `min_price`, `max_price`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'standard', 80.00, 10.00, 15.00, 0.050000, 50.00, 300.00, 1, '2025-09-03 09:39:41', '2025-09-03 09:39:41'),
(2, 'deep', 150.00, 20.00, 25.00, 0.080000, 100.00, 500.00, 1, '2025-09-03 09:39:41', '2025-09-03 09:39:41'),
(3, 'post_construction', 200.00, 30.00, 35.00, 0.120000, 150.00, 800.00, 1, '2025-09-03 09:39:41', '2025-09-03 09:39:41');

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

--
-- Table structure for table `site_config`
--

CREATE TABLE `site_config` (
  `id` int(11) NOT NULL,
  `hero_title` varchar(500) NOT NULL,
  `hero_subtitle` text NOT 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 `site_config`
--

INSERT INTO `site_config` (`id`, `hero_title`, `hero_subtitle`, `created_at`, `updated_at`) VALUES
(1, 'OD cleaning services', 'let clean your home extra', '2025-08-24 09:23:07', '2025-09-07 18:18:09');

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

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

CREATE TABLE `transactions` (
  `id` int(11) NOT NULL,
  `quote_id` int(11) NOT NULL,
  `stripe_payment_intent_id` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'usd',
  `status` enum('pending','succeeded','failed','refunded') NOT NULL,
  `customer_email` varchar(255) NOT NULL,
  `customer_name` varchar(255) DEFAULT NULL,
  `failure_message` 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 `transactions`
--

INSERT INTO `transactions` (`id`, `quote_id`, `stripe_payment_intent_id`, `amount`, `currency`, `status`, `customer_email`, `customer_name`, `failure_message`, `created_at`, `updated_at`) VALUES
(12, 14, 'pi_3SeG0J5ODYdZSy5G1AI3iUiu', 350.00, 'usd', 'succeeded', 'mubraksak@gmail.com', 'mubarak abdulkadir', NULL, '2025-12-14 14:10:55', '2025-12-14 14:10:55'),
(13, 13, 'pi_3SeGFx5ODYdZSy5G14hmy5xo', 285.00, 'usd', 'succeeded', 'mubraksak@gmail.com', 'mubarak abdulkadir', NULL, '2025-12-14 14:27:02', '2025-12-14 14:27:02');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `additional_service_pricing`
--
ALTER TABLE `additional_service_pricing`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `service_type` (`name`);

--
-- Indexes for table `admin_activity`
--
ALTER TABLE `admin_activity`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_admin_activity_admin_id` (`admin_id`),
  ADD KEY `idx_admin_activity_created_at` (`created_at`);

--
-- Indexes for table `bookings`
--
ALTER TABLE `bookings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quote_request_id` (`quote_request_id`),
  ADD KEY `idx_bookings_status` (`status`),
  ADD KEY `idx_bookings_scheduled_date` (`scheduled_date`),
  ADD KEY `idx_bookings_quote_id` (`quote_request_id`);

--
-- Indexes for table `cleaners`
--
ALTER TABLE `cleaners`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_user_cleaner` (`user_id`),
  ADD KEY `idx_cleaners_status` (`status`);
ALTER TABLE `cleaners` ADD FULLTEXT KEY `business_name` (`business_name`);
ALTER TABLE `cleaners` ADD FULLTEXT KEY `business_name_2` (`business_name`);

--
-- Indexes for table `cleaner_assignments`
--
ALTER TABLE `cleaner_assignments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_cleaner_assignments_status` (`status`),
  ADD KEY `idx_cleaner_assignments_cleaner_id` (`cleaner_id`),
  ADD KEY `idx_cleaner_assignments_payment_status` (`payment_status`);

--
-- Indexes for table `cleaner_availability`
--
ALTER TABLE `cleaner_availability`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_cleaner_availability_cleaner_day` (`cleaner_id`,`day_of_week`);

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

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

--
-- Indexes for table `quote_additional_services`
--
ALTER TABLE `quote_additional_services`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `quote_id` (`quote_id`,`service_type`),
  ADD KEY `idx_quote_services` (`quote_id`);

--
-- Indexes for table `quote_history`
--
ALTER TABLE `quote_history`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_quote_history` (`quote_id`,`changed_at`);

--
-- Indexes for table `quote_images`
--
ALTER TABLE `quote_images`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_quote_images_quote_id` (`quote_id`);

--
-- Indexes for table `quote_requests`
--
ALTER TABLE `quote_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_quote_user` (`user_id`),
  ADD KEY `idx_quote_created` (`created_at`),
  ADD KEY `idx_quotes_status` (`status`),
  ADD KEY `idx_quotes_user_id` (`user_id`),
  ADD KEY `idx_quotes_created_at` (`created_at`),
  ADD KEY `idx_quotes_desired_date` (`desired_date`),
  ADD KEY `idx_quote_requests_status` (`status`),
  ADD KEY `idx_quote_requests_created_at` (`created_at`);
ALTER TABLE `quote_requests` ADD FULLTEXT KEY `idx_quotes_search` (`special_instructions`,`admin_notes`);

--
-- Indexes for table `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_services_active` (`is_active`);
ALTER TABLE `services` ADD FULLTEXT KEY `idx_services_search` (`name`,`description`);

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

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

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `stripe_payment_intent_id` (`stripe_payment_intent_id`),
  ADD KEY `idx_quote_id` (`quote_id`),
  ADD KEY `idx_stripe_payment_intent_id` (`stripe_payment_intent_id`),
  ADD KEY `idx_customer_email` (`customer_email`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `additional_service_pricing`
--
ALTER TABLE `additional_service_pricing`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `quote_additional_services`
--
ALTER TABLE `quote_additional_services`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `quote_history`
--
ALTER TABLE `quote_history`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `quote_requests`
--
ALTER TABLE `quote_requests`
  MODIFY `id` int(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

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

--
-- AUTO_INCREMENT for table `service_pricing`
--
ALTER TABLE `service_pricing`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `admin_activity`
--
ALTER TABLE `admin_activity`
  ADD CONSTRAINT `admin_activity_ibfk_1` FOREIGN KEY (`admin_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `cleaner_assignments`
--
ALTER TABLE `cleaner_assignments`
  ADD CONSTRAINT `fk_cleaner_assignments_cleaner` FOREIGN KEY (`cleaner_id`) REFERENCES `cleaners` (`id`) ON DELETE CASCADE;
COMMIT;

