MOON
Server: Apache
System: Linux ip-208-109-13-31.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els4.x86_64 #1 SMP Sat Aug 31 06:58:57 UTC 2024 x86_64
User: durgeshpandey215 (1013)
PHP: 8.1.29
Disabled: NONE
Upload Files
File: /home/durgeshpandey215/public_html/bharatmatabackend.skilladders.com/DB/bharatseva.sql
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 20, 2026 at 10:29 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

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: `bharatseva`
--

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

--
-- Table structure for table `activity_logs`
--

CREATE TABLE `activity_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `activity_type` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `activity_logs`
--

INSERT INTO `activity_logs` (`id`, `user_id`, `activity_type`, `description`, `created_at`, `updated_at`) VALUES
(1, 1, 'business_registration_verification_failed', '{\"status\":\"rejected\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 12:02:27\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Business registration verification failed\",\"registration_id\":2,\"error\":\"Attempt to read property \\\"id\\\" on null\"}', '2026-03-20 06:32:27', '2026-03-20 06:32:27'),
(2, 1, 'business_registration_verification_failed', '{\"status\":\"rejected\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 12:02:47\",\"browser_name\":\"Safari\",\"os_name\":\"iOS\",\"device_type\":\"mobile\",\"message\":\"Business registration verification failed\",\"registration_id\":2,\"error\":\"Attempt to read property \\\"id\\\" on null\"}', '2026-03-20 06:32:47', '2026-03-20 06:32:47'),
(3, 1, 'business_registration_verification_failed', '{\"status\":\"rejected\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:21:24\",\"browser_name\":\"Safari\",\"os_name\":\"iOS\",\"device_type\":\"mobile\",\"message\":\"Business registration verification failed\",\"registration_id\":2,\"error\":\"Attempt to read property \\\"id\\\" on null\"}', '2026-03-20 07:51:24', '2026-03-20 07:51:24'),
(4, 1, 'business_registration_verification_failed', '{\"status\":\"rejected\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:22:43\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Business registration verification failed\",\"registration_id\":2,\"error\":\"Attempt to read property \\\"id\\\" on null\"}', '2026-03-20 07:52:43', '2026-03-20 07:52:43'),
(5, 1, 'business_registration_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:36:31\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Business registration verification updated\",\"registration_id\":2,\"updated_fields\":{\"verification_status\":\"approved\",\"verified_by\":1,\"verified_at\":\"2026-03-20 13:36:31\",\"updated_at\":\"2026-03-20 13:36:31\"},\"old_values\":{\"verification_status\":\"pending\",\"verified_by\":null,\"verified_at\":null,\"updated_at\":\"2026-03-20T06:15:52.000000Z\"},\"new_status\":\"approved\",\"verified_by\":1}', '2026-03-20 08:06:31', '2026-03-20 08:06:31'),
(6, 1, 'business_registration_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:36:57\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Business registration verification updated\",\"registration_id\":2,\"updated_fields\":{\"verification_status\":\"rejected\",\"verified_at\":\"2026-03-20 13:36:57\",\"remarks\":\"FAKE DOCUMENT\",\"updated_at\":\"2026-03-20 13:36:57\"},\"old_values\":{\"verification_status\":\"pending\",\"verified_at\":\"2026-03-20T08:06:31.000000Z\",\"remarks\":null,\"updated_at\":\"2026-03-20T08:06:44.000000Z\"},\"new_status\":\"rejected\",\"verified_by\":1}', '2026-03-20 08:06:57', '2026-03-20 08:06:57'),
(7, 1, 'government_registration_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:49:00\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Government ID verification updated\",\"registration_id\":3,\"updated_fields\":{\"verification_status\":\"rejected\",\"verified_by\":1,\"verified_at\":\"2026-03-20T08:19:00.747682Z\",\"remarks\":\"FAKE\",\"updated_at\":\"2026-03-20 13:49:00\"},\"old_values\":{\"verification_status\":\"pending\",\"verified_by\":null,\"verified_at\":null,\"remarks\":null,\"updated_at\":\"2026-03-20T06:09:25.000000Z\"},\"new_status\":\"rejected\",\"verified_by\":1}', '2026-03-20 08:19:00', '2026-03-20 08:19:00'),
(8, 1, 'government_registration_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:49:25\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Government ID verification updated\",\"registration_id\":3,\"updated_fields\":{\"verification_status\":\"approved\",\"verified_by\":1,\"verified_at\":\"2026-03-20T08:19:25.630559Z\",\"remarks\":null,\"updated_at\":\"2026-03-20 13:49:25\"},\"old_values\":{\"verification_status\":\"pending\",\"verified_by\":null,\"verified_at\":\"2026-03-20 13:49:00\",\"remarks\":\"\",\"updated_at\":\"2026-03-20T08:19:20.000000Z\"},\"new_status\":\"approved\",\"verified_by\":1}', '2026-03-20 08:19:25', '2026-03-20 08:19:25'),
(9, 1, 'government_registration_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:49:29\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Government ID verification updated\",\"registration_id\":4,\"updated_fields\":{\"verification_status\":\"approved\",\"verified_by\":1,\"verified_at\":\"2026-03-20T08:19:29.521968Z\",\"updated_at\":\"2026-03-20 13:49:29\"},\"old_values\":{\"verification_status\":\"pending\",\"verified_by\":null,\"verified_at\":null,\"updated_at\":\"2026-03-20T06:09:25.000000Z\"},\"new_status\":\"approved\",\"verified_by\":1}', '2026-03-20 08:19:29', '2026-03-20 08:19:29'),
(10, 1, 'business_registration_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:49:33\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Business registration verification updated\",\"registration_id\":2,\"updated_fields\":{\"verification_status\":\"approved\",\"verified_by\":1,\"verified_at\":\"2026-03-20 13:49:33\",\"updated_at\":\"2026-03-20 13:49:33\"},\"old_values\":{\"verification_status\":\"pending\",\"verified_by\":null,\"verified_at\":\"2026-03-20T08:06:57.000000Z\",\"updated_at\":\"2026-03-20T08:07:23.000000Z\"},\"new_status\":\"approved\",\"verified_by\":1}', '2026-03-20 08:19:33', '2026-03-20 08:19:33'),
(11, 1, 'business_registration_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:49:38\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Business registration verification updated\",\"registration_id\":3,\"updated_fields\":{\"verification_status\":\"approved\",\"verified_by\":1,\"verified_at\":\"2026-03-20 13:49:38\",\"updated_at\":\"2026-03-20 13:49:38\"},\"old_values\":{\"verification_status\":\"pending\",\"verified_by\":null,\"verified_at\":null,\"updated_at\":\"2026-03-20T06:15:52.000000Z\"},\"new_status\":\"approved\",\"verified_by\":1}', '2026-03-20 08:19:38', '2026-03-20 08:19:38'),
(12, 1, 'business_registration_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:49:46\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Business registration verification updated\",\"registration_id\":4,\"updated_fields\":{\"verification_status\":\"rejected\",\"verified_by\":1,\"verified_at\":\"2026-03-20 13:49:46\",\"remarks\":\"Fake\",\"updated_at\":\"2026-03-20 13:49:46\"},\"old_values\":{\"verification_status\":\"pending\",\"verified_by\":null,\"verified_at\":null,\"remarks\":null,\"updated_at\":\"2026-03-20T06:15:52.000000Z\"},\"new_status\":\"rejected\",\"verified_by\":1}', '2026-03-20 08:19:46', '2026-03-20 08:19:46'),
(13, 1, 'vendor_verified', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:49:53\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"Vendor verification completed\",\"business_id\":\"3\",\"verification_mode\":\"online\",\"overall_status\":\"approved\",\"admin_id\":1,\"visit_date\":null,\"remarks\":null}', '2026-03-20 08:19:53', '2026-03-20 08:19:53'),
(14, 2, 'product_creation_failed', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:57:42\",\"browser_name\":false,\"os_name\":false,\"device_type\":\"mobile\",\"message\":\"Product creation failed\",\"error\":\"SQLSTATE[01000]: Warning: 1265 Data truncated for column \'weight\' at row 1 (Connection: mysql, Host: 127.0.0.1, Port: 3306, Database: bharatseva, SQL: insert into `product_shipping` (`product_id`, `is_shipping`, `weight`, `length`, `width`, `height`, `updated_at`, `created_at`) values (1, 1, 590g, 15, 7, 6, 2026-03-20 13:57:42, 2026-03-20 13:57:42))\",\"vendor_id\":2,\"product_name\":\"iPhone 16 PRO MAX\"}', '2026-03-20 08:27:42', '2026-03-20 08:27:42'),
(15, 2, 'product_created', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:58:09\",\"browser_name\":false,\"os_name\":false,\"device_type\":\"mobile\",\"message\":\"Vendor created product: iPhone 16 PRO MAX\",\"product_id\":2,\"vendor_id\":2,\"category\":\"Mobiles\",\"price\":\"100000\",\"pricing_model\":\"fixed\",\"has_variants\":false,\"has_features\":false,\"has_tags\":false,\"is_tracking\":\"1\",\"is_shipping\":\"1\"}', '2026-03-20 08:28:09', '2026-03-20 08:28:09'),
(16, 2, 'product_update_failed', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:59:13\",\"browser_name\":false,\"os_name\":false,\"device_type\":\"mobile\",\"message\":\"Product update failed\",\"product_id\":\"2\",\"error\":\"Undefined array key \\\"name\\\"\"}', '2026-03-20 08:29:13', '2026-03-20 08:29:13'),
(17, 2, 'product_update_failed', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 13:59:19\",\"browser_name\":false,\"os_name\":false,\"device_type\":\"mobile\",\"message\":\"Product update failed\",\"product_id\":\"2\",\"error\":\"Undefined array key \\\"name\\\"\"}', '2026-03-20 08:29:19', '2026-03-20 08:29:19'),
(18, 2, 'product_updated', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 14:05:49\",\"browser_name\":false,\"os_name\":false,\"device_type\":\"mobile\",\"message\":\"Vendor updated product: iPhone 16 PRO MAX\",\"product_id\":2,\"vendor_id\":2,\"updated_fields\":[],\"old_values\":[],\"has_variants\":true,\"has_features\":true,\"has_tags\":true}', '2026-03-20 08:35:49', '2026-03-20 08:35:49'),
(19, 1, 'approval_update', '{\"status\":\"success\",\"ip_address\":\"127.0.0.1\",\"timestamp\":\"2026-03-20 14:50:19\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"message\":\"User approved product: iPhone 16 PRO MAX\",\"updated_fields\":{\"is_approved\":\"approved\",\"approved_by\":1,\"updated_at\":\"2026-03-20 14:50:19\"},\"old_values\":{\"is_approved\":\"pending\",\"approved_by\":null,\"updated_at\":\"2026-03-20T08:28:09.000000Z\"}}', '2026-03-20 09:20:19', '2026-03-20 09:20:19');

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

--
-- Table structure for table `branches`
--

CREATE TABLE `branches` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `zonal_area_id` bigint(20) UNSIGNED NOT NULL COMMENT 'branch local main area',
  `area_covered` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'area_id ["1", "2", "3"]' CHECK (json_valid(`area_covered`)),
  `address_line1` varchar(255) NOT NULL,
  `address_line2` varchar(255) DEFAULT NULL,
  `city` varchar(100) NOT NULL,
  `state` varchar(100) NOT NULL,
  `country` varchar(100) NOT NULL,
  `pincode` varchar(20) NOT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `branches`
--

INSERT INTO `branches` (`id`, `name`, `zonal_area_id`, `area_covered`, `address_line1`, `address_line2`, `city`, `state`, `country`, `pincode`, `latitude`, `longitude`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'New Mumbai', 1, '\"Vashi , Sanpada\"', 'IT Park', 'Near Vashi Depot', 'Vashi, Navi Mumbai', 'Maharashtra', 'India', '400703', 12.00323300, 45.99000000, 1, '2026-02-12 06:01:36', '2026-02-12 06:35:49', NULL);

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

--
-- Table structure for table `business_addresses`
--

CREATE TABLE `business_addresses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_registration_id` bigint(20) UNSIGNED NOT NULL,
  `address_line1` varchar(255) NOT NULL,
  `address_line2` varchar(255) DEFAULT NULL,
  `city` varchar(100) NOT NULL,
  `state` varchar(100) NOT NULL,
  `country` varchar(100) NOT NULL,
  `pincode` varchar(20) NOT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `business_documents`
--

CREATE TABLE `business_documents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_registration_id` bigint(20) UNSIGNED NOT NULL,
  `document_type` varchar(100) NOT NULL,
  `document_path` varchar(500) NOT NULL,
  `document_status` bigint(20) UNSIGNED NOT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `business_registration`
--

CREATE TABLE `business_registration` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `category_group_id` bigint(20) UNSIGNED NOT NULL,
  `business_name` varchar(255) NOT NULL,
  `registration_number` varchar(100) NOT NULL,
  `registration_date` date NOT NULL,
  `status` bigint(20) UNSIGNED DEFAULT NULL COMMENT 'status enum description id',
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `business_types`
--

CREATE TABLE `business_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `business_types`
--

