-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 27, 2026 at 11:53 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: `odyssey_sabari`
--

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

--
-- 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;

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

--
-- 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(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `cities` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `district_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `cities` (`id`, `district_id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 'Anna Nagar', 1, '2026-05-26 08:16:25', '2026-05-26 08:16:25'),
(2, 1, 'T Nagar', 1, '2026-05-26 08:16:25', '2026-05-26 08:16:25'),
(3, 2, 'Paramakudi', 1, '2026-05-26 08:16:25', '2026-05-26 08:16:25'),
(4, 2, 'Melur', 1, '2026-05-26 08:16:25', '2026-05-26 08:16:25'),
(5, 3, 'Gajuwaka', 1, '2026-05-26 08:16:25', '2026-05-26 08:16:25'),
(6, 4, 'Benz Circle', 1, '2026-05-26 08:16:25', '2026-05-26 08:16:25');

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

--
-- Table structure for table `clients`
--

CREATE TABLE `clients` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `client_code` varchar(255) DEFAULT NULL,
  `company_name` varchar(255) NOT NULL,
  `contact_person` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `alternate_phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `country_id` bigint(20) UNSIGNED DEFAULT NULL,
  `state_id` bigint(20) UNSIGNED DEFAULT NULL,
  `district_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `billing_address` text DEFAULT NULL,
  `billing_site` text DEFAULT NULL,
  `pincode` varchar(255) DEFAULT NULL,
  `gst_number` varchar(255) DEFAULT NULL,
  `lead_source` varchar(255) DEFAULT NULL,
  `assigned_bde_id` bigint(20) UNSIGNED DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `clients`
--

INSERT INTO `clients` (`id`, `client_code`, `company_name`, `contact_person`, `phone`, `alternate_phone`, `email`, `country_id`, `state_id`, `district_id`, `city_id`, `address`, `pincode`, `gst_number`, `lead_source`, `assigned_bde_id`, `remarks`, `status`, `created_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, NULL, 'Smoke Co', 'Smoke Client', '9000000000', NULL, 'smoke-client@example.com', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active', NULL, '2026-05-25 13:58:57', '2026-05-25 13:58:57', NULL),
(2, NULL, 'Smoke Co', 'Smoke Client', '9000000000', NULL, 'smoke-client@example.com', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active', NULL, '2026-05-25 13:59:09', '2026-05-25 13:59:09', NULL),
(3, NULL, 'Smoke Co', 'Smoke Client', '9000000000', NULL, 'smoke-client@example.com', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active', NULL, '2026-05-25 14:04:21', '2026-05-25 14:04:21', NULL),
(4, NULL, 'Smoke Co', 'Smoke Client', '9000000000', NULL, 'smoke-client@example.com', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active', NULL, '2026-05-25 14:08:36', '2026-05-25 14:08:36', NULL),
(9, 'CLI-1779777592', 'Dextra', 'Sabarinathan', '9790773419', NULL, 'sabarikenathan@gmail.com', NULL, NULL, NULL, NULL, 'Velachery Chennai', NULL, NULL, NULL, 11, NULL, 'lead', 11, '2026-05-26 06:39:52', '2026-05-26 06:39:52', NULL),
(11, 'CLI-1779867439', 'Dextra Tech', 'Sabarinathan', '9790773419', NULL, 'sabari@gmail.com', 1, 1, 1, 2, 'Velachery chennai', NULL, NULL, NULL, 20, NULL, 'lead', 20, '2026-05-27 07:37:19', '2026-05-27 07:37:19', NULL);

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

--
-- Table structure for table `countries`
--

CREATE TABLE `countries` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `currency` varchar(255) DEFAULT NULL,
  `phone_code` varchar(255) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `countries`
--

INSERT INTO `countries` (`id`, `name`, `code`, `currency`, `phone_code`, `status`, `created_at`, `updated_at`) VALUES
(1, 'India', 'IN', 'INR', '+91', 1, '2026-05-26 08:15:37', '2026-05-26 08:15:37');

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

--
-- Table structure for table `districts`
--

CREATE TABLE `districts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `state_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `districts`
--

INSERT INTO `districts` (`id`, `state_id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 'Chennai', 1, '2026-05-26 08:16:14', '2026-05-26 08:16:14'),
(2, 1, 'Madurai', 1, '2026-05-26 08:16:14', '2026-05-26 08:16:14'),
(3, 2, 'Visakhapatnam', 1, '2026-05-26 08:16:14', '2026-05-26 08:16:14'),
(4, 2, 'Vijayawada', 1, '2026-05-26 08:16:14', '2026-05-26 08:16:14');

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

