-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 26, 2026 at 03:40 AM
-- Server version: 11.4.10-MariaDB
-- PHP Version: 8.3.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `ngla4195_lock`
--

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

--
-- Table structure for table `app_settings`
--

CREATE TABLE `app_settings` (
  `id` bigint(20) NOT NULL,
  `key_name` varchar(100) NOT NULL,
  `value` longtext DEFAULT NULL,
  `description` text DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `app_settings`
--

INSERT INTO `app_settings` (`id`, `key_name`, `value`, `description`, `updated_at`) VALUES
(1, 'cgu_text', 'Conditions générales d\'utilisation\n\n1. Objet\nL\'application permet de rechercher des services, consulter des disponibilités, réserver et payer selon les fonctionnalités proposées.\n\n2. Compte utilisateur\nL\'utilisateur est responsable des informations fournies et de l\'utilisation de son compte.\n\n3. Données et confidentialité\nCertaines données peuvent être nécessaires au bon fonctionnement (ex: profil, préférences).\n\n4. Modifications \nCes conditions peuvent évoluer. La version affichée dans l\'application fait foi.\nDavid', 'Texte CGU affiché dans l\'application', '2026-02-25 11:14:23'),
(4, 'support_email', 'contact@lock-243.com', NULL, '2026-02-21 03:19:49'),
(5, 'support_whatsapp', '+243900000', NULL, '2026-02-25 11:15:11');

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

--
-- Table structure for table `audit_logs`
--

CREATE TABLE `audit_logs` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `action` varchar(100) NOT NULL,
  `table_name` varchar(100) DEFAULT NULL,
  `record_id` int(11) DEFAULT NULL,
  `old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`old_values`)),
  `new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`new_values`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

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

CREATE TABLE `bookings` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `payment_id` bigint(20) DEFAULT NULL,
  `booking_type` varchar(50) NOT NULL,
  `item_id` bigint(20) DEFAULT NULL,
  `start_date` datetime NOT NULL,
  `end_date` datetime NOT NULL,
  `status` varchar(30) DEFAULT 'pending',
  `special_requests` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `bookings`
--

INSERT INTO `bookings` (`id`, `user_id`, `establishment_id`, `payment_id`, `booking_type`, `item_id`, `start_date`, `end_date`, `status`, `special_requests`, `created_at`, `updated_at`) VALUES
(8, 6, 9, NULL, 'vehicle_rental', 5, '2026-02-15 00:00:00', '2026-02-21 23:59:59', 'pending', '{\"mode\":\"day\",\"with_driver\":false,\"with_deposit\":false}', '2026-02-15 10:29:13', '2026-02-15 10:29:13'),
(9, 6, 7, NULL, 'room', 4, '2026-02-15 14:00:00', '2026-02-16 11:00:00', 'pending', '{\"adults\":1,\"children\":0,\"notes\":null}', '2026-02-15 10:40:21', '2026-02-15 10:40:21'),
(11, 6, 7, NULL, 'room', 2, '2026-02-20 14:00:00', '2026-02-24 11:00:00', 'cancelled', '{\"adults\":1,\"children\":0,\"notes\":null}', '2026-02-17 15:16:27', '2026-02-18 03:06:16'),
(12, 6, 7, NULL, 'room', 3, '2026-02-18 14:00:00', '2026-02-19 11:00:00', 'pending', '{\"adults\":1,\"children\":0,\"notes\":null}', '2026-02-18 02:17:58', '2026-02-18 02:17:58'),
(13, 6, 7, NULL, 'room', 1, '2026-02-18 14:00:00', '2026-02-19 11:00:00', 'pending', '{\"adults\":1,\"children\":1,\"notes\":null}', '2026-02-18 02:19:29', '2026-02-18 02:19:29'),
(14, 6, 7, NULL, 'room', 2, '2026-02-18 14:00:00', '2026-02-19 11:00:00', 'pending', '{\"adults\":1,\"children\":0,\"notes\":null}', '2026-02-18 02:49:36', '2026-02-18 02:49:36'),
(15, 6, 7, NULL, 'room', 4, '2026-02-18 14:00:00', '2026-02-19 11:00:00', 'confirmed', '{\"adults\":1,\"children\":3,\"notes\":null}', '2026-02-18 09:13:13', '2026-02-18 09:27:03'),
(16, 12, 9, 9, 'vehicle_rental', 6, '2026-02-25 00:00:00', '2026-02-27 23:59:59', 'confirmed', '{\"mode\":\"day\",\"with_driver\":false,\"with_deposit\":false}', '2026-02-25 08:31:43', '2026-02-25 08:31:43'),
(17, 14, 7, 10, 'room', 2, '2026-03-08 14:00:00', '2026-03-12 11:00:00', 'confirmed', '{\"adults\":2,\"children\":2,\"notes\":null}', '2026-02-25 10:46:53', '2026-02-25 10:46:53'),
(18, 14, 7, 11, 'room', 2, '2026-02-25 14:00:00', '2026-02-26 11:00:00', 'confirmed', '{\"adults\":1,\"children\":1,\"notes\":null}', '2026-02-25 19:33:40', '2026-02-25 19:33:40');

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

--
-- Table structure for table `cities`
--

CREATE TABLE `cities` (
  `id` bigint(20) NOT NULL,
  `name` varchar(100) NOT NULL,
  `province` varchar(50) DEFAULT NULL,
  `country` varchar(50) DEFAULT 'RD Congo',
  `is_active` tinyint(1) DEFAULT 1,
  `center_lat` decimal(10,8) DEFAULT NULL,
  `center_lng` decimal(11,8) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `cities`
--

INSERT INTO `cities` (`id`, `name`, `province`, `country`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'Lubumbashi', 'Haut-Katanga', 'RD Congo', 1, '2026-01-28 20:53:09', '2026-01-28 20:53:11'),
(2, 'Likasis', 'Haut-katanga', 'RDC', 1, '2026-02-19 13:56:43', '2026-02-25 11:12:33'),
(3, 'kin', 'kin', 'RDC', 1, '2026-02-25 11:13:27', '2026-02-25 11:13:27');

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

--
-- Table structure for table `currencies`
--

CREATE TABLE `currencies` (
  `id` bigint(20) NOT NULL,
  `code` varchar(3) NOT NULL,
  `name` varchar(100) NOT NULL,
  `symbol` varchar(5) NOT NULL,
  `exchange_rate` decimal(10,4) NOT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `is_default` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `currencies`
--

INSERT INTO `currencies` (`id`, `code`, `name`, `symbol`, `exchange_rate`, `is_active`, `is_default`, `created_at`, `updated_at`) VALUES
(1, 'USD', 'Dollar Américain', '$', 1.0000, 1, 0, '2026-01-28 12:56:48', '2026-01-28 13:13:14'),
(2, 'CDF', 'Franc Congolais', 'FC', 2800.0000, 1, 1, '2026-01-28 12:59:53', '2026-01-28 13:13:14');

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

--
-- Table structure for table `establishments`
--

CREATE TABLE `establishments` (
  `id` bigint(20) NOT NULL,
  `provider_id` bigint(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `type` enum('hotel','restaurant','nightclub','vehicle_rental','other') NOT NULL,
  `description` text DEFAULT NULL,
  `address` text NOT NULL,
  `city_id` bigint(20) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`images`)),
  `background` varchar(255) DEFAULT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `rating` decimal(3,2) DEFAULT 0.00,
  `status` enum('active','inactive','pending','suspended') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `establishments`
--

INSERT INTO `establishments` (`id`, `provider_id`, `name`, `type`, `description`, `address`, `city_id`, `phone`, `email`, `website`, `logo`, `images`, `background`, `latitude`, `longitude`, `rating`, `status`, `created_at`, `updated_at`) VALUES
(7, 5, 'Sulfrate Hotel', 'hotel', '🌿 Sulfirate Hotel – L’élégance du village, le confort d’aujourd’hui 🌿\r\n\r\nNiché dans un cadre paisible et authentique, Sulfirate Hotel vous invite à vivre une expérience unique, où le charme du village traditionnel rencontre le raffinement moderne.\r\nSes chambres, inspirées de huttes élégamment revisitées, rendent hommage à nos racines tout en offrant un confort haut de gamme.\r\n\r\nChaque hutte est un cocon de sérénité : des matériaux naturels, une architecture chaleureuse et une atmosphère apaisante qui vous reconnectent à l’essentiel. Ici, le temps ralentit, l’air est plus doux, et chaque réveil ressemble à une évasion.\r\n\r\nQue vous soyez en quête de repos, d’inspiration ou d’un séjour hors du commun, Sulfirate Hotel vous promet des nuits paisibles, des journées lumineuses et des souvenirs inoubliables.\r\n\r\n🌅 Dormez au rythme du village, rêvez dans le confort moderne.\r\nBienvenue à Sulfirate Hotel, là où la tradition devient luxe.', '01 Aenue Tilleules , Lubumbashi, RDC', 1, '+243971342218', 'sulfurehotel@gmail.com', 'https://www.sulfiratehotel.com', '/public/img/logos/logo_7_sulfrate_hotel_1771159393.jpeg', '[\"/public/img/establishments/establishment_7_sulfrate_hotel_1771159353.jfif\", \"/public/img/establishments/establishment_7_sulfrate_hotel_1771159353.jfif\"]', '/public/img/establishments/establishment_7_sulfrate_hotel_1771159353.jfif', -11.66766300, 27.46934400, 3.50, 'active', '2026-01-28 19:32:37', '2026-02-25 10:45:15'),
(9, 7, 'haraka ways', 'vehicle_rental', 'Nous proposons des services de location de véhicules fiables et confortables, adaptés à tous vos besoins, que ce soit pour vos déplacements professionnels ou personnels.\r\nVotre mobilité, notre priorité. Louez des véhicules modernes, bien entretenus et à des prix compétitifs, en toute simplicité.', '13 Av lily Mwamba, Golf Kabula meshi, Lubumbashi, RDC', 1, '+243971342218', 'kyle.masangu@heaventech.net', 'https://www.harakaways.com', '/public/img/logos/logo_7_sulfrate_hotel_1771159393.jpeg', '[\"/public/img/establishments/establishment_7_sulfrate_hotel_1771159353.jfif\",\"/public/img/establishments/establishment_7_sulfrate_hotel_1771159353.jfif\"]', '/public/img/establishments/establishment_7_sulfrate_hotel_1771159353.jfif', -11.66443600, 27.43829700, 0.00, 'active', '2026-02-02 09:57:53', '2026-02-22 05:22:54'),
(10, 8, 'Raiser Corp 1234', 'restaurant', 'Avec nous vous pouvez commander toutes les bouffes du monde et soit venir manger sur place ou nous vous livrons partout a lubumbashi', 'Golf Kabulameshi', NULL, '+24397456691', 'capitainemarvel@gmail.com', 'https://www.raisercorp.com', '/public/img/logos/logo_10_raiser_corp_1234_1771165210.jpeg', NULL, '/public/img/establishments/establishment_7_sulfrate_hotel_1771159353.jfif', -11.66273300, 27.44450600, 3.00, 'active', '2026-02-15 14:19:35', '2026-02-25 08:30:04');

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

--
-- Table structure for table `favorites`
--

CREATE TABLE `favorites` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `target_type` varchar(50) NOT NULL,
  `target_id` bigint(20) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `favorites`
--

INSERT INTO `favorites` (`id`, `user_id`, `target_type`, `target_id`, `created_at`) VALUES
(0, 6, 'provider', 9, '2026-02-15 09:39:26'),
(0, 6, 'vehicle', 5, '2026-02-15 09:51:59'),
(0, 12, 'provider', 10, '2026-02-25 08:29:56'),
(0, 14, 'provider', 7, '2026-02-25 10:45:29');

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

--
-- Table structure for table `instant_orders`
--

CREATE TABLE `instant_orders` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`items`)),
  `total_amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `status` enum('pending','confirmed','preparing','ready','delivered','cancelled') DEFAULT 'pending',
  `delivery_location` varchar(255) DEFAULT NULL,
  `special_instructions` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `instant_services`
--

CREATE TABLE `instant_services` (
  `id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `category` varchar(50) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `preparation_time` int(11) DEFAULT NULL,
  `is_available` tinyint(4) NOT NULL DEFAULT 1,
  `image_url` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `instant_services`
--

INSERT INTO `instant_services` (`id`, `establishment_id`, `name`, `description`, `category`, `price`, `currency`, `preparation_time`, `is_available`, `image_url`, `created_at`, `updated_at`) VALUES
(1, 10, 'Salade du chef', '🥗 Composition\nViandes & protéines : escalopes de poulet rôties, jambon blanc en dés\n\nLégumes & verdure : cœur de romaine, cœur de feuille de chêne, céleri, poivron rouge\n\nFéculents : pommes de terre cuites à l’eau\n\nFromage : emmental en cubes\n\nAssaisonnement : sauce à base de moutarde forte, crème liquide, huile d’olive, vinaigre de xérès, sel, poivre, feuilles de céleri', 'Salades', 33000.00, 'CDF', 45, 1, '/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif', '2026-02-15 14:26:07', '2026-02-21 13:03:30'),
(2, 10, 'Tiramisous', 'IL Y A RIEN A DECRIRE', 'Grillades', 28000.00, 'CDF', 30, 1, '/public/uploads/menu_items/menu_6991d93d92cb36.24256131.jpeg', '2026-02-15 14:33:33', '2026-02-15 14:33:33'),
(3, 10, 'Poulet rôti aux herbes de Provence', 'Un poulet tendre rôti au four, parfumé aux herbes de Provence, accompagné de pommes de terre croustillantes et de légumes de saison.', 'Plats principaux', 45000.00, 'USD', 20, 1, '/public/uploads/menu_items/menu_69998920b18822.75876924.jfif', '2026-02-21 10:29:52', '2026-02-22 05:06:26'),
(4, 10, 'Tilapia grillé façon congolaise', 'Filet de tilapia frais, grillé au charbon de bois, relevé d’une sauce tomate épicée et accompagné de bananes plantains frites.', 'Plats principaux', 22000.00, 'CDF', 25, 1, '/public/uploads/menu_items/menu_699997e7e30c24.50079190.jfif', '2026-02-21 11:32:55', '2026-02-21 11:32:55');

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

--
-- Table structure for table `modules`
--

CREATE TABLE `modules` (
  `id` bigint(20) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `route` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `sort_order` int(11) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `nightclub_areas`
--

CREATE TABLE `nightclub_areas` (
  `id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `area_type` enum('vip','terrace','dance_floor','bar','lounge','private') NOT NULL,
  `capacity` int(11) NOT NULL,
  `minimum_spend` decimal(10,2) DEFAULT NULL,
  `price_per_person` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `has_bottle_service` tinyint(1) DEFAULT 0,
  `has_dedicated_staff` tinyint(1) DEFAULT 0,
  `images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`images`)),
  `is_available` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `notification_provider`
--

CREATE TABLE `notification_provider` (
  `id` bigint(20) NOT NULL,
  `provider_id` bigint(20) NOT NULL,
  `type` enum('booking','payment','review','system','promotion') NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data`)),
  `is_read` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `read_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `notification_provider`
--

INSERT INTO `notification_provider` (`id`, `provider_id`, `type`, `title`, `message`, `data`, `is_read`, `created_at`, `read_at`) VALUES
(1, 5, 'system', 'Je teste au fais', 'Voila une derniere fois', NULL, 1, '2026-01-31 20:56:40', '2026-01-31 20:57:02');

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

--
-- Table structure for table `notification_user`
--

CREATE TABLE `notification_user` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `type` enum('booking','payment','review','system','promotion') NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data`)),
  `is_read` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `read_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `notification_user`
--

INSERT INTO `notification_user` (`id`, `user_id`, `type`, `title`, `message`, `data`, `is_read`, `created_at`, `read_at`) VALUES
(1, 12, 'booking', 'Réservation confirmée', 'Ta réservation chez haraka ways (Toyota camri 50) a été confirmée.', '{\"kind\":\"booking_confirmed\",\"booking_id\":16,\"provider_name\":\"haraka ways\",\"item_name\":\"Toyota camri 50\"}', 0, '2026-02-25 08:32:01', NULL),
(2, 14, 'booking', 'Réservation confirmée', 'Ta réservation chez Sulfrate Hotel (double) a été confirmée.', '{\"kind\":\"booking_confirmed\",\"booking_id\":17,\"provider_name\":\"Sulfrate Hotel\",\"item_name\":\"double\"}', 0, '2026-02-25 10:47:56', NULL),
(3, 14, 'booking', 'Réservation confirmée', 'Ta réservation chez Sulfrate Hotel (double) a été confirmée.', '{\"kind\":\"booking_confirmed\",\"booking_id\":18,\"provider_name\":\"Sulfrate Hotel\",\"item_name\":\"double\"}', 0, '2026-02-25 19:34:22', NULL),
(4, 6, 'booking', 'Réservation confirmée', 'Ta réservation chez Sulfrate Hotel (suite) a été confirmée.', '{\"kind\":\"booking_confirmed\",\"booking_id\":15,\"provider_name\":\"Sulfrate Hotel\",\"item_name\":\"suite\"}', 0, '2026-02-26 01:34:47', NULL),
(5, 6, 'booking', 'Réservation en attente', 'Ta réservation chez Sulfrate Hotel (double) est passée sans confirmation.', '{\"kind\":\"booking_pending_past\",\"booking_id\":14,\"provider_name\":\"Sulfrate Hotel\",\"item_name\":\"double\"}', 0, '2026-02-26 01:34:47', NULL),
(6, 6, 'booking', 'Réservation en attente', 'Ta réservation chez Sulfrate Hotel (suite) est passée sans confirmation.', '{\"kind\":\"booking_pending_past\",\"booking_id\":13,\"provider_name\":\"Sulfrate Hotel\",\"item_name\":\"suite\"}', 0, '2026-02-26 01:34:48', NULL),
(7, 6, 'booking', 'Réservation en attente', 'Ta réservation chez Sulfrate Hotel (presidential) est passée sans confirmation.', '{\"kind\":\"booking_pending_past\",\"booking_id\":12,\"provider_name\":\"Sulfrate Hotel\",\"item_name\":\"presidential\"}', 0, '2026-02-26 01:34:48', NULL);

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

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

CREATE TABLE `payments` (
  `id` bigint(20) NOT NULL,
  `quantity` int(11) DEFAULT 1,
  `unit_price` decimal(10,2) NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `payment_method` varchar(30) NOT NULL,
  `payment_status` varchar(30) DEFAULT NULL,
  `transaction_ref` varchar(255) DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `payments` (`id`, `quantity`, `unit_price`, `total_amount`, `currency`, `payment_method`, `payment_status`, `transaction_ref`, `paid_at`, `created_at`, `updated_at`) VALUES
(1, 1, 200000.00, 800000.00, 'USD', 'cash', 'paid', NULL, '2026-01-31 12:41:25', '2026-01-31 12:41:25', '2026-02-19 14:19:44'),
(2, 1, 560000.00, 560000.00, 'USD', 'cash', 'paid', NULL, '2026-02-01 07:50:57', '2026-02-01 07:50:57', '2026-02-19 14:19:57'),
(3, 1, 150000.00, 150000.00, 'USD', 'cash', 'paid', NULL, '2026-02-01 08:03:40', '2026-02-01 08:03:40', '2026-02-19 14:20:04'),
(4, 1, 800000.00, 1600000.00, 'USD', 'cash', 'paid', NULL, '2026-02-02 07:04:14', '2026-02-02 07:04:14', '2026-02-19 14:20:07'),
(5, 4, 45.00, 240.00, 'USD', 'cash', 'paid', NULL, '2026-02-03 22:58:19', '2026-02-03 22:58:19', '2026-02-19 14:20:12'),
(6, 2, 45.00, 120.00, 'USD', 'cash', 'paid', NULL, '2026-02-03 23:03:35', '2026-02-03 23:03:35', '2026-02-19 14:20:10'),
(7, 1, 55.00, 70.00, 'USD', 'cash', 'paid', NULL, '2026-02-03 23:12:10', '2026-02-03 23:12:10', '2026-02-19 14:20:00'),
(8, 1, 29000.00, 29000.00, 'USD', 'cash', 'paid', 'INV-20260215-0D5A49', NULL, '2026-02-15 14:29:04', '2026-02-19 14:19:53'),
(9, 3, 45.00, 135.00, 'USD', 'test', 'paid', 'LOCAL_BOOKING:16', '2026-02-25 08:31:43', '2026-02-25 08:31:43', '2026-02-25 08:31:43'),
(10, 4, 200000.00, 800000.00, 'USD', 'test', 'paid', 'LOCAL_BOOKING:17', '2026-02-25 10:46:53', '2026-02-25 10:46:53', '2026-02-25 10:46:53'),
(11, 1, 200000.00, 200000.00, 'USD', 'test', 'paid', 'LOCAL_BOOKING:18', '2026-02-25 19:33:40', '2026-02-25 19:33:40', '2026-02-25 19:33:40');

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

--
-- Table structure for table `serdipay_transactions`
--

CREATE TABLE `serdipay_transactions` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `payment_id` bigint(20) NOT NULL,
  `booking_id` bigint(20) NOT NULL,
  `merchant_reference` varchar(255) NOT NULL,
  `provider_reference` varchar(255) DEFAULT NULL,
  `status` varchar(30) NOT NULL DEFAULT 'pending',
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `currency` varchar(3) NOT NULL DEFAULT 'USD',
  `request_payload` mediumtext DEFAULT NULL,
  `response_payload` mediumtext DEFAULT NULL,
  `callback_payload` mediumtext DEFAULT NULL,
  `error_message` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_serdipay_transactions_reference` (`merchant_reference`),
  KEY `idx_serdipay_transactions_payment` (`payment_id`),
  KEY `idx_serdipay_transactions_booking` (`booking_id`),
  KEY `idx_serdipay_transactions_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `providers`
--

CREATE TABLE `providers` (
  `id` bigint(20) NOT NULL,
  `all_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `firebase_uid` varchar(255) DEFAULT NULL,
  `role` enum('admin','utilisateur') NOT NULL DEFAULT 'utilisateur',
  `status` enum('active','inactive','suspended') NOT NULL DEFAULT 'active',
  `email_verified` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `last_login` timestamp NULL DEFAULT NULL,
  `profile_image` varchar(255) DEFAULT NULL,
  `statut` enum('actif','inactif') DEFAULT 'actif',
  `type_etablissement` enum('hotel','restaurant','nightclub','vehicle_rental','other') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `providers`
--

INSERT INTO `providers` (`id`, `all_name`, `email`, `password_hash`, `phone`, `firebase_uid`, `role`, `status`, `email_verified`, `created_at`, `updated_at`, `last_login`, `profile_image`, `statut`, `type_etablissement`) VALUES
(1, 'ILUNGA NGOIE', 'ilunga@gmail.com', '$2y$10$C9B4teCKC7Hxj0Yh7uxoJe7vQjC9/KiHAyGOg5w08WJZ2.lhOCeJW', '+2439755698', '', 'utilisateur', 'inactive', 0, '2026-01-28 08:14:15', '2026-01-28 12:46:05', NULL, NULL, 'actif', 'restaurant'),
(5, 'Kyle-chris Masangu', 'kylechrismk243@gmail.com', '$2y$10$j.4pNKtC51s9wPw0RPMt3OBNnm7NyHPndQ50OdcxmMVwsoZuaX2A6', '+243971342218', 'provider_6979da5325637_1769593427', 'admin', 'active', 0, '2026-01-28 08:43:47', '2026-02-24 21:16:47', '2026-02-24 21:16:47', '6979da53252ed-download (8).jfif', 'actif', 'hotel'),
(6, 'Alexander Fleming', 'alexenderflem@gmail.com', '$2y$10$5ATNYcz34uDegHVJQ02NmOqKQ1acIXzFvrCBWuR5zRSVWFoW9WxFa', '+243974563225', NULL, 'admin', 'active', 0, '2026-01-31 09:17:18', '2026-02-01 08:25:57', NULL, NULL, 'actif', 'vehicle_rental'),
(7, 'Capitaine Marvel', 'capitainemarvel@gmail.com', '$2y$10$TCLe5M/kBk3oMdfRAkQ2S.BRrNTyxiL7ZxJgWobnnRG04SbkhRGuy', '+24397456691', 'P138434364', 'admin', 'active', 1, '2026-02-01 08:29:02', '2026-02-15 14:58:08', '2026-02-15 14:58:08', '697f1cde02a27-avatar-5.jpg', 'actif', 'vehicle_rental'),
(8, 'Charles Darwin', 'charaledarwine@gmail.com', '$2y$12$8VLPpNLQhHojqIHoNgO1BeO8LtV7MpQkJOUygGkrMcGDE8TIi1yPu', '+243996776470', 'P409345668', 'admin', 'active', 1, '2026-02-15 14:16:12', '2026-02-21 11:28:11', '2026-02-21 11:28:11', '6991d52c585ca-download (30).jfif', 'actif', 'restaurant');

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

--
-- Table structure for table `registration_requests`
--

CREATE TABLE `registration_requests` (
  `id` bigint(20) NOT NULL,
  `first_name` varchar(100) NOT NULL,
  `last_name` varchar(100) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `establishment_name` varchar(255) NOT NULL,
  `establishment_type` varchar(50) NOT NULL,
  `city` varchar(100) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `password_hash` varchar(255) NOT NULL,
  `message` text DEFAULT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `admin_notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `registration_requests`
--

INSERT INTO `registration_requests` (`id`, `first_name`, `last_name`, `email`, `phone`, `establishment_name`, `establishment_type`, `city`, `address`, `password_hash`, `message`, `status`, `admin_notes`, `created_at`, `updated_at`) VALUES
(1, 'Albert', 'Einstein', 'albert.einstein@relativity.com', '+243 812 345 678', 'Institute of Advanced Studies', 'university', 'Kinshasa', 'Avenue des Sciences, Quartier Matonge', '$2y$10$EinsteinRelativity1234567890abcdef', 'Je souhaite rejoindre votre plateforme pour gérer notre institut de recherche. Nous sommes spécialisés en physique théorique et mathématiques avancées. Notre établissement propose des cours de niveau doctoral et des conférences internationales.', 'pending', 'Excellent profil scientifique avec réputation internationale.', '2026-01-28 09:23:21', '2026-01-28 09:23:21'),
(2, 'Marie', 'Curie', 'kylechrismk243@gmail.com', '+243 823 456 789', 'Institut Curie de Recherche', 'research_center', 'Lubumbashi', 'Avenue de la Découverte, Centre-ville', '$2y$10$CurieRadioactivity9876543210fedcba', 'Notre centre de recherche se spécialise en radioactivité et chimie médicale. Nous avons besoin d\'une solution moderne pour gérer nos laboratoires et les inscriptions des chercheurs.', 'approved', 'Prix Nobel, expertise reconnue en radioactivité.\nEmail envoyé le 2026-01-28 13:19:17\nSujet: Re: Votre demande d\'admission - Institut Curie de Recherche\nEmail envoyé le 2026-01-28 13:39:02\nSujet: LOCK - Notification concernant votre demande d\'admission\nEmail envoyé le 2026-01-28 13:39:08\nSujet: LOCK - Notification concernant votre demande d\'admission', '2026-01-28 09:23:21', '2026-01-28 10:39:08'),
(3, 'Isaac', 'Newton', 'isaac.newton@gravity.uk', '+243 834 567 890', 'Royal Academy of Sciences', 'university', 'Kinshasa-Gombe', 'Boulevard de la Physique, 1234', '$2y$10$NewtonGravity1234567890abcdef', 'L\'Académie Royale des Sciences est une institution prestigieuse dédiée à l\'étude de la physique, des mathématiques et des sciences naturelles. Nous cherchons une plateforme pour gérer nos bibliothèques et nos programmes éducatifs.', 'rejected', 'Fondateur du calcul infinitésimal et lois de la gravitation.', '2026-01-28 09:23:21', '2026-01-28 09:56:11'),
(4, 'Louis', 'Pasteur', 'louis.pasteur@microbes.fr', '+243 845 678 901', 'Institut Pasteur de Kinshasa', 'research_center', 'Kinshasa', 'Avenue de la Santé, Commune de la Matete', '$2y$10$PasteurMicrobes1234567890abcdef', 'Notre institut est dédié à la recherche microbiologique et à la vaccination. Nous menons des études sur les maladies tropicales et développons des traitements innovants pour la population congolaise.', 'approved', 'Pionnier de la vaccination et de la microbiologie médicale.', '2026-01-28 09:23:21', '2026-01-28 09:47:13'),
(5, 'Jean-Claude', 'Mukendi', 'jc.mukendi@hotelroyal.cd', '+243 812 345 678', 'Hôtel Royal Kin Plaza', 'hotel', 'Kinshasa', 'Boulevard du 30 Juin, Gombe', '$2y$10$HotelRoyalKin1234567890abcdef', 'Nous souhaitons intégrer votre plateforme afin de gérer les réservations, les chambres et le personnel de notre hôtel. Notre établissement accueille principalement des hommes d’affaires et des délégations officielles.', 'rejected', 'Hôtel haut standing situé en plein centre-ville.', '2026-01-28 10:07:12', '2026-01-28 10:41:50'),
(6, 'Chantal', 'Ilunga', 'chantal.ilunga@hotelpalace.cd', '+243 823 456 789', 'Lubumbashi Palace Hôtel', 'hotel', 'Lubumbashi', 'Avenue Lumumba, Centre-ville', '$2y$10$LubumbashiPalace9876543210fedcba', 'Notre hôtel dispose de 45 chambres, d’un restaurant et d’une salle de conférence. Nous cherchons une solution moderne pour la gestion des réservations et de la facturation.', 'pending', 'Hôtel moyen standing avec forte clientèle locale.', '2026-01-28 10:07:12', '2026-01-28 10:07:12'),
(7, 'Patrick', 'Kabeya', 'patrick.kabeya@hotellacvert.cd', '+243 834 567 890', 'Hôtel Lac Vert', 'hotel', 'Goma', 'Route du Lac Kivu, Quartier Himbi', '$2y$10$HotelLacVert1234567890abcdef', 'L’Hôtel Lac Vert accueille des touristes et des ONG internationales. Nous avons besoin d’un système fiable pour la gestion des chambres, des paiements et des rapports journaliers.', 'pending', 'Hôtel touristique avec vue sur le lac Kivu.', '2026-01-28 10:07:12', '2026-01-28 10:07:12'),
(8, 'Rosine', 'Mbuyi', 'rosine.mbuyi@hotelbaobab.cd', '+243 845 678 901', 'Hôtel Baobab Matadi', 'hotel', 'Matadi', 'Avenue du Port, Quartier Ville-Basse', '$2y$10$HotelBaobabMatadi1234567890abcdef', 'Notre hôtel vise à améliorer la gestion des clients, des réservations et du service de restauration. Nous souhaitons digitaliser l’ensemble de nos opérations.', 'pending', 'Hôtel en pleine croissance dans la zone portuaire.', '2026-01-28 10:07:12', '2026-01-28 10:07:12'),
(9, 'Kyle-chris', 'Masangu', 'kyle.masangu@heaventech.net', '+243971342218', 'PRAD MARKET', 'restaurant', 'Lubumbashi', '14 B Boulebard katumbi, Lubumbashi, RDC', '$2y$12$1RLjM17Vci8oLpI58KXKJun6hKdnNOBv71RFHyo0HKhvi2ievDkMa', 'Créer ta propre icône personnalisée : tu peux ajouter un SVG TikTok dans ta librairie d’icônes et l’appeler comme si c’était une classe Font Awesome.', 'pending', NULL, '2026-02-18 10:51:46', '2026-02-18 10:51:46');

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

--
-- Table structure for table `restaurant_areas`
--

CREATE TABLE `restaurant_areas` (
  `id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `area_type` enum('private_dining','terrace','main_hall','patio','rooftop','wine_cellar') NOT NULL,
  `capacity` int(11) NOT NULL,
  `minimum_guests` int(11) DEFAULT 1,
  `price_per_person` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `has_private_entrance` tinyint(1) DEFAULT 0,
  `has_dedicated_staff` tinyint(1) DEFAULT 0,
  `has_sound_system` tinyint(1) DEFAULT 0,
  `images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`images`)),
  `is_available` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

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

CREATE TABLE `reviews` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `booking_id` bigint(20) DEFAULT NULL,
  `rating` int(11) NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `comment` text DEFAULT NULL,
  `service_rating` int(11) DEFAULT NULL,
  `cleanliness_rating` int(11) DEFAULT NULL,
  `value_rating` int(11) DEFAULT NULL,
  `location_rating` int(11) DEFAULT NULL,
  `staff_rating` int(11) DEFAULT NULL,
  `images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`images`)),
  `is_verified` tinyint(1) DEFAULT 0,
  `is_public` tinyint(1) DEFAULT 1,
  `helpful_count` int(11) DEFAULT 0,
  `response` text DEFAULT NULL,
  `response_date` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ;

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

INSERT INTO `reviews` (`id`, `user_id`, `establishment_id`, `booking_id`, `rating`, `title`, `comment`, `service_rating`, `cleanliness_rating`, `value_rating`, `location_rating`, `staff_rating`, `images`, `is_verified`, `is_public`, `helpful_count`, `response`, `response_date`, `created_at`, `updated_at`) VALUES
(2, 6, 7, NULL, 4, NULL, 'j\'ai apprecier', NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, NULL, NULL, '2026-02-15 04:14:11', '2026-02-15 04:14:11'),
(3, 6, 10, NULL, 4, NULL, 'j\'aime', NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, NULL, NULL, '2026-02-20 02:51:53', '2026-02-20 02:51:53'),
(4, 12, 10, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, NULL, NULL, '2026-02-25 08:30:04', '2026-02-25 08:30:04'),
(5, 14, 7, NULL, 3, NULL, 'tfyygygf', NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, NULL, NULL, '2026-02-25 10:45:15', '2026-02-25 10:45:15');

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

--
-- Table structure for table `rooms`
--

CREATE TABLE `rooms` (
  `id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `room_number` varchar(20) NOT NULL,
  `room_type` enum('single','double','suite','deluxe','presidential') NOT NULL,
  `floor_number` int(11) DEFAULT 1,
  `beds_count` int(11) DEFAULT 1,
  `max_occupancy` int(11) DEFAULT 2,
  `base_price` decimal(10,2) NOT NULL,
  `status` enum('available','occupied','maintenance','cleaning','out_of_order') DEFAULT 'available',
  `last_cleaned` timestamp NULL DEFAULT NULL,
  `next_maintenance` date DEFAULT NULL,
  `features` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`features`)),
  `images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`images`)),
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `rooms`
--

INSERT INTO `rooms` (`id`, `establishment_id`, `room_number`, `room_type`, `floor_number`, `beds_count`, `max_occupancy`, `base_price`, `status`, `last_cleaned`, `next_maintenance`, `features`, `images`, `created_at`, `updated_at`) VALUES
(1, 7, '01', 'suite', 1, 1, 2, 150000.00, 'occupied', NULL, NULL, '[\"wifi\", \"air_conditioning\", \"tv\", \"safe\", \"telephone\", \"refrigerator\", \"shower\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-01-28 21:38:07', '2026-02-22 09:26:22'),
(2, 7, '02', 'double', 1, 1, 4, 200000.00, 'available', NULL, NULL, '[\"wifi\", \"climatisation\", \"coffre\", \"baignoire\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-01-29 11:26:00', '2026-02-22 09:27:02'),
(3, 7, '03', 'presidential', 4, 1, 2, 560000.00, 'occupied', NULL, NULL, '[\"wifi\", \"air_conditioning\", \"tv\", \"mini_bar\", \"safe\", \"telephone\", \"refrigerator\", \"workspace\", \"shower\", \"bathtub\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-01-29 11:34:52', '2026-02-22 09:27:07'),
(4, 7, '04', 'suite', 1, 2, 4, 250000.00, 'available', NULL, NULL, '[\"wifi\", \"air_conditioning\", \"tv\", \"safe\", \"telephone\", \"refrigerator\", \"bathtub\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-01-29 11:53:05', '2026-02-22 09:27:16'),
(6, 7, '05', 'single', 1, 1, 2, 150000.00, 'out_of_order', NULL, NULL, '[\"wifi\", \"air_conditioning\", \"tv\", \"balcony\", \"telephone\", \"shower\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-01-29 13:23:20', '2026-02-22 09:34:21'),
(7, 7, '004', 'presidential', 5, 2, 8, 800000.00, 'occupied', NULL, NULL, '[\"wifi\", \"air_conditioning\", \"tv\", \"mini_bar\", \"safe\", \"bathrobe\", \"telephone\", \"refrigerator\", \"workspace\", \"kitchen\", \"jacuzzi\", \"shower\", \"bathtub\"]', '[\"/public/uploads/rooms/room_7_1771152713.jfif\",\"/public/uploads/rooms/room_7_1771152840.jfif\"]', '2026-02-02 07:02:25', '2026-02-22 09:28:55');

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

--
-- Table structure for table `room_bookings`
--

CREATE TABLE `room_bookings` (
  `id` bigint(20) NOT NULL,
  `room_id` bigint(20) NOT NULL,
  `booking_id` bigint(20) NOT NULL,
  `check_in_date` date NOT NULL,
  `check_out_date` date NOT NULL,
  `status` enum('confirmed','checked_in','checked_out','cancelled') DEFAULT 'confirmed',
  `actual_check_in` timestamp NULL DEFAULT NULL,
  `actual_check_out` timestamp NULL DEFAULT NULL,
  `cleaning_status` enum('pending','in_progress','completed') DEFAULT 'pending',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `room_bookings`
--

INSERT INTO `room_bookings` (`id`, `room_id`, `booking_id`, `check_in_date`, `check_out_date`, `status`, `actual_check_in`, `actual_check_out`, `cleaning_status`, `notes`, `created_at`) VALUES
(5, 4, 9, '2026-02-15', '2026-02-16', 'confirmed', NULL, NULL, 'pending', NULL, '2026-02-15 10:40:21'),
(6, 2, 11, '2026-02-20', '2026-02-24', 'cancelled', NULL, NULL, 'pending', NULL, '2026-02-17 15:16:27'),
(7, 3, 12, '2026-02-18', '2026-02-19', 'confirmed', NULL, NULL, 'pending', NULL, '2026-02-18 02:17:58'),
(8, 1, 13, '2026-02-18', '2026-02-19', 'confirmed', NULL, NULL, 'pending', NULL, '2026-02-18 02:19:29'),
(9, 2, 14, '2026-02-18', '2026-02-19', 'confirmed', NULL, NULL, 'pending', NULL, '2026-02-18 02:49:36'),
(10, 4, 15, '2026-02-18', '2026-02-19', 'confirmed', NULL, NULL, 'pending', NULL, '2026-02-18 09:13:13'),
(11, 2, 17, '2026-03-08', '2026-03-12', 'confirmed', NULL, NULL, 'pending', NULL, '2026-02-25 10:46:53'),
(12, 2, 18, '2026-02-25', '2026-02-26', 'confirmed', NULL, NULL, 'pending', NULL, '2026-02-25 19:33:40');

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

--
-- Table structure for table `room_maintenance`
--

CREATE TABLE `room_maintenance` (
  `id` bigint(20) NOT NULL,
  `room_id` bigint(20) NOT NULL,
  `maintenance_type` enum('routine','repair','inspection','emergency') NOT NULL,
  `description` text DEFAULT NULL,
  `scheduled_date` date NOT NULL,
  `start_date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `status` enum('scheduled','in_progress','completed','cancelled') DEFAULT 'scheduled',
  `assigned_to` varchar(255) DEFAULT NULL,
  `cost` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `tables`
--

CREATE TABLE `tables` (
  `id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `table_number` varchar(20) NOT NULL,
  `capacity` int(11) NOT NULL,
  `area` varchar(50) DEFAULT NULL,
  `minimum_spend` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `is_vip` tinyint(1) DEFAULT 0,
  `has_window` tinyint(1) DEFAULT 0,
  `images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`images`)),
  `is_available` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tables`
--

INSERT INTO `tables` (`id`, `establishment_id`, `table_number`, `capacity`, `area`, `minimum_spend`, `currency`, `is_vip`, `has_window`, `images`, `is_available`, `created_at`, `updated_at`) VALUES
(1, 10, 'T2', 4, 'intérieur', 14500.00, 'USD', 0, 0, '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', 1, '2026-02-15 14:28:12', '2026-02-22 09:35:01');

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

--
-- Table structure for table `table_bookings`
--

CREATE TABLE `table_bookings` (
  `id` bigint(20) NOT NULL,
  `table_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `date` date NOT NULL,
  `time` time NOT NULL,
  `duration_hours` int(11) DEFAULT 2,
  `guest_count` int(11) NOT NULL,
  `status` enum('pending','confirmed','cancelled','completed','no_show') DEFAULT 'pending',
  `special_requests` text DEFAULT NULL,
  `occasion` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `users` (
  `id` bigint(20) NOT NULL,
  `all_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `firebase_uid` varchar(255) DEFAULT NULL,
  `city_id` bigint(20) DEFAULT NULL,
  `role` enum('admin','utilisateur') NOT NULL DEFAULT 'utilisateur',
  `status` enum('active','inactive','suspended') NOT NULL DEFAULT 'active',
  `email_verified` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `last_login` timestamp NULL DEFAULT NULL,
  `profile_image` varchar(255) DEFAULT NULL,
  `statut` enum('actif','inactif') DEFAULT 'actif'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `users` (`id`, `all_name`, `email`, `password_hash`, `phone`, `firebase_uid`, `role`, `status`, `email_verified`, `created_at`, `updated_at`, `last_login`, `profile_image`, `statut`) VALUES
(6, 'Landry NGANJI', 'landrynganji@gmail.com', '', '0977948483', 'LNmgYs1lvSXe1PZlbap7vFRoXye2', 'admin', 'active', 0, '2026-02-14 11:24:19', '2026-02-22 10:05:11', NULL, 'https://lh3.googleusercontent.com/a/ACg8ocIsmGD89VbgUwXuORR3lfwIu8wJ7zHn7OPdJ4ip5W3R0rZlt7w=s96-c', 'actif'),
(12, 'Chris-kyle', 'kylechrismk243@gmail.com', '', NULL, 'n2db4juqsYh0QMJHwQSDOgbQk352', 'utilisateur', 'active', 0, '2026-02-25 08:27:08', '2026-02-25 08:27:08', NULL, 'https://lh3.googleusercontent.com/a/ACg8ocJgNYEC05ZhC9JmEAsMDJYBD7NGtmGYsQElsZSrzs4l-ON2Jw=s96-c', 'actif'),
(14, 'Amir Nadar', 'amirnadar5@gmail.com', '', '8000', '3iD8tostfwSRHj73MC2wlUizPQA2', 'admin', 'active', 0, '2026-02-25 10:37:25', '2026-02-25 10:52:06', NULL, 'https://lh3.googleusercontent.com/a/ACg8ocKv1U7v1-kyJWzzFkPoXTJudxpJm0lloJ8D8Bsf6Om2QjB0Kg=s96-c', 'actif');

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

--
-- Table structure for table `user_permission`
--

CREATE TABLE `user_permission` (
  `id` bigint(20) NOT NULL,
  `provider_id` bigint(20) NOT NULL,
  `module_id` bigint(20) NOT NULL,
  `can_read` tinyint(1) DEFAULT 0,
  `can_write` tinyint(1) DEFAULT 0,
  `can_delete` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `user_preferences`
--

CREATE TABLE `user_preferences` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `interest_ids_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`interest_ids_json`)),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_preferences`
--

INSERT INTO `user_preferences` (`id`, `user_id`, `interest_ids_json`, `updated_at`) VALUES
(0, 6, '[\"restaurants\",\"reservation_court_sejour\",\"location_vehicules\"]', '2026-02-14 11:24:19'),
(0, 12, '[\"location_vehicules\",\"restaurants\",\"reservation_court_sejour\",\"bars_boites\"]', '2026-02-25 08:27:08'),
(0, 14, '[\"reservation_court_sejour\"]', '2026-02-25 10:37:26');

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

--
-- Table structure for table `vehicles`
--

CREATE TABLE `vehicles` (
  `id` bigint(20) NOT NULL,
  `establishment_id` bigint(20) NOT NULL,
  `license_plate` varchar(20) NOT NULL,
  `make` varchar(50) NOT NULL,
  `model` varchar(50) NOT NULL,
  `year` int(11) NOT NULL,
  `vehicle_type` enum('car','motorcycle','van','suv','truck') NOT NULL,
  `fuel_type` enum('gasoline','diesel','electric','hybrid') NOT NULL,
  `transmission` enum('manual','automatic') NOT NULL,
  `seats_count` int(11) DEFAULT 5,
  `daily_rate` decimal(10,2) NOT NULL,
  `status` enum('available','rented','maintenance','out_of_order') DEFAULT 'available',
  `last_maintenance` date DEFAULT NULL,
  `next_maintenance` date DEFAULT NULL,
  `insurance_expiry` date DEFAULT NULL,
  `features` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`features`)),
  `images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`images`)),
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `vehicles`
--