INSERT INTO `business_types` (`id`, `name`, `slug`, `description`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Individual', 'individual', 'A single person conducting business activities without forming a separate legal entity.', 1, '2026-02-16 11:20:22', '2026-02-16 11:20:22', NULL),
(2, 'Sole Proprietorship', 'sole-proprietorship', 'A business owned and operated by a single individual.', 1, '2026-02-16 11:20:22', '2026-02-16 11:20:22', NULL),
(3, 'Partnership', 'partnership', 'A business owned by two or more individuals who share profits and liabilities.', 1, '2026-02-16 11:20:22', '2026-02-16 11:20:22', NULL),
(4, 'Limited Liability Company (LLC)', 'limited-liability-company', 'A hybrid business structure that offers limited liability to its owners.', 1, '2026-02-16 11:20:22', '2026-02-16 11:20:22', NULL),
(5, 'Private Limited Company', 'private-limited-company', 'A company that is privately held and has limited liability for its shareholders.', 1, '2026-02-16 11:20:22', '2026-02-16 11:20:22', NULL),
(6, 'Corporation', 'corporation', 'A legal entity that is separate from its owners, providing limited liability and potential tax benefits.', 1, '2026-02-16 11:20:22', '2026-02-16 11:20:22', NULL),
(7, 'Cooperative', 'cooperative', 'A business owned and operated by a group of individuals for their mutual benefit.', 1, '2026-02-16 11:20:22', '2026-03-16 13:34:43', NULL),
(8, 'A1 Categorys', 'a1-categorys', 'Description', 0, '2026-02-17 06:41:07', '2026-02-17 06:42:20', '2026-02-17 06:42:20');

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

--
-- Table structure for table `cache`
--

CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cache`
--

INSERT INTO `cache` (`key`, `value`, `expiration`) VALUES
('laravel-cache-LxjzsYyPtLfvoAtX', 's:7:\"forever\";', 2089187207),
('laravel-cache-UMLQoN7WVYJTkDr4', 's:7:\"forever\";', 2089026109),
('laravel-cache-VcneBLgttkgFfxxd', 's:7:\"forever\";', 2089177686);

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

--
-- Table structure for table `cache_locks`
--

CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(150) NOT NULL,
  `slug` varchar(150) NOT NULL,
  `parent_id` bigint(20) UNSIGNED DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `slug`, `parent_id`, `icon`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'A1 Category', 'a1-cat', 3, 'fa fa-user', 1, '2026-02-11 18:48:25', '2026-02-16 12:32:31', NULL),
(2, 'A2 Category', 'a2-cat', NULL, 'fa fa-user', 1, '2026-02-11 19:23:29', '2026-02-11 19:27:44', '2026-02-11 19:27:44'),
(3, 'A2-Category', 'a2-category', 6, 'fa-user', 1, '2026-02-16 10:06:28', '2026-02-26 11:16:12', NULL),
(4, 'A1 Category', 'a1-category', 1, 'fa fa-user', 1, '2026-02-16 12:17:00', '2026-02-16 12:17:00', NULL),
(5, 'A1 Category', 'a1-category-1', 1, 'fa fa-user', 1, '2026-02-16 12:31:42', '2026-02-16 12:32:22', NULL),
(6, 'A3-Category', 'a3-category', NULL, 'fa fa-user', 1, '2026-02-26 11:15:52', '2026-02-26 11:15:52', NULL);

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

--
-- Table structure for table `category_groups`
--

CREATE TABLE `category_groups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`category_ids`)),
  `code` varchar(20) NOT NULL COMMENT 'G1, G2, G3...',
  `name` varchar(255) NOT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `category_groups`
--

INSERT INTO `category_groups` (`id`, `category_ids`, `code`, `name`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, '[\"1\"]', 'G1', 'Recharge', 1, '2026-02-17 07:45:51', '2026-02-19 09:43:39', NULL);

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