--
-- 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 `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 `lift_products`
--

CREATE TABLE `lift_products` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_code` varchar(255) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `outer_diameter` varchar(255) DEFAULT NULL,
  `cabin_diameter` varchar(255) DEFAULT NULL,
  `door_clear_access` varchar(255) DEFAULT NULL,
  `door_opening` varchar(255) DEFAULT NULL,
  `cabin_height` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `base_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `capacity` varchar(255) DEFAULT NULL,
  `floors` varchar(255) DEFAULT NULL,
  `speed` varchar(255) DEFAULT NULL,
  `dimensions` varchar(255) DEFAULT NULL,
  `motor_type` varchar(255) DEFAULT NULL,
  `drive_power` varchar(255) DEFAULT NULL,
  `power_phase` varchar(255) DEFAULT NULL,
  `horsepower` varchar(255) DEFAULT NULL,
  `power_consumption` varchar(255) DEFAULT NULL,
  `door_type` varchar(255) DEFAULT NULL,
  `car_size` varchar(255) DEFAULT NULL,
  `travel_height` varchar(255) DEFAULT NULL,
  `min_headroom` varchar(255) DEFAULT NULL,
  `colors` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`colors`)),
  `safety_features` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`safety_features`)),
  `shaft_size` varchar(255) DEFAULT NULL,
  `machine_room_type` varchar(255) DEFAULT NULL,
  `drive_type` varchar(255) DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `lift_products`
--

INSERT INTO `lift_products` (`id`, `product_code`, `name`, `type`, `category`, `outer_diameter`, `cabin_diameter`, `door_clear_access`, `door_opening`, `cabin_height`, `description`, `base_price`, `capacity`, `floors`, `speed`, `dimensions`, `motor_type`, `drive_power`, `power_phase`, `horsepower`, `power_consumption`, `door_type`, `car_size`, `travel_height`, `min_headroom`, `colors`, `safety_features`, `shaft_size`, `machine_room_type`, `drive_type`, `image`, `status`, `created_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'LIFT-1779442260', 'Odyssey Nova Max', 'passenger', 'hydraulic', NULL, NULL, NULL, NULL, NULL, 'Premium high-speed passenger lift with advanced safety and smooth operation.', 850000.00, '1000', '10', '1.5', NULL, 'variable_frequency', NULL, NULL, NULL, NULL, 'automatic', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'https://odysseyelevators.com/wp-content/uploads/2025/12/cropped-odessey-logo-768x325-1-1-1-32x32.jpg', 1, 2, '2026-05-22 09:31:00', '2026-05-22 09:31:00', NULL),
(2, 'LIFT-1779442697', 'Odyssey Elite Pro', 'panoramic', 'roped', NULL, NULL, NULL, NULL, NULL, 'Modern panoramic glass lift designed for luxury villas, hotels, and commercial buildings.', 1250000.00, '630', '6', '1.0', NULL, 'ac', NULL, NULL, NULL, NULL, 'sliding', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'https://odysseyelevators.com/wp-content/uploads/2025/12/cropped-odessey-logo-768x325-1-1-1-32x32.jpg', 1, 2, '2026-05-22 09:38:17', '2026-05-22 09:38:17', NULL),
(3, 'LIFT-1779699185', 'Odyssey Orbit Micro', 'passenger', NULL, '1000 mm', '700 mm', '500 mm', 'Manual', '2000 mm', 'The Orbit Micro is a 1-passenger masterpiece engineered for the intimate corners of the modern home, where perfect design speaks louder than scale.', 450000.00, '150', '5', '0.15', NULL, NULL, '3.7 KW', 'Single or 3 Phase', '0.15 m/s (Single Phase) OR 0.3 m/s (3 Phase)', 'Single or 3 Phase', NULL, NULL, 'UpTo 9 Metres', '2800 mm', '[null]', '[null]', NULL, NULL, NULL, 'https://odysseyelevators.com/wp-content/uploads/2025/12/cropped-odessey-logo-768x325-1-1-1-32x32.jpg', 1, 2, '2026-05-25 08:53:05', '2026-05-25 09:03:15', NULL);

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