INSERT INTO `vehicles` (`id`, `establishment_id`, `license_plate`, `make`, `model`, `year`, `vehicle_type`, `fuel_type`, `transmission`, `seats_count`, `daily_rate`, `status`, `last_maintenance`, `next_maintenance`, `insurance_expiry`, `features`, `images`, `created_at`, `updated_at`) VALUES
(1, 9, 'AB-145223-XX', 'Renault', 'Clio', 2026, 'car', 'gasoline', 'automatic', 5, 55.00, 'rented', '2026-01-26', '2026-02-16', '2026-02-25', '[\"climatisation\", \"gps\", \"bluetooth\", \"usb\", \"radar_de_recul\", \"camera_de_recul\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-02-03 08:39:59', '2026-02-22 09:35:31'),
(2, 9, 'AR-145237-BB', 'bmw', '303', 2012, 'car', 'gasoline', 'manual', 5, 65.00, 'available', '2026-02-01', '2026-03-01', '0202-02-03', NULL, '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-02-03 08:44:52', '2026-02-22 09:36:54'),
(4, 9, 'TT-587741-BA', 'Mercedes', 'GLE 550', 2025, 'car', 'gasoline', 'automatic', 8, 78.00, 'available', '2026-02-01', '2026-02-17', '2028-02-24', '[\"climatisation\", \"gps\", \"bluetooth\", \"usb\", \"radar_de_recul\", \"camera_de_recul\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-02-03 08:52:38', '2026-02-22 09:37:46'),
(5, 9, 'ER-4474522-AA', 'Jetour', 'T2', 2025, 'suv', 'diesel', 'manual', 8, 100.00, 'rented', '2026-02-01', '2026-02-04', '2026-02-24', '[\"climatisation\", \"gps\", \"bluetooth\", \"usb\", \"radar_de_recul\", \"camera_de_recul\", \"regulateur_vitesse\", \"vitres_teintees\", \"toit_ouvrant\", \"sieges_cuir\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-02-03 09:21:23', '2026-02-22 09:35:41'),
(6, 9, 'GL-4478556-KK', 'Toyota camri', '50', 2024, 'car', 'gasoline', 'manual', 5, 45.00, 'available', '2026-02-01', '2026-03-01', '2030-01-01', '[\"climatisation\", \"gps\", \"bluetooth\", \"usb\", \"radar_de_recul\"]', '[\"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\", \"/public/uploads/menu_items/menu_6991d77f699031.61734084.jfif\"]', '2026-02-03 11:55:07', '2026-02-22 09:37:11');

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