--
-- Table structure for table `category_group_mappings`
--

CREATE TABLE `category_group_mappings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_group_id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `city`
--

CREATE TABLE `city` (
  `id` int(11) NOT NULL,
  `city_name` varchar(100) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `city`
--

INSERT INTO `city` (`id`, `city_name`, `created_at`, `updated_at`, `deleted_at`, `created_by`, `updated_by`) VALUES
(1, 'Mumbai', '2026-02-23 18:00:08', '2026-02-23 18:00:08', NULL, NULL, NULL),
(2, 'Vasai', '2026-02-23 18:03:12', '2026-02-23 18:03:12', NULL, 1, 1),
(3, 'Pune', '2026-02-23 18:03:12', '2026-02-23 18:03:12', NULL, 1, 1),
(4, 'Bengaluru', '2026-02-23 18:03:12', '2026-02-23 18:03:12', NULL, 1, 1),
(5, 'Chennai', '2026-02-23 18:03:12', '2026-02-23 18:03:12', NULL, 1, 1),
(6, 'Ahmedabad', '2026-02-23 18:03:12', '2026-02-23 18:03:12', NULL, 1, 1);

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

--
-- Table structure for table `district`
--

CREATE TABLE `district` (
  `id` int(11) NOT NULL,
  `district_name` varchar(100) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `district`
--

INSERT INTO `district` (`id`, `district_name`, `created_at`, `updated_at`, `deleted_at`, `created_by`, `updated_by`) VALUES
(1, 'Thane', '2026-02-23 18:00:22', '2026-02-23 18:00:22', NULL, NULL, NULL),
(2, 'Mumbai City', '2026-02-23 18:03:23', '2026-02-23 18:03:23', NULL, 1, 1),
(3, 'Pune District', '2026-02-23 18:03:23', '2026-02-23 18:03:23', NULL, 1, 1),
(4, 'Bangalore Urban', '2026-02-23 18:03:23', '2026-02-23 18:03:23', NULL, 1, 1),
(5, 'Chennai District', '2026-02-23 18:03:23', '2026-02-23 18:03:23', NULL, 1, 1),
(6, 'Ahmedabad District', '2026-02-23 18:03:23', '2026-02-23 18:03:23', NULL, 1, 1);

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

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `features`
--

CREATE TABLE `features` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `value_type` enum('boolean','integer','decimal','string','json') NOT NULL DEFAULT 'boolean' COMMENT 'Defines the type of value this feature holds',
  `is_core` tinyint(4) DEFAULT 0 COMMENT '1=Core feature included in all plans, 0=Optional feature that can be added to plans',
  `is_addon_allowed` tinyint(4) DEFAULT 0 COMMENT '1=This feature can be added as an addon to subscription plans, 0=This feature cannot be added as an addon',
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `features`
--

INSERT INTO `features` (`id`, `name`, `slug`, `value_type`, `is_core`, `is_addon_allowed`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Priority Support', 'priority-support', 'boolean', 1, 1, 1, '2026-02-19 06:26:18', '2026-02-20 06:16:20', NULL),
(2, 'Priority Support', 'priority-support-1', 'boolean', 1, 0, 1, '2026-02-19 06:27:12', '2026-02-19 06:27:24', '2026-02-19 06:27:24'),
(3, 'Unlimited Calling', 'unlimited-calling', 'boolean', 0, 0, 1, '2026-02-20 06:15:50', '2026-02-20 06:15:50', NULL);

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

--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) UNSIGNED NOT NULL,
  `reserved_at` int(10) UNSIGNED DEFAULT NULL,
  `available_at` int(10) UNSIGNED NOT NULL,
  `created_at` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `login_logs`
--

CREATE TABLE `login_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `login_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `logout_time` timestamp NULL DEFAULT NULL COMMENT 'NULL = active session',
  `ip_address` varchar(45) DEFAULT NULL,
  `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '{"status":"success","country":"India","countryCode":"IN","region":"MH","regionName":"Maharashtra","city":"Mumbai","zip":"400017","lat":19.074799999999999755573298898525536060333251953125,"lon":72.8855999999999966121322358958423137664794921875,"timezone":"Asia/Kolkata","isp":"Hathway IP over Cable Internet Access","org":"Hathway Cable and Datacom Limited","as":"AS17488 Hathway IP Over Cable Internet","query":"60.254.0.126","browser_name":"Chrome","os_name":"Windows","browser_language":"en","device_type":"desktop","referrer_host":true,"referrer_path":true}' CHECK (json_valid(`description`)),
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `login_logs`
--

INSERT INTO `login_logs` (`id`, `user_id`, `login_time`, `logout_time`, `ip_address`, `description`, `created_at`, `updated_at`) VALUES
(1, 1, '2026-03-20 07:51:04', NULL, '8.8.8.8', '[{\"status\":\"success\",\"country\":\"United States\",\"countryCode\":\"US\",\"region\":\"VA\",\"regionName\":\"Virginia\",\"city\":\"Ashburn\",\"zip\":\"20149\",\"lat\":39.03,\"lon\":-77.5,\"timezone\":\"America\\/New_York\",\"isp\":\"Google LLC\",\"org\":\"Google Public DNS\",\"as\":\"AS15169 Google LLC\",\"query\":\"8.8.8.8\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"browser_language\":\"en-US,en;q=0.9,hi;q=0.8\",\"login_time\":\"2026-03-20 11:27:47\",\"logout_time\":null},{\"status\":\"success\",\"country\":\"United States\",\"countryCode\":\"US\",\"region\":\"VA\",\"regionName\":\"Virginia\",\"city\":\"Ashburn\",\"zip\":\"20149\",\"lat\":39.03,\"lon\":-77.5,\"timezone\":\"America\\/New_York\",\"isp\":\"Google LLC\",\"org\":\"Google Public DNS\",\"as\":\"AS15169 Google LLC\",\"query\":\"8.8.8.8\",\"browser_name\":\"Chrome\",\"os_name\":\"Windows\",\"device_type\":\"desktop\",\"browser_language\":\"en-US,en;q=0.9,hi;q=0.8\",\"login_time\":\"2026-03-20 13:21:04\",\"logout_time\":null}]', '2026-03-20 05:57:47', '2026-03-20 07:51:04'),
(2, 2, '2026-03-20 06:05:53', NULL, '8.8.8.8', '[{\"status\":\"success\",\"country\":\"United States\",\"countryCode\":\"US\",\"region\":\"VA\",\"regionName\":\"Virginia\",\"city\":\"Ashburn\",\"zip\":\"20149\",\"lat\":39.03,\"lon\":-77.5,\"timezone\":\"America\\/New_York\",\"isp\":\"Google LLC\",\"org\":\"Google Public DNS\",\"as\":\"AS15169 Google LLC\",\"query\":\"8.8.8.8\",\"browser_name\":false,\"os_name\":false,\"device_type\":\"mobile\",\"browser_language\":null,\"login_time\":\"2026-03-20 11:35:53\",\"logout_time\":null},{\"status\":\"success\",\"country\":\"United States\",\"countryCode\":\"US\",\"region\":\"VA\",\"regionName\":\"Virginia\",\"city\":\"Ashburn\",\"zip\":\"20149\",\"lat\":39.03,\"lon\":-77.5,\"timezone\":\"America\\/New_York\",\"isp\":\"Google LLC\",\"org\":\"Google Public DNS\",\"as\":\"AS15169 Google LLC\",\"query\":\"8.8.8.8\",\"browser_name\":false,\"os_name\":false,\"device_type\":\"mobile\",\"browser_language\":null,\"login_time\":\"2026-03-20 13:57:28\",\"logout_time\":null},{\"status\":\"success\",\"country\":\"United States\",\"countryCode\":\"US\",\"region\":\"VA\",\"regionName\":\"Virginia\",\"city\":\"Ashburn\",\"zip\":\"20149\",\"lat\":39.03,\"lon\":-77.5,\"timezone\":\"America\\/New_York\",\"isp\":\"Google LLC\",\"org\":\"Google Public DNS\",\"as\":\"AS15169 Google LLC\",\"query\":\"8.8.8.8\",\"browser_name\":false,\"os_name\":false,\"device_type\":\"mobile\",\"browser_language\":null,\"login_time\":\"2026-03-20 14:51:57\",\"logout_time\":null}]', '2026-03-20 06:05:53', '2026-03-20 09:21:57');

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2025_09_25_055557_create_menus_table', 1),
(5, '2025_09_25_055557_create_roles_table', 1),
(6, '2025_09_25_055558_create_menu_actions_table', 1),
(7, '2025_09_25_055558_create_role_based_menus_table', 1),
(8, '2025_09_25_055601_create_role_based_menu_actions_table', 1);

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