--
-- Table structure for table `meeting_schedules`
--

CREATE TABLE `meeting_schedules` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `meeting_id` int(11) NOT NULL,
  `month_id` bigint(20) UNSIGNED DEFAULT NULL,
  `year` int(11) NOT NULL,
  `month` int(11) NOT NULL,
  `week` int(11) NOT NULL,
  `meeting_date` date NOT NULL,
  `status` enum('scheduled','completed','cancelled') NOT NULL DEFAULT 'scheduled',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `members`
--

CREATE TABLE `members` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `company` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `expire_schedule_id` int(11) DEFAULT NULL,
  `renewal_schedule_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `membership_payments`
--

CREATE TABLE `membership_payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `member_id` bigint(20) UNSIGNED NOT NULL,
  `months` int(11) NOT NULL,
  `start_month` varchar(255) NOT NULL,
  `expiry_month` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `payment_method` varchar(255) DEFAULT NULL,
  `payment_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `migrations` (
  `id` int(10) 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
(44, '2026_05_20_191818_create_users_table', 1),
(72, '0001_01_01_000001_create_cache_table', 2),
(73, '0001_01_01_000002_create_jobs_table', 2),
(74, '2026_03_14_075659_create_members_table', 2),
(75, '2026_03_14_075709_create_visitors_table', 2),
(76, '2026_03_14_075754_create_membership_visit_payments_table', 2),
(77, '2026_03_14_141900_add_payment_mode_and_paid_to_to_visitors_table', 2),
(78, '2026_03_16_105201_add_status_and_payment_details_to_visitors_table', 2),
(79, '2026_03_16_124614_create_meeting_schedules_table', 2),
(80, '2026_03_17_130918_create_categories_table', 2),
(81, '2026_03_17_131110_add_category_id_to_members_table', 2),
(82, '2026_03_18_115243_add_expire_renewal_schedule_to_members_table', 2),
(83, '2026_03_18_172142_create_payments_table', 2),
(84, '2026_03_18_173446_add_upi_columns_to_payments_table', 2),
(85, '2026_03_19_064828_create_months_table', 2),
(86, '2026_03_19_065553_add_month_id_to_meeting_schedules_table', 2),
(87, '2026_03_20_074628_add_penalty_column_to_payments_table', 2),
(88, '2026_03_21_115118_add_meeting_id_column_to_visitors_table', 2),
(89, '2026_03_21_131846_add_late_fee_column_to_months_table', 2),
(90, '2026_05_20_191759_create_roles_table', 2),
(91, '2026_05_20_191944_create_countries_table', 2),
(92, '2026_05_20_191959_create_states_table', 2),
(93, '2026_05_20_192013_create_districts_table', 2),
(94, '2026_05_20_192026_create_cities_table', 2),
(95, '2026_05_20_192037_create_users_table', 2),
(96, '2026_05_20_192051_create_lift_products_table', 2),
(97, '2026_05_20_192125_create_clients_table', 2),
(98, '2026_05_20_192139_create_proposals_table', 2),
(99, '2026_05_20_192153_create_proposal_approvals_table', 2),
(100, '2026_05_20_192206_create_proposal_histories_table', 2),
(101, '2026_05_20_192219_create_role_discount_limits_table', 2),
(102, '2026_05_20_192232_create_tax_settings_table', 2),
(103, '2026_05_20_194607_create_sessions_table', 3),
(104, '2026_05_25_110000_add_engineering_fields_to_lift_products_table', 4),
(105, '2026_05_25_120500_add_extension_fields_to_lift_products_table', 5);

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

--
-- Table structure for table `months`
--

CREATE TABLE `months` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `late_fee` decimal(10,2) NOT NULL DEFAULT 0.00,
  `year` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `member_id` bigint(20) UNSIGNED NOT NULL,
  `duration` int(11) NOT NULL,
  `payment_from` bigint(20) UNSIGNED NOT NULL,
  `payment_end_month` bigint(20) UNSIGNED NOT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `penalty` decimal(10,2) NOT NULL DEFAULT 0.00,
  `payment_method` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `upi_number` varchar(255) DEFAULT NULL,
  `transaction_number` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `proposals`
--

CREATE TABLE `proposals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `proposal_number` varchar(255) NOT NULL,
  `reference_number` varchar(255) DEFAULT NULL,
  `client_id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `assigned_bde_id` bigint(20) UNSIGNED DEFAULT NULL,
  `current_handler_id` bigint(20) UNSIGNED DEFAULT NULL,
  `country_id` bigint(20) UNSIGNED DEFAULT NULL,
  `state_id` bigint(20) UNSIGNED DEFAULT NULL,
  `district_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `original_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `requested_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `approved_price` decimal(15,2) DEFAULT 0.00,
  `discount_percentage` decimal(5,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `gst_percentage` decimal(5,2) NOT NULL DEFAULT 0.00,
  `gst_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `final_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `approval_level` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'draft',
  `valid_until` date DEFAULT NULL,
  `payment_terms` text DEFAULT NULL,
  `delivery_terms` text DEFAULT NULL,
  `installation_notes` text DEFAULT NULL,
  `terms_and_conditions` longtext DEFAULT NULL,
  `client_confirmation_status` varchar(255) DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `proposals`
--

INSERT INTO `proposals` (`id`, `proposal_number`, `reference_number`, `client_id`, `product_id`, `created_by`, `assigned_bde_id`, `current_handler_id`, `country_id`, `state_id`, `district_id`, `city_id`, `original_price`, `requested_price`, `approved_price`, `discount_percentage`, `discount_amount`, `gst_percentage`, `gst_amount`, `final_amount`, `approval_level`, `status`, `valid_until`, `payment_terms`, `delivery_terms`, `installation_notes`, `terms_and_conditions`, `client_confirmation_status`, `submitted_at`, `approved_at`, `confirmed_at`, `created_at`, `updated_at`, `deleted_at`) VALUES
(10, 'PROP-1779867439', 'REF-7180', 11, 1, 20, 20, 17, 1, 1, 1, 2, 850000.00, 750000.00, NULL, 11.76, 99960.00, 18.00, 135007.20, 885047.20, 'sd', 'pending_approval', NULL, NULL, NULL, NULL, NULL, NULL, '2026-05-27 08:37:27', NULL, NULL, '2026-05-27 07:37:19', '2026-05-27 08:40:07', NULL);

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

--
-- Table structure for table `proposal_approvals`
--

CREATE TABLE `proposal_approvals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `proposal_id` bigint(20) UNSIGNED NOT NULL,
  `approval_level` varchar(255) NOT NULL,
  `approved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `status` varchar(255) NOT NULL,
  `comments` text NOT NULL,
  `approved_discount_percentage` decimal(5,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `proposal_approvals`
--

INSERT INTO `proposal_approvals` (`id`, `proposal_id`, `approval_level`, `approved_by`, `status`, `comments`, `approved_discount_percentage`, `created_at`, `updated_at`) VALUES
(5, 10, 'rm', 18, 'revision_requested', 'My discount limit crossed', 11.76, '2026-05-27 07:37:23', '2026-05-27 08:34:30'),
(6, 10, 'sd', NULL, 'pending', 'Moved to parent approver.', 11.76, '2026-05-27 08:37:27', '2026-05-27 08:40:07');

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

--
-- Table structure for table `proposal_histories`
--

CREATE TABLE `proposal_histories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `proposal_id` bigint(20) UNSIGNED NOT NULL,
  `action_by` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED DEFAULT NULL,
  `action_type` varchar(255) NOT NULL,
  `old_price` decimal(15,2) DEFAULT NULL,
  `new_price` decimal(15,2) DEFAULT NULL,
  `old_discount` decimal(5,2) DEFAULT NULL,
  `new_discount` decimal(5,2) DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `proposal_histories`
--

INSERT INTO `proposal_histories` (`id`, `proposal_id`, `action_by`, `role_id`, `action_type`, `old_price`, `new_price`, `old_discount`, `new_discount`, `remarks`, `created_at`, `updated_at`) VALUES
(18, 10, 20, 5, 'created', NULL, 750000.00, NULL, 11.76, 'Proposal created by BDE', '2026-05-27 07:37:19', '2026-05-27 07:37:19'),
(19, 10, 18, 3, 'approve', 750000.00, 750000.00, 11.76, 11.76, 'Approved by rm', '2026-05-27 08:26:42', '2026-05-27 08:26:42'),
(20, 10, 18, 3, 'revision_requested', 750000.00, 750000.00, 11.76, 11.76, 'My discount limit crossed', '2026-05-27 08:34:30', '2026-05-27 08:34:30'),
(21, 10, 20, 5, 'resubmit', 750000.00, 750000.00, 10.00, 11.76, 'Proposal resubmitted after revision.', '2026-05-27 08:37:27', '2026-05-27 08:37:27'),
(22, 10, 18, 3, 'move_parent', 750000.00, 750000.00, 11.76, 11.76, 'Moved to parent approver.', '2026-05-27 08:40:07', '2026-05-27 08:40:07');

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

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

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `level` int(11) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `roles` (`id`, `name`, `slug`, `level`, `created_at`, `updated_at`) VALUES
(1, 'Vice President', 'vp', 1, NULL, NULL),
(2, 'State Director', 'sd', 2, NULL, NULL),
(3, 'Regional Manager', 'rm', 3, NULL, NULL),
(4, 'Business Development Manager', 'bdm', 4, NULL, NULL),
(5, 'Business Development Executive', 'bde', 5, NULL, NULL);

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

--
-- Table structure for table `role_discount_limits`
--

CREATE TABLE `role_discount_limits` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `max_discount_percentage` decimal(5,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- 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
('Dtoex6yvgr112d089EJvnYhCAXtYqiueLvIQomuj', 18, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiNnFEM3F6MGhpNE5vTjJOSnN4eVNlMks4bW50RkVIOG9qM1UxcU9JSyI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MzQ6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9wcm9wb3NhbHMvMTAiO3M6NToicm91dGUiO3M6MTQ6InByb3Bvc2Fscy5zaG93Ijt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTg7fQ==', 1779871208),
('TAEFnEVrARCG8Lcsay43X3bi2tavmgW47nl5dZC1', 17, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiSEJia2djOWhSd2kzV0U0UG8xZldJWU9saUhGWWQ5cGlkQlo0RkxlSCI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6Mzg6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9wcm9wb3NhbHMvMTAvcGRmIjtzOjU6InJvdXRlIjtzOjEzOiJwcm9wb3NhbHMucGRmIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTc7fQ==', 1779875179);

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

--
-- Table structure for table `states`
--

CREATE TABLE `states` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `country_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `states`
--

INSERT INTO `states` (`id`, `country_id`, `name`, `code`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 'Tamil Nadu', 'TN', 1, '2026-05-26 08:15:58', '2026-05-26 08:15:58'),
(2, 1, 'Andhra Pradesh', 'AP', 1, '2026-05-26 08:15:58', '2026-05-26 08:15:58');

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

--
-- Table structure for table `tax_settings`
--

CREATE TABLE `tax_settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `country_id` bigint(20) UNSIGNED DEFAULT NULL,
  `tax_name` varchar(255) NOT NULL,
  `tax_percentage` decimal(5,2) NOT NULL DEFAULT 0.00,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `employee_code` varchar(255) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `manager_id` bigint(20) UNSIGNED DEFAULT NULL,
  `country_id` bigint(20) UNSIGNED DEFAULT NULL,
  `state_id` bigint(20) UNSIGNED DEFAULT NULL,
  `district_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `designation` varchar(255) DEFAULT NULL,
  `joining_date` date DEFAULT NULL,
  `profile_photo` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `employee_code`, `name`, `email`, `phone`, `password`, `role_id`, `manager_id`, `country_id`, `state_id`, `district_id`, `city_id`, `designation`, `joining_date`, `profile_photo`, `is_active`, `remember_token`, `created_at`, `updated_at`, `deleted_at`) VALUES
(2, 'EMP001', 'Super VP', 'admin@odyssey.com', '9876543210', '$2y$12$b4AUNl7cx91G.b7kaWzTHu5ud.vgbinIXAN2nAY4vKjuUDl5Cv7LK', 1, NULL, 1, NULL, NULL, NULL, 'Vice President', NULL, NULL, 1, NULL, '2026-05-20 14:13:56', '2026-05-26 05:08:09', NULL),
(17, NULL, 'SD1', 'sd@odyssey.com', '9999999999', '$2y$12$zPSuPZEPbo.R5cvYjBqGNeaM/MMRtsm7YBEfCFB4N5V1g8CTMjdSW', 2, 2, 1, 1, NULL, NULL, NULL, NULL, NULL, 1, NULL, '2026-05-26 10:41:35', '2026-05-26 10:41:35', NULL),
(18, NULL, 'RM1', 'rm@odyssey.com', '8888777546', '$2y$12$uMB.jrSxJH6CdJcWGZQP0.Y7Crv020.748oqy6E4UpmouG.ARLws.', 3, 17, 1, 1, 1, NULL, NULL, NULL, NULL, 1, NULL, '2026-05-26 10:47:23', '2026-05-26 10:47:23', NULL),
(19, NULL, 'BDM1', 'bdm@odyssey.com', '7777777777', '$2y$12$va3oFU.6u9Ism6QWlp8HZO1hqr1l28bR12AVyh/DBEvoyOX14fHZO', 4, 18, 1, 1, 1, 2, NULL, NULL, NULL, 1, NULL, '2026-05-26 10:49:26', '2026-05-26 10:49:26', NULL),
(20, NULL, 'BDE1', 'bde@odyssey.com', '6666666666', '$2y$12$iTmQNiytpr0Bz/sfIiCS5.y2uNIiyce1pEhUQHVaGodBEU2/z8ks.', 5, 19, 1, 1, 1, 2, NULL, NULL, NULL, 1, NULL, '2026-05-26 10:50:49', '2026-05-26 10:50:49', NULL),
(21, NULL, 'BDM-2', 'bdm2@odyssey.com', '575757575758', '$2y$12$royx1vFjskDGIJaTLJh36.CDnKxU8c4kwYPoU13fH1ZewxFQJ2wsa', 4, 18, 1, 1, 1, 1, NULL, NULL, NULL, 1, NULL, '2026-05-26 11:12:06', '2026-05-26 11:12:06', NULL);

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

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

CREATE TABLE `visitors` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `company` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `referred_by_member_id` bigint(20) UNSIGNED DEFAULT NULL,
  `paid_by` enum('visitor','member') NOT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT 1500.00,
  `payment_date` date DEFAULT NULL,
  `meeting_id` int(11) DEFAULT NULL,
  `payment_mode` enum('cash','card','upi') DEFAULT NULL,
  `upi_number` varchar(255) DEFAULT NULL,
  `upi_transaction_id` varchar(255) DEFAULT NULL,
  `status` enum('pending','paid','failed') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `paid_to` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

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

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

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

--
-- Indexes for table `cities`
--
ALTER TABLE `cities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cities_district_id_foreign` (`district_id`);

--
-- Indexes for table `clients`
--
ALTER TABLE `clients`
  ADD PRIMARY KEY (`id`),
  ADD KEY `clients_country_id_foreign` (`country_id`),
  ADD KEY `clients_state_id_foreign` (`state_id`),
  ADD KEY `clients_district_id_foreign` (`district_id`),
  ADD KEY `clients_city_id_foreign` (`city_id`),
  ADD KEY `clients_assigned_bde_id_foreign` (`assigned_bde_id`),
  ADD KEY `clients_created_by_foreign` (`created_by`);

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

--
-- Indexes for table `districts`
--
ALTER TABLE `districts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `districts_state_id_foreign` (`state_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 `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_reserved_at_available_at_index` (`queue`,`reserved_at`,`available_at`);

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

--
-- Indexes for table `lift_products`
--
ALTER TABLE `lift_products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lift_products_created_by_foreign` (`created_by`);

--
-- Indexes for table `meeting_schedules`
--
ALTER TABLE `meeting_schedules`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `meeting_schedules_meeting_id_unique` (`meeting_id`),
  ADD KEY `meeting_schedules_month_id_foreign` (`month_id`);

--
-- Indexes for table `members`
--
ALTER TABLE `members`
  ADD PRIMARY KEY (`id`),
  ADD KEY `members_category_id_foreign` (`category_id`);

--
-- Indexes for table `membership_payments`
--
ALTER TABLE `membership_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `membership_payments_member_id_foreign` (`member_id`);

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

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

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `payments_member_id_foreign` (`member_id`),
  ADD KEY `payments_payment_from_foreign` (`payment_from`),
  ADD KEY `payments_payment_end_month_foreign` (`payment_end_month`);

--
-- Indexes for table `proposals`
--
ALTER TABLE `proposals`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `proposals_proposal_number_unique` (`proposal_number`),
  ADD KEY `proposals_client_id_foreign` (`client_id`),
  ADD KEY `proposals_product_id_foreign` (`product_id`),
  ADD KEY `proposals_created_by_foreign` (`created_by`),
  ADD KEY `proposals_assigned_bde_id_foreign` (`assigned_bde_id`),
  ADD KEY `proposals_current_handler_id_foreign` (`current_handler_id`),
  ADD KEY `proposals_country_id_foreign` (`country_id`),
  ADD KEY `proposals_state_id_foreign` (`state_id`),
  ADD KEY `proposals_district_id_foreign` (`district_id`),
  ADD KEY `proposals_city_id_foreign` (`city_id`);

--
-- Indexes for table `proposal_approvals`
--
ALTER TABLE `proposal_approvals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `proposal_approvals_proposal_id_foreign` (`proposal_id`),
  ADD KEY `proposal_approvals_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `proposal_histories`
--
ALTER TABLE `proposal_histories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `proposal_histories_proposal_id_foreign` (`proposal_id`),
  ADD KEY `proposal_histories_action_by_foreign` (`action_by`),
  ADD KEY `proposal_histories_role_id_foreign` (`role_id`);

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

--
-- Indexes for table `role_discount_limits`
--
ALTER TABLE `role_discount_limits`
  ADD PRIMARY KEY (`id`),
  ADD KEY `role_discount_limits_role_id_foreign` (`role_id`);

--
-- 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 `states`
--
ALTER TABLE `states`
  ADD PRIMARY KEY (`id`),
  ADD KEY `states_country_id_foreign` (`country_id`);

--
-- Indexes for table `tax_settings`
--
ALTER TABLE `tax_settings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tax_settings_country_id_foreign` (`country_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`),
  ADD KEY `users_role_id_foreign` (`role_id`),
  ADD KEY `users_country_id_foreign` (`country_id`),
  ADD KEY `users_state_id_foreign` (`state_id`),
  ADD KEY `users_district_id_foreign` (`district_id`),
  ADD KEY `users_city_id_foreign` (`city_id`),
  ADD KEY `users_manager_id_foreign` (`manager_id`);

--
-- Indexes for table `visitors`
--
ALTER TABLE `visitors`
  ADD PRIMARY KEY (`id`),
  ADD KEY `visitors_referred_by_member_id_foreign` (`referred_by_member_id`),
  ADD KEY `visitors_paid_to_foreign` (`paid_to`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=106;

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `cities`
--
ALTER TABLE `cities`
  ADD CONSTRAINT `cities_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `clients`
--
ALTER TABLE `clients`
  ADD CONSTRAINT `clients_assigned_bde_id_foreign` FOREIGN KEY (`assigned_bde_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `clients_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`),
  ADD CONSTRAINT `clients_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
  ADD CONSTRAINT `clients_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `clients_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`),
  ADD CONSTRAINT `clients_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`);