--
-- Table structure for table `vehicle_maintenance`
--

CREATE TABLE `vehicle_maintenance` (
  `id` bigint(20) NOT NULL,
  `vehicle_id` bigint(20) NOT NULL,
  `maintenance_type` enum('routine','repair','inspection','emergency') NOT NULL,
  `description` text DEFAULT NULL,
  `scheduled_date` date NOT NULL,
  `start_date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `status` enum('scheduled','in_progress','completed','cancelled') DEFAULT 'scheduled',
  `assigned_to` varchar(255) DEFAULT NULL,
  `cost` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `mileage_at_service` int(11) DEFAULT NULL,
  `parts_replaced` text DEFAULT NULL,
  `next_service_mileage` int(11) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `vehicle_rentals`
--

CREATE TABLE `vehicle_rentals` (
  `id` bigint(20) NOT NULL,
  `vehicle_id` bigint(20) NOT NULL,
  `booking_id` bigint(20) NOT NULL,
  `pickup_date` datetime NOT NULL,
  `expected_return_date` datetime NOT NULL,
  `actual_return_date` datetime DEFAULT NULL,
  `total_days` int(11) NOT NULL,
  `daily_rate` decimal(10,2) NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) DEFAULT 'CDF',
  `status` enum('active','completed','cancelled') DEFAULT 'active',
  `mileage_out` int(11) DEFAULT NULL,
  `mileage_in` int(11) DEFAULT NULL,
  `fuel_level_out` varchar(20) DEFAULT NULL,
  `fuel_level_in` varchar(20) DEFAULT NULL,
  `damage_notes` text DEFAULT NULL,
  `additional_charges` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `audit_logs`
--
ALTER TABLE `audit_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_audit_user` (`user_id`),
  ADD KEY `idx_audit_action` (`action`),
  ADD KEY `idx_audit_table` (`table_name`),
  ADD KEY `idx_audit_created` (`created_at`);

--
-- Indexes for table `bookings`
--
ALTER TABLE `bookings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_bookings_user` (`user_id`),
  ADD KEY `idx_bookings_establishment` (`establishment_id`),
  ADD KEY `idx_bookings_payment` (`payment_id`),
  ADD KEY `idx_bookings_dates` (`start_date`,`end_date`),
  ADD KEY `idx_bookings_status` (`status`),
  ADD KEY `idx_bookings_type` (`booking_type`);

--
-- Indexes for table `cities`
--
ALTER TABLE `cities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_cities_name` (`name`),
  ADD KEY `idx_cities_province` (`province`),
  ADD KEY `idx_cities_active` (`is_active`);

--
-- Indexes for table `currencies`
--
ALTER TABLE `currencies`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_currencies_code` (`code`),
  ADD KEY `idx_currencies_is_active` (`is_active`),
  ADD KEY `idx_currencies_is_default` (`is_default`);

--
-- Indexes for table `establishments`
--
ALTER TABLE `establishments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_establishments_provider` (`provider_id`),
  ADD KEY `idx_establishments_type` (`type`),
  ADD KEY `idx_establishments_status` (`status`),
  ADD KEY `idx_establishments_city` (`city_id`);

--
-- Indexes for table `instant_orders`
--
ALTER TABLE `instant_orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_instant_orders_user` (`user_id`),
  ADD KEY `idx_instant_orders_establishment` (`establishment_id`),
  ADD KEY `idx_instant_orders_status` (`status`);

--
-- Indexes for table `instant_services`
--
ALTER TABLE `instant_services`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_instant_services_establishment` (`establishment_id`),
  ADD KEY `idx_instant_services_category` (`category`),
  ADD KEY `idx_instant_services_available` (`is_available`);

--
-- Indexes for table `modules`
--
ALTER TABLE `modules`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_modules_name` (`name`),
  ADD KEY `idx_modules_active` (`is_active`),
  ADD KEY `idx_modules_sort` (`sort_order`);

--
-- Indexes for table `nightclub_areas`
--
ALTER TABLE `nightclub_areas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_nightclub_areas_establishment` (`establishment_id`),
  ADD KEY `idx_nightclub_areas_type` (`area_type`),
  ADD KEY `idx_nightclub_areas_capacity` (`capacity`),
  ADD KEY `idx_nightclub_areas_available` (`is_available`);

--
-- Indexes for table `notification_provider`
--
ALTER TABLE `notification_provider`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_notification_provider_provider` (`provider_id`),
  ADD KEY `idx_notification_provider_type` (`type`),
  ADD KEY `idx_notification_provider_read` (`is_read`),
  ADD KEY `idx_notification_provider_created_at` (`created_at`);

--
-- Indexes for table `notification_user`
--
ALTER TABLE `notification_user`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_notification_user_user` (`user_id`),
  ADD KEY `idx_notification_user_type` (`type`),
  ADD KEY `idx_notification_user_read` (`is_read`),
  ADD KEY `idx_notification_user_created_at` (`created_at`);

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_payments_status` (`payment_status`),
  ADD KEY `idx_payments_method` (`payment_method`),
  ADD KEY `idx_payments_date` (`paid_at`);

--
-- Indexes for table `providers`
--
ALTER TABLE `providers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `firebase_uid` (`firebase_uid`),
  ADD UNIQUE KEY `idx_providers_firebase_uid` (`firebase_uid`),
  ADD KEY `idx_providers_role` (`role`),
  ADD KEY `idx_providers_status` (`status`),
  ADD KEY `idx_providers_type_etablissement` (`type_etablissement`);

--
-- Indexes for table `registration_requests`
--
ALTER TABLE `registration_requests`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_registration_requests_email` (`email`),
  ADD KEY `idx_registration_requests_status` (`status`);

--
-- Indexes for table `restaurant_areas`
--
ALTER TABLE `restaurant_areas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_restaurant_areas_establishment` (`establishment_id`),
  ADD KEY `idx_restaurant_areas_type` (`area_type`),
  ADD KEY `idx_restaurant_areas_capacity` (`capacity`),
  ADD KEY `idx_restaurant_areas_available` (`is_available`);

--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_reviews_user` (`user_id`),
  ADD KEY `idx_reviews_establishment` (`establishment_id`),
  ADD KEY `idx_reviews_booking` (`booking_id`),
  ADD KEY `idx_reviews_rating` (`rating`),
  ADD KEY `idx_reviews_verified` (`is_verified`),
  ADD KEY `idx_reviews_public` (`is_public`);

--
-- Indexes for table `rooms`
--
ALTER TABLE `rooms`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_room_number` (`establishment_id`,`room_number`),
  ADD KEY `idx_rooms_establishment` (`establishment_id`),
  ADD KEY `idx_rooms_status` (`status`),
  ADD KEY `idx_rooms_type` (`room_type`);

--
-- Indexes for table `room_bookings`
--
ALTER TABLE `room_bookings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_room_bookings_room` (`room_id`),
  ADD KEY `idx_room_bookings_booking` (`booking_id`),
  ADD KEY `idx_room_bookings_dates` (`check_in_date`,`check_out_date`),
  ADD KEY `idx_room_bookings_status` (`status`);

--
-- Indexes for table `room_maintenance`
--
ALTER TABLE `room_maintenance`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_room_maintenance_room` (`room_id`),
  ADD KEY `idx_room_maintenance_dates` (`scheduled_date`,`start_date`),
  ADD KEY `idx_room_maintenance_status` (`status`),
  ADD KEY `idx_room_maintenance_type` (`maintenance_type`);

--
-- Indexes for table `tables`
--
ALTER TABLE `tables`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_tables_establishment_number` (`establishment_id`,`table_number`),
  ADD KEY `idx_tables_capacity` (`capacity`),
  ADD KEY `idx_tables_area` (`area`),
  ADD KEY `idx_tables_available` (`is_available`);

--
-- Indexes for table `table_bookings`
--
ALTER TABLE `table_bookings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_table_bookings_table` (`table_id`),
  ADD KEY `idx_table_bookings_user` (`user_id`),
  ADD KEY `idx_table_bookings_datetime` (`date`,`time`),
  ADD KEY `idx_table_bookings_status` (`status`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `firebase_uid` (`firebase_uid`),
  ADD UNIQUE KEY `idx_users_firebase_uid` (`firebase_uid`),
  ADD KEY `idx_users_role` (`role`),
  ADD KEY `idx_users_status` (`status`),
  ADD KEY `idx_users_city` (`city_id`);

--
-- Indexes for table `user_permission`
--
ALTER TABLE `user_permission`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_user_permission_provider_module` (`provider_id`,`module_id`),
  ADD KEY `idx_user_permission_provider` (`provider_id`),
  ADD KEY `idx_user_permission_module` (`module_id`);

--
-- Indexes for table `vehicles`
--
ALTER TABLE `vehicles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `license_plate` (`license_plate`),
  ADD UNIQUE KEY `idx_vehicles_license_plate` (`license_plate`),
  ADD KEY `idx_vehicles_establishment` (`establishment_id`),
  ADD KEY `idx_vehicles_status` (`status`),
  ADD KEY `idx_vehicles_type` (`vehicle_type`);

--
-- Indexes for table `vehicle_maintenance`
--
ALTER TABLE `vehicle_maintenance`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_vehicle_maintenance_vehicle` (`vehicle_id`),
  ADD KEY `idx_vehicle_maintenance_dates` (`scheduled_date`,`start_date`),
  ADD KEY `idx_vehicle_maintenance_status` (`status`),
  ADD KEY `idx_vehicle_maintenance_type` (`maintenance_type`);

--
-- Indexes for table `vehicle_rentals`
--
ALTER TABLE `vehicle_rentals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_vehicle_rentals_vehicle` (`vehicle_id`),
  ADD KEY `idx_vehicle_rentals_booking` (`booking_id`),
  ADD KEY `idx_vehicle_rentals_dates` (`pickup_date`,`expected_return_date`),
  ADD KEY `idx_vehicle_rentals_status` (`status`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `app_settings`
--
ALTER TABLE `app_settings`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

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

--
-- AUTO_INCREMENT for table `bookings`
--
ALTER TABLE `bookings`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

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

--
-- AUTO_INCREMENT for table `currencies`
--
ALTER TABLE `currencies`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `establishments`
--
ALTER TABLE `establishments`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

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

--
-- AUTO_INCREMENT for table `instant_services`
--
ALTER TABLE `instant_services`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

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

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

--
-- AUTO_INCREMENT for table `notification_provider`
--
ALTER TABLE `notification_provider`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `providers`
--
ALTER TABLE `providers`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `registration_requests`
--
ALTER TABLE `registration_requests`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

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

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

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

--
-- AUTO_INCREMENT for table `room_bookings`
--
ALTER TABLE `room_bookings`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

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

--
-- AUTO_INCREMENT for table `tables`
--
ALTER TABLE `tables`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `table_bookings`
--
ALTER TABLE `table_bookings`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `audit_logs`
--
ALTER TABLE `audit_logs`
  ADD CONSTRAINT `fk_audit_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `bookings`
--
ALTER TABLE `bookings`
  ADD CONSTRAINT `fk_bookings_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_bookings_payment` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_bookings_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `establishments`
--
ALTER TABLE `establishments`
  ADD CONSTRAINT `fk_establishments_city` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_establishments_provider` FOREIGN KEY (`provider_id`) REFERENCES `providers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `fk_users_city` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `instant_orders`
--
ALTER TABLE `instant_orders`
  ADD CONSTRAINT `fk_instant_orders_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_instant_orders_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `instant_services`
--
ALTER TABLE `instant_services`
  ADD CONSTRAINT `fk_instant_services_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `nightclub_areas`
--
ALTER TABLE `nightclub_areas`
  ADD CONSTRAINT `fk_nightclub_areas_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `notification_provider`
--
ALTER TABLE `notification_provider`
  ADD CONSTRAINT `fk_notification_provider_provider` FOREIGN KEY (`provider_id`) REFERENCES `providers` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `restaurant_areas`
--
ALTER TABLE `restaurant_areas`
  ADD CONSTRAINT `fk_restaurant_areas_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `reviews`
--
ALTER TABLE `reviews`
  ADD CONSTRAINT `fk_reviews_booking` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_reviews_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_reviews_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `rooms`
--
ALTER TABLE `rooms`
  ADD CONSTRAINT `fk_rooms_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `room_bookings`
--
ALTER TABLE `room_bookings`
  ADD CONSTRAINT `fk_room_bookings_booking` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_room_bookings_room` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `room_maintenance`
--
ALTER TABLE `room_maintenance`
  ADD CONSTRAINT `fk_room_maintenance_room` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tables`
--
ALTER TABLE `tables`
  ADD CONSTRAINT `fk_tables_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `table_bookings`
--
ALTER TABLE `table_bookings`
  ADD CONSTRAINT `fk_table_bookings_table` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_table_bookings_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_permission`
--
ALTER TABLE `user_permission`
  ADD CONSTRAINT `fk_user_permission_module` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_user_permission_provider` FOREIGN KEY (`provider_id`) REFERENCES `providers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vehicles`
--
ALTER TABLE `vehicles`
  ADD CONSTRAINT `fk_vehicles_establishment` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vehicle_maintenance`
--
ALTER TABLE `vehicle_maintenance`
  ADD CONSTRAINT `fk_vehicle_maintenance_vehicle` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vehicle_rentals`
--
ALTER TABLE `vehicle_rentals`
  ADD CONSTRAINT `fk_vehicle_rentals_booking` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_vehicle_rentals_vehicle` FOREIGN KEY (`vehicle_id`) REFERENCES `vehicles` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