--
-- Table structure for table `password_reset_tokens`
--

CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `guard_name` varchar(50) NOT NULL DEFAULT 'web, api, admin, super_admin',
  `group_name` varchar(50) DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `permissions` (`id`, `name`, `description`, `guard_name`, `group_name`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'districts.index', NULL, 'web', 'District', 1, '2026-03-18 11:41:44', '2026-03-18 11:41:44', NULL);

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `vendor_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `category` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT NULL,
  `is_approved` enum('pending','approved','rejected','') NOT NULL DEFAULT 'pending',
  `remark` varchar(255) DEFAULT NULL,
  `approved_by` tinyint(4) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `vendor_id`, `name`, `category`, `description`, `image`, `is_active`, `is_approved`, `remark`, `approved_by`, `created_at`, `updated_at`, `created_by`, `updated_by`, `deleted_at`) VALUES
(2, 2, 'iPhone 16 PRO MAX', 'Mobiles', 'Latest Apple smartphone', 'products/images/LFbxOgQ9MDnbhpUiahI0olU1FCFRjsp9AqBmFrqC.jpg', 1, 'approved', NULL, 1, '2026-03-20 08:28:09', '2026-03-20 09:20:40', NULL, NULL, NULL);

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

--
-- Table structure for table `product_features_benefits`
--

CREATE TABLE `product_features_benefits` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `feature_benefit` text NOT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product_features_benefits`
--