--
-- Constraints for table `districts`
--
ALTER TABLE `districts`
  ADD CONSTRAINT `districts_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `lift_products`
--
ALTER TABLE `lift_products`
  ADD CONSTRAINT `lift_products_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `meeting_schedules`
--
ALTER TABLE `meeting_schedules`
  ADD CONSTRAINT `meeting_schedules_month_id_foreign` FOREIGN KEY (`month_id`) REFERENCES `months` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `membership_payments`
--
ALTER TABLE `membership_payments`
  ADD CONSTRAINT `membership_payments_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `members` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payments`
--
ALTER TABLE `payments`
  ADD CONSTRAINT `payments_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `members` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payments_payment_end_month_foreign` FOREIGN KEY (`payment_end_month`) REFERENCES `meeting_schedules` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payments_payment_from_foreign` FOREIGN KEY (`payment_from`) REFERENCES `meeting_schedules` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `proposals`
--
ALTER TABLE `proposals`
  ADD CONSTRAINT `proposals_assigned_bde_id_foreign` FOREIGN KEY (`assigned_bde_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `proposals_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`),
  ADD CONSTRAINT `proposals_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`),
  ADD CONSTRAINT `proposals_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
  ADD CONSTRAINT `proposals_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `proposals_current_handler_id_foreign` FOREIGN KEY (`current_handler_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `proposals_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`),
  ADD CONSTRAINT `proposals_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `lift_products` (`id`),
  ADD CONSTRAINT `proposals_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`);