INSERT INTO `product_features_benefits` (`id`, `product_id`, `feature_benefit`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 2, 'Fast charging support', NULL, NULL, '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL),
(2, 2, 'Water resistant', NULL, NULL, '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL),
(3, 2, 'High resolution camera', NULL, NULL, '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL);

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

--
-- Table structure for table `product_inventory_pricing`
--

CREATE TABLE `product_inventory_pricing` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `pricing_model` enum('fixed','dynamic') DEFAULT 'fixed',
  `price` decimal(10,2) NOT NULL,
  `actual_price` decimal(10,2) DEFAULT NULL,
  `availability` enum('available','out_of_stock','preorder','discontinued') DEFAULT 'available',
  `sku` varchar(100) DEFAULT NULL,
  `barcode` varchar(100) DEFAULT NULL,
  `is_tracking` tinyint(1) DEFAULT 1,
  `stock_quantity` int(11) DEFAULT 0,
  `low_stock_alert` int(11) DEFAULT 0,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product_inventory_pricing`
--

INSERT INTO `product_inventory_pricing` (`id`, `product_id`, `pricing_model`, `price`, `actual_price`, `availability`, `sku`, `barcode`, `is_tracking`, `stock_quantity`, `low_stock_alert`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(2, 2, 'fixed', 100000.00, 120000.00, 'available', 'IPH15-012', '123456789023', 1, 50, 5, NULL, NULL, '2026-03-20 08:28:09', '2026-03-20 08:40:20', NULL);

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

--
-- Table structure for table `product_shipping`
--

CREATE TABLE `product_shipping` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `is_shipping` tinyint(1) DEFAULT 1,
  `weight` decimal(10,2) DEFAULT NULL,
  `length` decimal(10,2) DEFAULT NULL,
  `width` decimal(10,2) DEFAULT NULL,
  `height` decimal(10,2) DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product_shipping`
--

INSERT INTO `product_shipping` (`id`, `product_id`, `is_shipping`, `weight`, `length`, `width`, `height`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 2, 1, 590.00, 6.30, 4.00, 6.80, NULL, NULL, '2026-03-20 08:28:09', '2026-03-20 08:38:35', NULL);

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

--
-- Table structure for table `product_tags`
--

CREATE TABLE `product_tags` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `tag` varchar(100) NOT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product_tags`
--

INSERT INTO `product_tags` (`id`, `product_id`, `tag`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 2, 'New', NULL, NULL, '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL),
(2, 2, 'Trending', NULL, NULL, '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL),
(3, 2, 'Bestseller', NULL, NULL, '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL);

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

--
-- Table structure for table `product_variants`
--

CREATE TABLE `product_variants` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `variant` varchar(100) NOT NULL,
  `option_value` varchar(100) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product_variants`
--

INSERT INTO `product_variants` (`id`, `product_id`, `variant`, `option_value`, `created_at`, `updated_at`, `created_by`, `updated_by`, `deleted_at`) VALUES
(1, 2, 'Color', 'Black', '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL, NULL, NULL),
(2, 2, 'Color', 'White', '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL, NULL, NULL),
(3, 2, 'Storage', '128GB', '2026-03-20 08:35:49', '2026-03-20 08:35:49', NULL, NULL, NULL);

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

--
-- Table structure for table `required_documents`
--

CREATE TABLE `required_documents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_group_id` bigint(20) UNSIGNED NOT NULL,
  `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '{"id": 1, "name": "Aadhar Card", "code": "aadhar_card", "is_mandatory": true, "document_type": ["pdf", "image"], "validity_period": "1 year"}' CHECK (json_valid(`description`)),
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `alias` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `guard_name` varchar(50) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `roles` (`id`, `name`, `alias`, `description`, `guard_name`, `is_active`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Super Admin', 'SADM', NULL, 'web', 1, NULL, NULL, '2025-09-24 19:04:23', '2026-02-10 12:41:28', NULL),
(2, 'Area Admin', 'ARAD', NULL, 'web', 1, NULL, NULL, NULL, '2026-02-10 12:41:48', NULL),
(3, 'Executive', 'EXEC', NULL, 'web', 1, NULL, NULL, NULL, '2026-02-10 04:10:03', NULL),
(4, 'Vendor', 'VEND', NULL, 'api', 1, NULL, NULL, '2026-02-10 04:09:03', '2026-02-10 04:09:03', NULL),
(5, 'Customer', 'CUST', NULL, 'api', 1, NULL, NULL, '2026-02-10 04:09:03', '2026-02-10 04:09:03', NULL),
(6, 'SUB EXECUTIVE', 'SUB-EX', NULL, 'api', 0, NULL, NULL, '2026-03-18 10:22:15', '2026-03-18 10:41:02', '2026-03-18 10:41:02');

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

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

CREATE TABLE `role_has_permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `service_category`
--

CREATE TABLE `service_category` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `service_category`
--

INSERT INTO `service_category` (`id`, `category_id`, `name`, `slug`, `description`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 3, 'HouseHelp', 'househelp', 'Helps in cleaning the house', 1, '2026-02-17 05:51:09', '2026-02-17 05:53:26', NULL);

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

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

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('GduS7Ekkb1JqYaOiLEfFywYbupXRThyxZtkmRRFE', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiMURhY1FhRXFuYm90SFdKM1FESXVGYVI3UE9CMk1Vc1QyS1BLbUQxUiI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NDk6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9hZG1pbi9hY3Rpdml0eS1sb2dzL2dldC1hbGwiO3M6NToicm91dGUiO3M6MTY6ImdldC5hbGwuYWN0aXZpdHkiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO3M6MTc6ImxvZ2luX2xvZ191c2VyX2lkIjtpOjE7fQ==', 1773998803),
('skgOqJBfRyCR6lQ9CMP0FTUhURnpEHPOnTP1o6og', 1, '127.0.0.1', 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/604.1', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiS0pEUVlMTHYyVTZ6VWQ0TTB6RkhrV1F3YVRBOHpIelV3SWhEalc2ZSI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NTA6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9hZG1pbi92ZW5kb3ItdmVyaWZpY2F0aW9ucy8zIjtzOjU6InJvdXRlIjtzOjI1OiJ2ZW5kb3IudmVyaWZpY2F0aW9ucy5zaG93Ijt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTtzOjE3OiJsb2dpbl9sb2dfdXNlcl9pZCI7aToxO30=', 1773988370);

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

--
-- Table structure for table `state`
--

CREATE TABLE `state` (
  `id` int(11) NOT NULL,
  `state_name` varchar(100) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `state`
--

INSERT INTO `state` (`id`, `state_name`, `created_at`, `updated_at`, `deleted_at`, `created_by`, `updated_by`) VALUES
(1, 'Maharashtra', '2026-02-23 17:59:42', '2026-02-23 17:59:50', NULL, NULL, NULL),
(2, 'Karnataka', '2026-02-23 18:02:42', '2026-02-23 18:02:42', NULL, 1, 1),
(3, 'Tamil Nadu', '2026-02-23 18:02:42', '2026-02-23 18:02:42', NULL, 1, 1),
(4, 'Gujarat', '2026-02-23 18:02:42', '2026-02-23 18:02:42', NULL, 1, 1);

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

--
-- Table structure for table `status_enum`
--

CREATE TABLE `status_enum` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `status_type` varchar(100) NOT NULL COMMENT 'e.g., category_group_status, business_registration_status',
  `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '{"id": 1, "name": "Active", "code": "active", "color": "#00FF00"}' CHECK (json_valid(`description`)),
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `status_update_logs`
--

CREATE TABLE `status_update_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_registration_id` bigint(20) UNSIGNED NOT NULL,
  `previous_status` bigint(20) UNSIGNED NOT NULL,
  `new_status` bigint(20) UNSIGNED NOT NULL,
  `changed_by` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `subscription_addons`
--

CREATE TABLE `subscription_addons` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `subscription_plan_id` bigint(20) UNSIGNED NOT NULL,
  `feature_id` bigint(20) UNSIGNED NOT NULL,
  `addon_price` decimal(10,2) NOT NULL COMMENT 'Price for adding this feature as an addon to the subscription plan',
  `addon_limit` int(11) DEFAULT NULL COMMENT 'Limit for this addon feature, NULL means unlimited',
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subscription_addons`
--

INSERT INTO `subscription_addons` (`id`, `subscription_plan_id`, `feature_id`, `addon_price`, `addon_limit`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 1, 1500.00, 2500, 1, '2026-02-20 05:53:13', '2026-02-20 05:56:34', NULL);

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

--
-- Table structure for table `subscription_feature_values`
--

CREATE TABLE `subscription_feature_values` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `subscription_plan_id` bigint(20) UNSIGNED NOT NULL,
  `feature_id` bigint(20) UNSIGNED NOT NULL,
  `feature_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'The value of the feature for this subscription plan, stored as JSON to accommodate different value types' CHECK (json_valid(`feature_value`)),
  `is_unlimited` tinyint(4) DEFAULT 0 COMMENT '1=Unlimited value for this feature, 0=Value is defined in feature_value',
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subscription_feature_values`
--

INSERT INTO `subscription_feature_values` (`id`, `subscription_plan_id`, `feature_id`, `feature_value`, `is_unlimited`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 1, '{\"name\":\"Priority Support\",\"value_type\":\"boolean\",\"is_core\":true,\"is_addon_allowed\":true}', 0, 1, '2026-02-20 05:53:13', '2026-02-20 05:56:34', NULL);

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

--
-- Table structure for table `subscription_plans`
--

CREATE TABLE `subscription_plans` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_group_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `billing_type` enum('onetime','recurring') NOT NULL DEFAULT 'recurring' COMMENT 'Defines if the plan is a one-time purchase or a recurring subscription',
  `billing_cycle` enum('monthly','quarterly','yearly','custom') NOT NULL DEFAULT 'monthly' COMMENT 'Defines the billing cycle for recurring subscriptions',
  `base_price` decimal(10,2) NOT NULL COMMENT 'The base price for the subscription plan',
  `setup_fee` decimal(10,2) DEFAULT 0.00 COMMENT 'One-time setup fee for the subscription plan',
  `trail_days` int(11) DEFAULT 0 COMMENT 'Number of trial days offered for the subscription plan',
  `is_custom_plan` tinyint(4) DEFAULT 0 COMMENT '1=Custom plan with flexible billing cycle, 0=Standard plan with fixed billing cycle',
  `is_popular` tinyint(4) DEFAULT 0 COMMENT '1=Popular plan, 0=Regular plan',
  `is_recommended` tinyint(4) DEFAULT 0 COMMENT '1=Recommended plan, 0=Regular plan',
  `max_users` int(11) DEFAULT NULL COMMENT 'Maximum number of users allowed under this subscription plan, NULL means unlimited',
  `max_services` int(11) DEFAULT NULL COMMENT 'Maximum number of services allowed under this subscription plan, NULL means unlimited',
  `max_leads` int(11) DEFAULT NULL COMMENT 'Maximum number of leads allowed under this subscription plan, NULL means unlimited',
  `sort_order` int(11) DEFAULT 0 COMMENT 'Defines the display order of subscription plans, lower numbers are displayed first',
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subscription_plans`
--

INSERT INTO `subscription_plans` (`id`, `category_group_id`, `name`, `slug`, `description`, `billing_type`, `billing_cycle`, `base_price`, `setup_fee`, `trail_days`, `is_custom_plan`, `is_popular`, `is_recommended`, `max_users`, `max_services`, `max_leads`, `sort_order`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'Family Plan', 'family-plan', 'Family Plan Recharge', 'recurring', 'quarterly', 2000.00, 1500.00, 10, 0, 1, 1, 10, 365, 100, 1, 1, '2026-02-20 05:53:13', '2026-02-20 05:56:34', NULL);

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(15) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `otp` varchar(10) DEFAULT NULL,
  `otp_expires_at` datetime DEFAULT NULL,
  `is_kyc_completed` tinyint(1) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `remember_token` varchar(100) DEFAULT NULL,
  `phone_verified_at` timestamp(1) NULL DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`id`, `role_id`, `name`, `email`, `phone`, `password`, `otp`, `otp_expires_at`, `is_kyc_completed`, `is_active`, `remember_token`, `phone_verified_at`, `email_verified_at`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'Administrator', 'admin@gmail.com', '9999999999', '$2y$12$c24eJe5CRXx9OXG0Jqum2Orx45sAXHbP4CF/F8LzsbNBF97iFtcCS', NULL, NULL, 0, 1, NULL, '0000-00-00 00:00:00.0', NULL, NULL, NULL, NULL, '2025-09-24 19:04:24', '2026-01-31 08:29:43', NULL),
(2, 4, 'Shree Ganesh Traders', 'shreyaschalke8@gmail.com', '9702997699', '$2y$12$mTv/kDs.19y2OklAdkJJ8eKrJkS8mCmVDJBPaYPi0jejpZnIrJSpi', NULL, NULL, 0, 1, NULL, NULL, '2026-03-20 06:05:18', NULL, NULL, NULL, '2026-03-20 06:04:54', '2026-03-20 06:05:18', NULL);

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

--
-- Table structure for table `user_consents`
--

CREATE TABLE `user_consents` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL COMMENT 'Reference to users table',
  `consent_type` enum('privacy_policy','personal_data_processing','terms_conditions') NOT NULL,
  `policy_version` varchar(20) NOT NULL COMMENT 'Version of policy accepted',
  `ip_address` varchar(45) NOT NULL COMMENT 'Supports IPv4 and IPv6',
  `user_agent` text DEFAULT NULL COMMENT 'Browser/device info',
  `consent_given_at` datetime NOT NULL DEFAULT current_timestamp(),
  `is_active` tinyint(1) DEFAULT 1 COMMENT '0 if withdrawn',
  `withdrawn_at` datetime 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 `user_permission_overrides`
--

CREATE TABLE `user_permission_overrides` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `type` enum('additional','limit') NOT NULL COMMENT 'additional=grant extra permission, limit=restrict permission',
  `is_active` tinyint(1) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `vendor_bank_details`
--

CREATE TABLE `vendor_bank_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `account_holder_name` varchar(512) NOT NULL,
  `account_number` varchar(512) NOT NULL,
  `ifsc_code` varchar(512) NOT NULL,
  `bank_name` varchar(150) NOT NULL,
  `upi_id` varchar(512) DEFAULT NULL,
  `bank_proof` varchar(512) NOT NULL,
  `verification_status` enum('pending','approved','rejected') DEFAULT 'pending',
  `verified_by` bigint(20) UNSIGNED DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `vendor_businesses`
--

CREATE TABLE `vendor_businesses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `business_name` varchar(255) NOT NULL,
  `business_email` varchar(150) DEFAULT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `category_type_id` bigint(20) UNSIGNED DEFAULT NULL,
  `subcategory_id` bigint(20) UNSIGNED DEFAULT NULL,
  `service_id` bigint(20) UNSIGNED DEFAULT NULL,
  `state_id` bigint(20) UNSIGNED NOT NULL,
  `city_id` bigint(20) UNSIGNED NOT NULL,
  `district_id` bigint(20) UNSIGNED DEFAULT NULL,
  `pincode` varchar(10) NOT NULL,
  `address` text NOT NULL,
  `has_physical_shop` enum('yes','no') DEFAULT 'no',
  `onboarding_step` tinyint(4) DEFAULT 1 COMMENT '1-6 onboarding progress',
  `profile_completion` tinyint(4) DEFAULT 0 COMMENT 'percentage',
  `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 `vendor_businesses`
--

INSERT INTO `vendor_businesses` (`id`, `user_id`, `business_name`, `business_email`, `category_id`, `category_type_id`, `subcategory_id`, `service_id`, `state_id`, `city_id`, `district_id`, `pincode`, `address`, `has_physical_shop`, `onboarding_step`, `profile_completion`, `created_at`, `updated_at`) VALUES
(3, 2, 'Shree Ganesh Traders', 'shreeganeshtraders@example.com', 1, 1, 2, 1, 1, 2, 1, '560001', 'Sector-17 Vashi Navi Mumbai', 'yes', 5, 100, '2026-03-20 06:07:07', '2026-03-20 06:15:52');

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

--
-- Table structure for table `vendor_business_details`
--

CREATE TABLE `vendor_business_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `shop_logo` varchar(255) DEFAULT NULL,
  `shop_banner` varchar(255) DEFAULT NULL,
  `shop_description` text DEFAULT NULL,
  `about_business` 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;

--
-- Dumping data for table `vendor_business_details`
--

INSERT INTO `vendor_business_details` (`id`, `business_id`, `shop_logo`, `shop_banner`, `shop_description`, `about_business`, `created_at`, `updated_at`) VALUES
(3, 3, 'vendor/logos/io010krGQxUB5xm0ElUIHQ1rAvzXYrb5rJXtCEE1.jpg', 'vendor/banners/LVqjsG3WHJDHh4DbDfVHszJiJsHVJOcEkyDAT4gg.jpg', 'We provide high quality electronic products.', 'Serving customers since 2015 with trusted service.', '2026-03-20 06:07:32', '2026-03-20 06:07:32');

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

--
-- Table structure for table `vendor_business_registrations`
--

CREATE TABLE `vendor_business_registrations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `registration_type` varchar(512) DEFAULT NULL,
  `registration_number` varchar(512) DEFAULT NULL,
  `registration_document` varchar(512) DEFAULT NULL,
  `verification_status` enum('pending','approved','rejected') DEFAULT 'pending',
  `verified_by` bigint(20) UNSIGNED DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `remarks` 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;

--
-- Dumping data for table `vendor_business_registrations`
--

INSERT INTO `vendor_business_registrations` (`id`, `business_id`, `registration_type`, `registration_number`, `registration_document`, `verification_status`, `verified_by`, `verified_at`, `remarks`, `created_at`, `updated_at`) VALUES
(2, 3, 'GST', 'eyJpdiI6Iks4d3BiM0RoUjEyODJ3Q1VhTHdlUEE9PSIsInZhbHVlIjoiczNjV25jdDZtdEdwWEt5K3lESzNDQT09IiwibWFjIjoiMmRlMDhmMjY0YTk5NDdkYTZiOTg4OWY4ODdlNjZjM2NlMzM1YjZlNmJiOGM4ODkyYTYyMjJhM2NhMTg3YWVmZCIsInRhZyI6IiJ9', 'eyJpdiI6IlpjR29SVTVyaXE3dW9qOWxyOTlPNlE9PSIsInZhbHVlIjoiUG11aWJqbjNtM0NvVmhHNmY3WWlkY3krWC82S1Z0NGtGNVVVK084VGJIam9kcElXN2tFczd5SmFpbklNcFBoUDE1dmo4UDZ5bDZqNkp4SktudEZpeGdrdzVJUUhtOU1EV2pHcFZCNERKeEk9IiwibWFjIjoiZDBiMzQxYTdmZmI3MDJmZjE3NzBhMGViMTBlZTQ2NWM3NTExNWNhMDBlNWViZGM4YjBjZjkyY2MwMTc0MDk3MSIsInRhZyI6IiJ9', 'approved', 1, '2026-03-20 08:19:33', NULL, '2026-03-20 06:15:52', '2026-03-20 08:19:33'),
(3, 3, 'Shop License', 'eyJpdiI6InA4a0R2TkFKald6Z2Zrbll3a0hEYkE9PSIsInZhbHVlIjoib0QyNmJmdC8za0ZKRVdyYzJCcTdjZEMxQ0FyZDNSbFByNzJkZExINFVXOD0iLCJtYWMiOiJiMjg2NmQxNzQ0Y2JkNzVmZTQ1NGYwODRhMGZjZjY1YmM2YjJlOGQ2Njc2ZjEwODA2N2VhNjAxZGZjMTgwYWE3IiwidGFnIjoiIn0=', 'eyJpdiI6ImFoTkkrZmNUTzFNNXE2N1VMQmI0ZkE9PSIsInZhbHVlIjoiZkt5c1Rvb0FkaW9iSmxhNllMUHNmN1ZwNkNsQkVqVlB0bjdWUHBFTVJ3SGZDSEk0a1oyNlNxRkhVUXh4QWFWVnBmVkhYdHVmSlJtakl3WVZPZ1cyTU5YamZzNkZrMS9jRy9IR05TVWtRT0k9IiwibWFjIjoiM2MxN2EzODg5ODUwMzVmYTk0Y2Y5OTBjYWYyYTYxM2U4ZDJjODE5NzMxMGMyYTYwMjA5ZGJhNmJlMDQ3ZWNlYyIsInRhZyI6IiJ9', 'approved', 1, '2026-03-20 08:19:38', NULL, '2026-03-20 06:15:52', '2026-03-20 08:19:38'),
(4, 3, 'Udyam Registration', 'eyJpdiI6ImdOanVJbW1qOG85MDI1VU5mMS9zR0E9PSIsInZhbHVlIjoidWo4Vm1xSS8rekd6eUxsTGtRK1BhUT09IiwibWFjIjoiOWVjOWI2MjNkOWJiMTJlMTg0ZDBlYmI0MjJjYWZlODQ3NGU0NWUyNmY0MWMxOWUxNGI0M2FiMmMzOThhNjBiMCIsInRhZyI6IiJ9', 'eyJpdiI6InVwVEFFVGlkSm9EYTJmaTY4UmpiK1E9PSIsInZhbHVlIjoiYncxdjF5QlM0L3QxcStLeXk4TWNIOUVEQXZQMDF1WFZBUmVzNklpUkJJTGtmckcwcGZuV3ZrQWJzc3Jsc3dDTUFNUmRXWkNYZ3h5dXZQWTlqRVhqUklNSVVubnlMZno0dENsa0VvbGdicFE9IiwibWFjIjoiNTAxZTNlNmUzMjFkMWY5YTkzODEzOGE5YTcyOTg1Yzg0YjE3MDJmZDE2MjY3N2E1YWRjNzk4MjAwODQxM2Q0YyIsInRhZyI6IiJ9', 'rejected', 1, '2026-03-20 08:19:46', 'Fake', '2026-03-20 06:15:52', '2026-03-20 08:19:46');

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

--
-- Table structure for table `vendor_government_ids`
--

CREATE TABLE `vendor_government_ids` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `id_type` varchar(255) NOT NULL,
  `id_number` varchar(255) NOT NULL,
  `id_document` varchar(512) NOT NULL,
  `verification_status` enum('pending','approved','rejected') DEFAULT 'pending',
  `verified_by` bigint(20) UNSIGNED DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `remarks` 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;

--
-- Dumping data for table `vendor_government_ids`
--

INSERT INTO `vendor_government_ids` (`id`, `business_id`, `id_type`, `id_number`, `id_document`, `verification_status`, `verified_by`, `verified_at`, `remarks`, `created_at`, `updated_at`) VALUES
(3, 3, 'AADHAR CARD', 'eyJpdiI6IkpLWkFJY3VIdkh0M005OVRDQ29BZ1E9PSIsInZhbHVlIjoiT2tqbzBKYkl5RVNXQ0dqWUt5K3I5Zz09IiwibWFjIjoiZTdhMDcwNWM5MzEzNTAxOWJjMDRjZTcxMzg5NDEyZTI3YTFiMzg2NzAzNTZlMzFjYjkwZjM4ZTFiY2YzMGZmZiIsInRhZyI6IiJ9', 'eyJpdiI6ImRNcGl1dDM2d0ZISHNJeHljSUNkNXc9PSIsInZhbHVlIjoiRlZoUFdZMVRaUGRPWENsQzhkQjNDYXgzaUJYaFZoTjlBODVNRTBtd1FrdGhTa2pzdFpuWDgwenZXWWhZK3JEWjlOVWwzbmhkUlQrdWh3V3Q4QXV0NGptMy9tM0xpbThvdHorV2F6MjhhNVk9IiwibWFjIjoiNDA0NmE3MTcxYjA4NmEyZGNlMGRlN2I0ZWYwNGExMjVmMWQ5YmY1ZDU1MDIyY2JiNGQ4MjVjN2I5ZmNlNmE3NCIsInRhZyI6IiJ9', 'approved', 1, '2026-03-20 08:19:25', NULL, '2026-03-20 06:09:25', '2026-03-20 08:19:25'),
(4, 3, 'PAN CARD', 'eyJpdiI6InRaUFV1OHdDUk9qN0k0UWRnd0RKQ3c9PSIsInZhbHVlIjoicld1aVdybXJNaStUZ0VqbnNCNTc1dz09IiwibWFjIjoiMGZmMmNmYTJhYzIzNzIwYTdmYmRmNDIxODVmNjc3YTJkZGJkNDU3YWQ0MzY0NDNlMWQzNDRkZTUyYjUxMmZhZiIsInRhZyI6IiJ9', 'eyJpdiI6Ik05MFVnWTZHY1poSzBHQ1didGdTeGc9PSIsInZhbHVlIjoiaHluNU4vWkF3ek5VL01QRGpwNE5Iakd1emp1ZlRZcVNDTUUzWDNibU50aUlqSWl2VDFtdHcwY0RVRnFEOVFQWXNLSmpYMzl0cGgybFU1OFFDbGtkdHdaRk5OUi8wUmlFOUYrMFdTODFLa0k9IiwibWFjIjoiZDJkOWZlZWE0MDQzZGExNTM1NTdkMjMzN2MxMDRkZDk2NGNjMGZlNzNjODY5OGM2MzVjMDEyODE5YWQyMTRhNiIsInRhZyI6IiJ9', 'approved', 1, '2026-03-20 08:19:29', NULL, '2026-03-20 06:09:25', '2026-03-20 08:19:29');

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

--
-- Table structure for table `vendor_operating_hours`
--

CREATE TABLE `vendor_operating_hours` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `day` enum('mon','tue','wed','thu','fri','sat','sun') NOT NULL,
  `open_time` time NOT NULL,
  `close_time` time NOT NULL,
  `is_closed` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vendor_operating_hours`
--

INSERT INTO `vendor_operating_hours` (`id`, `business_id`, `day`, `open_time`, `close_time`, `is_closed`) VALUES
(8, 3, 'mon', '09:00:00', '18:00:00', 0),
(9, 3, 'tue', '09:00:00', '18:00:00', 0),
(10, 3, 'wed', '09:00:00', '18:00:00', 0),
(11, 3, 'thu', '09:00:00', '18:00:00', 0),
(12, 3, 'fri', '09:00:00', '18:00:00', 0),
(13, 3, 'sat', '10:00:00', '16:00:00', 0),
(14, 3, 'sun', '00:00:00', '00:00:00', 1);

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

--
-- Table structure for table `vendor_serviceable_regions`
--

CREATE TABLE `vendor_serviceable_regions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `state_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `district_id` bigint(20) UNSIGNED DEFAULT NULL,
  `pincode` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vendor_serviceable_regions`
--

INSERT INTO `vendor_serviceable_regions` (`id`, `business_id`, `state_id`, `city_id`, `district_id`, `pincode`) VALUES
(3, 3, 1, 1, 1, '560001'),
(4, 3, 2, 2, 2, '560002');

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

--
-- Table structure for table `vendor_social_links`
--

CREATE TABLE `vendor_social_links` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `facebook_url` varchar(255) DEFAULT NULL,
  `instagram_url` varchar(255) DEFAULT NULL,
  `twitter_url` varchar(255) DEFAULT NULL,
  `website_url` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vendor_social_links`
--

INSERT INTO `vendor_social_links` (`id`, `business_id`, `facebook_url`, `instagram_url`, `twitter_url`, `website_url`) VALUES
(2, 3, 'https://facebook.com/shreeganeshtrader', 'https://instagram.com/shreeganeshtrader', 'https://twitter.com/shreeganeshtrader', 'https://www.shreeganeshtrader.com');

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

--
-- Table structure for table `vendor_verifications`
--

CREATE TABLE `vendor_verifications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `verification_mode` enum('online','offline') NOT NULL,
  `visit_date` date DEFAULT NULL,
  `overall_status` enum('pending','approved','rejected') DEFAULT 'pending',
  `admin_id` bigint(20) UNSIGNED NOT NULL,
  `remarks` text DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT 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 `vendor_verifications`
--

INSERT INTO `vendor_verifications` (`id`, `business_id`, `verification_mode`, `visit_date`, `overall_status`, `admin_id`, `remarks`, `verified_at`, `created_at`, `updated_at`) VALUES
(2, 3, 'online', NULL, 'approved', 1, NULL, '2026-03-20 08:19:53', '2026-03-20 08:19:53', '2026-03-20 08:19:53');

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

--
-- Table structure for table `zonal_areas`
--

CREATE TABLE `zonal_areas` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `zone_id` bigint(20) UNSIGNED NOT NULL,
  `pincode` varchar(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `zonal_areas`
--

INSERT INTO `zonal_areas` (`id`, `zone_id`, `pincode`, `name`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 3, '400703', 'Vashi', 1, '2026-02-11 09:46:50', '2026-02-11 09:48:47', NULL);

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

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

CREATE TABLE `zones` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `state` varchar(100) NOT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT 1 COMMENT '1=Active, 0=Inactive',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `zones` (`id`, `name`, `state`, `latitude`, `longitude`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Vashi', 'Maharashtra', 12.00323300, 45.99000000, 1, '2026-02-11 08:03:01', '2026-02-11 08:05:43', '2026-02-11 08:05:43'),
(2, 'Vashi', 'Maharashtra', 12.00323301, 45.99000000, 1, '2026-02-11 08:06:44', '2026-02-11 08:07:14', '2026-02-11 08:07:14'),
(3, 'Mumbai', 'Maharashtra', 12.00323300, 45.99000000, 1, '2026-02-11 09:46:29', '2026-02-11 09:46:29', NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activity_logs`
--
ALTER TABLE `activity_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_activity_user` (`user_id`),
  ADD KEY `idx_activity_type` (`activity_type`),
  ADD KEY `idx_activity_user_time` (`user_id`,`created_at`);

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

--
-- Indexes for table `business_addresses`
--
ALTER TABLE `business_addresses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uk_business_address` (`business_registration_id`,`address_line1`,`city`,`state`,`pincode`),
  ADD KEY `idx_ba_business` (`business_registration_id`),
  ADD KEY `idx_ba_business_active` (`business_registration_id`,`is_active`),
  ADD KEY `idx_ba_state_city` (`state`,`city`);

--
-- Indexes for table `business_documents`
--
ALTER TABLE `business_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_business_registration_id` (`business_registration_id`),
  ADD KEY `idx_document_status` (`document_status`);

--
-- Indexes for table `business_registration`
--
ALTER TABLE `business_registration`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `registration_number` (`registration_number`),
  ADD KEY `idx_user_id` (`user_id`),
  ADD KEY `idx_category_group_id` (`category_group_id`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `business_types`
--
ALTER TABLE `business_types`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_name` (`name`),
  ADD KEY `idx_slug` (`slug`);

--
-- Indexes for table `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`);

--
-- Indexes for table `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_parent_id` (`parent_id`);

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

--
-- Indexes for table `category_group_mappings`
--
ALTER TABLE `category_group_mappings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_category_group` (`category_group_id`,`category_id`),
  ADD KEY `idx_group_id` (`category_group_id`),
  ADD KEY `idx_category_id` (`category_id`);

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

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

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `features`
--
ALTER TABLE `features`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_slug` (`slug`),
  ADD KEY `idx_name` (`name`);

--
-- Indexes for table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

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

--
-- Indexes for table `login_logs`
--
ALTER TABLE `login_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_id` (`user_id`),
  ADD KEY `idx_login_time` (`login_time`),
  ADD KEY `idx_ip_address` (`ip_address`),
  ADD KEY `idx_user_login_time` (`user_id`,`login_time`),
  ADD KEY `idx_user_active` (`user_id`,`logout_time`);

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

--
-- Indexes for table `password_reset_tokens`
--
ALTER TABLE `password_reset_tokens`
  ADD PRIMARY KEY (`email`);

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

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

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

--
-- Indexes for table `product_inventory_pricing`
--
ALTER TABLE `product_inventory_pricing`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `sku` (`sku`),
  ADD UNIQUE KEY `barcode` (`barcode`);

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

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

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

--
-- Indexes for table `required_documents`
--
ALTER TABLE `required_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_category_group_id` (`category_group_id`);

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

--
-- Indexes for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_role_permission` (`role_id`,`permission_id`),
  ADD KEY `idx_role_id` (`role_id`),
  ADD KEY `idx_permission_id` (`permission_id`);

--
-- Indexes for table `service_category`
--
ALTER TABLE `service_category`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_category_id` (`category_id`),
  ADD KEY `idx_name` (`name`),
  ADD KEY `idx_slug` (`slug`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

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

--
-- Indexes for table `status_enum`
--
ALTER TABLE `status_enum`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_type_code` (`status_type`),
  ADD KEY `idx_type` (`status_type`);

--
-- Indexes for table `status_update_logs`
--
ALTER TABLE `status_update_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_business_registration_id` (`business_registration_id`),
  ADD KEY `idx_changed_by` (`changed_by`),
  ADD KEY `fk_sual_previous_status` (`previous_status`),
  ADD KEY `fk_sual_new_status` (`new_status`);

--
-- Indexes for table `subscription_addons`
--
ALTER TABLE `subscription_addons`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_subscription_plan_id` (`subscription_plan_id`),
  ADD KEY `idx_feature_id` (`feature_id`);

--
-- Indexes for table `subscription_feature_values`
--
ALTER TABLE `subscription_feature_values`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_plan_feature` (`subscription_plan_id`,`feature_id`),
  ADD KEY `idx_subscription_plan_id` (`subscription_plan_id`),
  ADD KEY `idx_feature_id` (`feature_id`);

--
-- Indexes for table `subscription_plans`
--
ALTER TABLE `subscription_plans`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_slug` (`slug`),
  ADD KEY `idx_billing_type` (`billing_type`),
  ADD KEY `idx_billing_cycle` (`billing_cycle`),
  ADD KEY `idx_is_popular` (`is_popular`),
  ADD KEY `idx_is_recommended` (`is_recommended`);

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

--
-- Indexes for table `user_consents`
--
ALTER TABLE `user_consents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_id` (`user_id`),
  ADD KEY `idx_consent_type` (`consent_type`);

--
-- Indexes for table `user_permission_overrides`
--
ALTER TABLE `user_permission_overrides`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_user_permission_type` (`user_id`,`permission_id`,`type`,`deleted_at`),
  ADD KEY `idx_user_id` (`user_id`),
  ADD KEY `idx_permission_id` (`permission_id`);

--
-- Indexes for table `vendor_bank_details`
--
ALTER TABLE `vendor_bank_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_id` (`business_id`);

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

--
-- Indexes for table `vendor_business_details`
--
ALTER TABLE `vendor_business_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_id` (`business_id`);

--
-- Indexes for table `vendor_business_registrations`
--
ALTER TABLE `vendor_business_registrations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_id` (`business_id`);

--
-- Indexes for table `vendor_government_ids`
--
ALTER TABLE `vendor_government_ids`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_id` (`business_id`);

--
-- Indexes for table `vendor_operating_hours`
--
ALTER TABLE `vendor_operating_hours`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_id` (`business_id`);

--
-- Indexes for table `vendor_serviceable_regions`
--
ALTER TABLE `vendor_serviceable_regions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_id` (`business_id`);

--
-- Indexes for table `vendor_social_links`
--
ALTER TABLE `vendor_social_links`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_id` (`business_id`);

--
-- Indexes for table `vendor_verifications`
--
ALTER TABLE `vendor_verifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_id` (`business_id`);

--
-- Indexes for table `zonal_areas`
--
ALTER TABLE `zonal_areas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_zone_id` (`zone_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

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

--
-- Constraints for table `business_addresses`
--
ALTER TABLE `business_addresses`
  ADD CONSTRAINT `fk_ba_business_registration` FOREIGN KEY (`business_registration_id`) REFERENCES `business_registration` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `business_documents`
--
ALTER TABLE `business_documents`
  ADD CONSTRAINT `fk_bd_business_registration` FOREIGN KEY (`business_registration_id`) REFERENCES `business_registration` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_bd_document_status` FOREIGN KEY (`document_status`) REFERENCES `status_enum` (`id`);

--
-- Constraints for table `business_registration`
--
ALTER TABLE `business_registration`
  ADD CONSTRAINT `fk_br_category_group` FOREIGN KEY (`category_group_id`) REFERENCES `category_groups` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_br_status` FOREIGN KEY (`status`) REFERENCES `status_enum` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_br_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `categories`
--
ALTER TABLE `categories`
  ADD CONSTRAINT `fk_categories_parent` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `category_group_mappings`
--
ALTER TABLE `category_group_mappings`
  ADD CONSTRAINT `fk_cgm_category` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_cgm_group` FOREIGN KEY (`category_group_id`) REFERENCES `category_groups` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `required_documents`
--
ALTER TABLE `required_documents`
  ADD CONSTRAINT `fk_rd_category_group` FOREIGN KEY (`category_group_id`) REFERENCES `category_groups` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD CONSTRAINT `fk_rpm_permission` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_rpm_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `service_category`
--
ALTER TABLE `service_category`
  ADD CONSTRAINT `fk_service_category_category` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `status_update_logs`
--
ALTER TABLE `status_update_logs`
  ADD CONSTRAINT `fk_sual_business_registration` FOREIGN KEY (`business_registration_id`) REFERENCES `business_registration` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_sual_changed_by` FOREIGN KEY (`changed_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `fk_sual_new_status` FOREIGN KEY (`new_status`) REFERENCES `status_enum` (`id`),
  ADD CONSTRAINT `fk_sual_previous_status` FOREIGN KEY (`previous_status`) REFERENCES `status_enum` (`id`);

--
-- Constraints for table `subscription_addons`
--
ALTER TABLE `subscription_addons`
  ADD CONSTRAINT `fk_sa_feature` FOREIGN KEY (`feature_id`) REFERENCES `features` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_sa_subscription_plan` FOREIGN KEY (`subscription_plan_id`) REFERENCES `subscription_plans` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscription_feature_values`
--
ALTER TABLE `subscription_feature_values`
  ADD CONSTRAINT `fk_spf_feature` FOREIGN KEY (`feature_id`) REFERENCES `features` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_spf_subscription_plan` FOREIGN KEY (`subscription_plan_id`) REFERENCES `subscription_plans` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `fk_users_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL;

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

--
-- Constraints for table `user_permission_overrides`
--
ALTER TABLE `user_permission_overrides`
  ADD CONSTRAINT `user_permission_overrides_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_permission_overrides_ibfk_2` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vendor_bank_details`
--
ALTER TABLE `vendor_bank_details`
  ADD CONSTRAINT `vendor_bank_details_ibfk_1` FOREIGN KEY (`business_id`) REFERENCES `vendor_businesses` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `vendor_business_details`
--
ALTER TABLE `vendor_business_details`
  ADD CONSTRAINT `vendor_business_details_ibfk_1` FOREIGN KEY (`business_id`) REFERENCES `vendor_businesses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vendor_business_registrations`
--
ALTER TABLE `vendor_business_registrations`
  ADD CONSTRAINT `vendor_business_registrations_ibfk_1` FOREIGN KEY (`business_id`) REFERENCES `vendor_businesses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vendor_government_ids`
--
ALTER TABLE `vendor_government_ids`
  ADD CONSTRAINT `vendor_government_ids_ibfk_1` FOREIGN KEY (`business_id`) REFERENCES `vendor_businesses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vendor_operating_hours`
--
ALTER TABLE `vendor_operating_hours`
  ADD CONSTRAINT `vendor_operating_hours_ibfk_1` FOREIGN KEY (`business_id`) REFERENCES `vendor_businesses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vendor_serviceable_regions`
--
ALTER TABLE `vendor_serviceable_regions`
  ADD CONSTRAINT `vendor_serviceable_regions_ibfk_1` FOREIGN KEY (`business_id`) REFERENCES `vendor_businesses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vendor_social_links`
--
ALTER TABLE `vendor_social_links`
  ADD CONSTRAINT `vendor_social_links_ibfk_1` FOREIGN KEY (`business_id`) REFERENCES `vendor_businesses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vendor_verifications`
--
ALTER TABLE `vendor_verifications`
  ADD CONSTRAINT `vendor_verifications_ibfk_1` FOREIGN KEY (`business_id`) REFERENCES `vendor_businesses` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `zonal_areas`
--
ALTER TABLE `zonal_areas`
  ADD CONSTRAINT `fk_zonal_area_zone` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`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 */;