--
-- Constraints for table `proposal_approvals`
--
ALTER TABLE `proposal_approvals`
  ADD CONSTRAINT `proposal_approvals_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `proposal_approvals_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `proposal_histories`
--
ALTER TABLE `proposal_histories`
  ADD CONSTRAINT `proposal_histories_action_by_foreign` FOREIGN KEY (`action_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `proposal_histories_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `proposal_histories_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`);

--
-- Constraints for table `role_discount_limits`
--
ALTER TABLE `role_discount_limits`
  ADD CONSTRAINT `role_discount_limits_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`);

--
-- Constraints for table `states`
--
ALTER TABLE `states`
  ADD CONSTRAINT `states_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tax_settings`
--
ALTER TABLE `tax_settings`
  ADD CONSTRAINT `tax_settings_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`);

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`),
  ADD CONSTRAINT `users_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
  ADD CONSTRAINT `users_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`),
  ADD CONSTRAINT `users_manager_id_foreign` FOREIGN KEY (`manager_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`),
  ADD CONSTRAINT `users_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`);

--
-- Constraints for table `visitors`
--
ALTER TABLE `visitors`
  ADD CONSTRAINT `visitors_paid_to_foreign` FOREIGN KEY (`paid_to`) REFERENCES `members` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `visitors_referred_by_member_id_foreign` FOREIGN KEY (`referred_by_member_id`) REFERENCES `members` (`id`) ON DELETE SET NULL;
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 */;
