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

START TRANSACTION;



--
-- Database: `whatsmarksaas`
--

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

--
-- Table structure for table `ai_prompts`
--

CREATE TABLE `ai_prompts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `bot_flows`
--

CREATE TABLE `bot_flows` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `flow_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`flow_data`)),
  `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 `campaigns`
--

CREATE TABLE `campaigns` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL COMMENT 'Reference to tenant',
  `name` varchar(100) NOT NULL,
  `rel_type` varchar(50) NOT NULL,
  `template_id` text DEFAULT NULL,
  `scheduled_send_time` timestamp NULL DEFAULT NULL,
  `send_now` tinyint(1) NOT NULL DEFAULT 0,
  `header_params` text DEFAULT NULL,
  `body_params` text DEFAULT NULL,
  `footer_params` text DEFAULT NULL,
  `pause_campaign` tinyint(1) NOT NULL DEFAULT 0,
  `select_all` tinyint(1) NOT NULL DEFAULT 0,
  `is_sent` tinyint(1) NOT NULL DEFAULT 0,
  `sending_count` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `filename` text DEFAULT NULL,
  `rel_data` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `campaign_details`
--

CREATE TABLE `campaign_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL COMMENT 'Reference to tenant',
  `campaign_id` bigint(20) UNSIGNED NOT NULL,
  `rel_id` bigint(20) UNSIGNED DEFAULT NULL,
  `rel_type` varchar(50) NOT NULL,
  `header_message` text DEFAULT NULL,
  `body_message` text DEFAULT NULL,
  `footer_message` text DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `response_message` text DEFAULT NULL,
  `whatsapp_id` text DEFAULT NULL,
  `message_status` varchar(25) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `canned_replies`
--

CREATE TABLE `canned_replies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL COMMENT 'Reference to tenant',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_public` tinyint(1) NOT NULL DEFAULT 0,
  `added_from` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `contact_imports`
--

CREATE TABLE `contact_imports` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `total_records` int(11) NOT NULL DEFAULT 0,
  `processed_records` int(11) NOT NULL DEFAULT 0,
  `valid_records` int(11) NOT NULL DEFAULT 0,
  `invalid_records` int(11) NOT NULL DEFAULT 0,
  `skipped_records` int(11) NOT NULL DEFAULT 0,
  `status` varchar(255) NOT NULL,
  `error_messages` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`error_messages`)),
  `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 `coupons`
--

CREATE TABLE `coupons` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `code` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `type` enum('percentage','fixed_amount') NOT NULL,
  `value` decimal(10,2) NOT NULL,
  `usage_limit` int(11) DEFAULT NULL,
  `usage_count` int(11) NOT NULL DEFAULT 0,
  `usage_limit_per_customer` int(11) DEFAULT NULL,
  `starts_at` datetime DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  `minimum_amount` decimal(10,2) DEFAULT NULL,
  `maximum_discount` decimal(10,2) DEFAULT NULL,
  `applicable_plans` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`applicable_plans`)),
  `applicable_billing_periods` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`applicable_billing_periods`)),
  `first_payment_only` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` 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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `coupon_usages`
--

CREATE TABLE `coupon_usages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `coupon_id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `invoice_id` bigint(20) UNSIGNED DEFAULT NULL,
  `subscription_id` bigint(20) UNSIGNED DEFAULT NULL,
  `discount_amount` decimal(10,2) NOT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `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 `credit_transactions`
--

CREATE TABLE `credit_transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `type` enum('credit','debit','transfer') NOT NULL,
  `amount` decimal(13,2) NOT NULL,
  `currency_id` bigint(20) UNSIGNED NOT NULL,
  `description` varchar(255) NOT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `invoice_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `currencies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(3) NOT NULL,
  `symbol` varchar(10) NOT NULL DEFAULT '$',
  `format` varchar(255) DEFAULT NULL,
  `exchange_rate` decimal(10,6) DEFAULT 1.000000,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `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 `currencies`
--

INSERT INTO `currencies` (`id`, `name`, `code`, `symbol`, `format`, `exchange_rate`, `is_default`, `created_at`, `updated_at`) VALUES
(1, 'US Dollar', 'USD', '$', 'before_amount', 1.000000, 1, '2026-02-05 13:25:43', '2026-02-05 13:25:43');

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

--
-- Table structure for table `custom_fields`
--

CREATE TABLE `custom_fields` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `field_name` varchar(255) NOT NULL,
  `field_label` varchar(255) NOT NULL,
  `field_type` enum('text','textarea','number','date','dropdown','checkbox') NOT NULL,
  `field_options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`field_options`)),
  `placeholder` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_required` tinyint(1) NOT NULL DEFAULT 0,
  `default_value` varchar(255) DEFAULT NULL,
  `display_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `show_on_table` tinyint(1) NOT NULL DEFAULT 0,
  `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 `departments`
--

CREATE TABLE `departments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `assignee_id` 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 `departments`
--

INSERT INTO `departments` (`id`, `name`, `description`, `status`, `assignee_id`, `created_at`, `updated_at`) VALUES
(1, 'Sales', 'Handles client relationships, lead generation, and deal closures.', 1, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(2, 'Technical', 'Responsible for development, deployment, and technical support.', 1, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(3, 'Quality Assurance', 'Ensures product meets quality standards through rigorous testing.', 1, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(4, 'General', 'Manages company-wide services like HR, admin, and operations.', 1, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47');

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

--
-- Table structure for table `email_layouts`
--

CREATE TABLE `email_layouts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `header` text DEFAULT NULL,
  `footer` text DEFAULT NULL,
  `master_template` text NOT NULL,
  `variables` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`variables`)),
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_system` tinyint(1) NOT NULL DEFAULT 0,
  `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;

--
-- Dumping data for table `email_layouts`
--

INSERT INTO `email_layouts` (`id`, `name`, `slug`, `header`, `footer`, `master_template`, `variables`, `is_default`, `is_system`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'Default Layout', 'default', '<tr><td style=\"background-color: #6366f1; padding: 30px; text-align: center; border-top-left-radius: 12px; border-top-right-radius: 12px;\"> <img src=\"{dark_logo}\" alt=\"{company_name}\" style=\"height: 40px; width: auto; margin-bottom: 10px;\"></td></tr>', '<tr> <td style=\"background-color: #f8fafc; padding: 30px; text-align: center; border-top: 1px solid #e5e7eb; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px;\"> <p style=\"color: #6b7280; font-size: 14px; margin: 0 0 10px 0;\"> © {current_year} {company_name}.All rights reserved. </p><p style=\"color: #6b7280; font-size: 14px; margin: 0;\">Made with ♥ by {company_name}</p></td></tr>', '<!DOCTYPE html>\n        <html>\n        <head>\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n            <title>{{laungauge}}</title>\n            <style>\n                body {\n                margin: 0; padding: 0; background-color: #f5f6fa;\n                }\n\n            </style>\n        </head>\n        <body>\n            <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color: #f5f6fa; padding: 30px;\">\n                <tr>\n                    <td align=\"center\">\n                        <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"\n                            style=\"max-width: 800px; background-color: #ffffff; border-radius: 12px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\">\n                            {HEADER}\n                            <tr>\n                                <td style=\"padding:40px 50px;\">\n                                        {CONTENT}\n                                </td>\n                                {FOOTER}\n                            </tr>\n                        </table>\n                    </td>\n                </tr>\n            </table>\n        </body>\n        </html>', '[\"company_name\", \"company_logo\", \"company_address\", \"unsubscribe_url\"]', 1, 1, 1, '2026-02-05 13:24:47', '2026-02-05 13:24:47');

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

--
-- Table structure for table `email_logs`
--

CREATE TABLE `email_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `email_template_id` bigint(20) UNSIGNED DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `from` varchar(255) DEFAULT NULL,
  `to` varchar(255) DEFAULT NULL,
  `cc` varchar(255) DEFAULT NULL,
  `bcc` varchar(255) DEFAULT NULL,
  `reply_to` varchar(255) DEFAULT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data`)),
  `status` enum('pending','sent','failed','scheduled') NOT NULL DEFAULT 'pending',
  `error` text DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `scheduled_at` timestamp NULL 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 `email_templates`
--

CREATE TABLE `email_templates` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `content` longtext DEFAULT NULL,
  `variables` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`variables`)),
  `merge_fields_groups` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`merge_fields_groups`)),
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_system` tinyint(1) NOT NULL DEFAULT 0,
  `category` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `layout_id` int(11) DEFAULT NULL,
  `use_layout` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED 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 `email_templates`
--

INSERT INTO `email_templates` (`id`, `name`, `slug`, `description`, `subject`, `content`, `variables`, `merge_fields_groups`, `is_active`, `is_system`, `category`, `type`, `layout_id`, `use_layout`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'Test Email', 'test-email', NULL, 'This is a test email from {company_name}', '<p>Hello {first_name} {last_name},</p><p>This is a test email from <strong>{company_name}</strong> to confirm your email configuration is working correctly.</p><p>Thank you, </p><p>{company_name} Team</p>', NULL, '\"[\\\"user-group\\\",\\\"other-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(2, 'Tenant Welcome Email', 'tenant-welcome-mail', NULL, 'Welcome to {company_name}, {tenant_company_name}!', '<p>Hello {tenant_company_name},</p><p>Welcome to <strong>{company_name}</strong>! We are thrilled to have you on board. Your account has been successfully created and is ready to use.</p><p>If you have any questions or need assistance, feel free to reach out.</p><p>Best regards,</p><p>{company_name} Team</p>', NULL, '\"[\\\"tenant-group\\\",\\\"other-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(3, 'Staff Welcome Email', 'staff-welcome-mail', NULL, 'Welcome to {company_name}, {first_name} {last_name}!', '<p>Hello {first_name} {last_name},</p>\n                <p>Welcome to <strong>{company_name}</strong>! Your staff account has been successfully created and is ready to use.</p>\n                <p>If you have any questions or need assistance, feel free to reach out.</p>\n                <p>Best regards,</p>\n                <p>{company_name} Team</p>', NULL, '\"[\\\"user-group\\\",\\\"other-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(4, 'New Tenant Reminder Email to Admin', 'new-tenant-reminder-email-to-admin', NULL, 'New tenant {tenant_company_name} has signed up', '<p>Hi {first_name} {last_name},</p><p>A new tenant <strong>{tenant_company_name}</strong> has just signed up on <strong>{company_name}.</strong></p><p>Please log in to your admin panel to review the details.</p><p>Regards,</p><p>{company_name} </p>', NULL, '\"[\\\"tenant-group\\\",\\\"other-group\\\",\\\"user-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(5, 'Email Confirmation', 'email-confirmation', NULL, 'Verify Your Email Address', '<p>Hello {first_name} {last_name},</p>\n                            <p>Thank you for signing up! Please verify your email address by clicking the button below:</p>\n                            <p><a href=\"{verification_url}\" class=\"button\">Verify Email Address</a></p>\n                            <p>If you did not create an account, no further action is required.</p>\n                            <p>Thanks,<br>{company_name} Team</p>', NULL, '\"[\\\"user-group\\\",\\\"other-group\\\"]\"', 1, 0, NULL, NULL, 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(6, 'Password Reset', 'password-reset', NULL, 'Reset Password Notification', '<p>Hello {first_name} {last_name},</p>\n                            <p>You are receiving this email because we received a password reset request for your account.</p>\n                            <p><a href=\"{reset_url}\" class=\"button\">Reset Password</a></p>\n                            <p>This password reset link will expire in 60 minutes.</p>\n                            <p>If you did not request a password reset, no further action is required.</p>\n                            <p>Regards,<br>{company_name} Team</p>', NULL, '\"[\\\"user-group\\\",\\\"other-group\\\"]\"', 1, 0, NULL, NULL, 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(7, 'New Ticket Created (Admin Notification)', 'ticket-created', NULL, 'New Support Ticket Created - {ticket_subject}', '<p>Hello Admin,</p>\n                    <p>A new support ticket has been created and requires your attention.</p>\n\n                    <div style=\"background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #495057;\">Ticket Details</h3>\n                        <table style=\"width: 100%; border-collapse: collapse;\">\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Ticket ID:</td><td style=\"padding: 8px 0;\">{ticket_id}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Subject:</td><td style=\"padding: 8px 0;\">{ticket_subject}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Priority:</td><td style=\"padding: 8px 0;\">{ticket_priority}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Department:</td><td style=\"padding: 8px 0;\">{ticket_department}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Status:</td><td style=\"padding: 8px 0;\">{ticket_status}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Created:</td><td style=\"padding: 8px 0;\">{ticket_created_at}</td></tr>\n                        </table>\n                    </div>\n\n                    <div style=\"background-color: #e3f2fd; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #1976d2;\">Customer Information</h3>\n                        <p><strong>Company:</strong> {tenant_company_name}</p>\n                    </div>\n\n                    <div style=\"background-color: #fff3e0; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #f57c00;\">Ticket Description</h3>\n                        <div style=\"background-color: #ffffff; padding: 15px; border-left: 4px solid #ff9800; border-radius: 4px;\">\n                            {ticket_body}\n                        </div>\n                    </div>\n\n                    <p>Please review and assign this ticket at your earliest convenience.</p>\n\n                    <div style=\"text-align: center; margin: 30px 0;\">\n                        <a href=\"{admin_url}\" style=\"background-color: #007bff; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;\">View Ticket in Admin Panel</a>\n                    </div>\n\n                    <p>Best regards,<br>{company_name} System</p>', NULL, '\"[\\\"ticket-group\\\",\\\"other-group\\\",\\\"tenant-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(8, 'Ticket Reply Notification (To Tenant)', 'ticket-reply-tenant', NULL, 'Support Ticket Reply - {ticket_subject}', '<p>Hello {tenant_company_name},</p>\n                    <p>You have received a new reply on your support ticket.</p>\n\n                    <div style=\"background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #495057;\">Ticket Information</h3>\n                        <table style=\"width: 100%; border-collapse: collapse;\">\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Ticket ID:</td><td style=\"padding: 8px 0;\">{ticket_id}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Subject:</td><td style=\"padding: 8px 0;\">{ticket_subject}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Status:</td><td style=\"padding: 8px 0;\">{ticket_status}</td></tr>\n                        </table>\n                    </div>\n\n                    <p>You can view the full conversation and reply by clicking the link below:</p>\n\n                    <div style=\"text-align: center; margin: 30px 0;\">\n                        <a href=\"{ticket_url}\" style=\"background-color: #28a745; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;\">View & Reply to Ticket</a>\n                    </div>\n\n                    <p>Best regards,<br>{company_name} Support Team</p>', NULL, '\"[\\\"ticket-group\\\",\\\"other-group\\\",\\\"tenant-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(9, 'Ticket Reply Notification (To Admin)', 'ticket-reply-admin', NULL, 'New Reply on Ticket {ticket_id} - {ticket_subject}', '<p>Hello {assigned_user_name},</p>\n                    <p>A new reply has been added to ticket <strong>{ticket_id}</strong>.</p>\n\n                    <div style=\"background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #495057;\">Ticket Details</h3>\n                        <table style=\"width: 100%; border-collapse: collapse;\">\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Ticket ID:</td><td style=\"padding: 8px 0;\">{ticket_id}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Subject:</td><td style=\"padding: 8px 0;\">{ticket_subject}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Priority:</td><td style=\"padding: 8px 0;\">{ticket_priority}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Status:</td><td style=\"padding: 8px 0;\">{ticket_status}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Customer:</td><td style=\"padding: 8px 0;\">{tenant_company_name}</td></tr>\n                        </table>\n                    </div>\n\n                    <div style=\"text-align: center; margin: 30px 0;\">\n                        <a href=\"{ticket_admin_url}\" style=\"background-color: #dc3545; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;\">View Ticket in Admin Panel</a>\n                    </div>\n\n                    <p>Best regards,<br>{company_name} System</p>', NULL, '\"[\\\"ticket-group\\\",\\\"other-group\\\",\\\"tenant-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(10, 'Ticket Status Changed Notification', 'ticket-status-changed', NULL, 'Ticket Status Updated - {ticket_subject}', '<p>Hello {tenant_company_name},</p>\n                    <p>The status of your support ticket has been updated.</p>\n\n                    <div style=\"background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #495057;\">Ticket Information</h3>\n                        <table style=\"width: 100%; border-collapse: collapse;\">\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Ticket ID:</td><td style=\"padding: 8px 0;\">{ticket_id}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Subject:</td><td style=\"padding: 8px 0;\">{ticket_subject}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Previous Status:</td><td style=\"padding: 8px 0;\">{previous_status}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">New Status:</td><td style=\"padding: 8px 0; color: #007bff;\"><strong>{new_status}</strong></td></tr>\n                        </table>\n                    </div>\n\n                    <div style=\"text-align: center; margin: 30px 0;\">\n                        <a href=\"{ticket_url}\" style=\"background-color: #17a2b8; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;\">View Ticket Details</a>\n                    </div>\n\n                    <p>Best regards,<br>{company_name} Support Team</p>', NULL, '\"[\\\"ticket-group\\\",\\\"other-group\\\",\\\"tenant-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(11, 'Ticket Status Changed Notification (Admin)', 'ticket-status-changed-admin', NULL, 'Ticket Status Updated by Tenant - {ticket_subject}', '<p>Hello Admin,</p>\n                    <p>A ticket status has been updated by the tenant.</p>\n\n                    <div style=\"background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #495057;\">Ticket Information</h3>\n                        <table style=\"width: 100%; border-collapse: collapse;\">\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Ticket ID:</td><td style=\"padding: 8px 0;\">{ticket_id}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Subject:</td><td style=\"padding: 8px 0;\">{ticket_subject}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Customer:</td><td style=\"padding: 8px 0;\">{tenant_company_name}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Previous Status:</td><td style=\"padding: 8px 0;\">{previous_status}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">New Status:</td><td style=\"padding: 8px 0; color: #007bff;\"><strong>{new_status}</strong></td></tr>\n                        </table>\n                    </div>\n\n                    <div style=\"text-align: center; margin: 30px 0;\">\n                        <a href=\"{ticket_admin_url}\" style=\"background-color: #17a2b8; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;\">View in Admin Panel</a>\n                    </div>\n\n                    <p>Best regards,<br>{company_name} System</p>', NULL, '\"[\\\"ticket-group\\\",\\\"other-group\\\",\\\"tenant-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(12, 'Ticket Assigned Notification', 'ticket-assigned', NULL, 'Ticket Assigned to You - {ticket_subject}', '<p>Hello {assigned_user_name},</p>\n                    <p>A support ticket has been assigned to you.</p>\n\n                    <div style=\"background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #495057;\">Ticket Details</h3>\n                        <table style=\"width: 100%; border-collapse: collapse;\">\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Ticket ID:</td><td style=\"padding: 8px 0;\">{ticket_id}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Subject:</td><td style=\"padding: 8px 0;\">{ticket_subject}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Priority:</td><td style=\"padding: 8px 0;\">{ticket_priority}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Department:</td><td style=\"padding: 8px 0;\">{ticket_department}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Customer:</td><td style=\"padding: 8px 0;\">{tenant_company_name}</td></tr>\n                            <tr><td style=\"padding: 8px 0; font-weight: bold;\">Created:</td><td style=\"padding: 8px 0;\">{ticket_created_at}</td></tr>\n                        </table>\n                    </div>\n\n                    <div style=\"background-color: #e3f2fd; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n                        <h3 style=\"margin-top: 0; color: #1976d2;\">Ticket Description</h3>\n                        <div style=\"background-color: #ffffff; padding: 15px; border-left: 4px solid #2196f3; border-radius: 4px;\">\n                            {ticket_body}\n                        </div>\n                    </div>\n\n                    <div style=\"text-align: center; margin: 30px 0;\">\n                        <a href=\"{ticket_admin_url}\" style=\"background-color: #6f42c1; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;\">View & Respond to Ticket</a>\n                    </div>\n\n                    <p>Best regards,<br>{company_name} System</p>', NULL, '\"[\\\"ticket-group\\\",\\\"other-group\\\",\\\"tenant-group\\\"]\"', 1, 0, NULL, 'admin', 1, 1, NULL, NULL, '2026-02-05 13:24:47', '2026-02-05 13:24:47');

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

--
-- Table structure for table `exports`
--

CREATE TABLE `exports` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `file_disk` varchar(255) NOT NULL,
  `file_name` varchar(255) DEFAULT NULL,
  `exporter` varchar(255) NOT NULL,
  `processed_rows` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `total_rows` int(10) UNSIGNED NOT NULL,
  `successful_rows` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `user_id` bigint(20) UNSIGNED 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 `failed_import_rows`
--

CREATE TABLE `failed_import_rows` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`data`)),
  `import_id` bigint(20) UNSIGNED NOT NULL,
  `validation_error` text 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 `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 `faqs`
--

CREATE TABLE `faqs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `question` varchar(255) NOT NULL,
  `answer` text NOT NULL,
  `is_visible` tinyint(1) DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `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 `faqs`
--

INSERT INTO `faqs` (`id`, `question`, `answer`, `is_visible`, `sort_order`, `created_at`, `updated_at`) VALUES
(1, 'How do I upgrade my subscription plan?', 'You can upgrade your plan from your billing dashboard. Navigate to Subscriptions > Upgrade and select your desired higher-tier plan. The upgrade will be prorated, meaning you\'ll only pay the difference for the remaining billing period. Payment is required immediately to activate the upgrade.', 1, 1, '2026-02-05 13:25:44', '2026-02-05 13:25:44'),
(2, 'How do I downgrade my subscription plan?', 'To downgrade, go to Subscriptions > Downgrade and choose a lower-tier plan. Downgrades are processed immediately, and any credit from the price difference will be applied to your account for future billing cycles.', 1, 2, '2026-02-05 13:25:44', '2026-02-05 13:25:44'),
(3, 'How does the billing cycle work?', 'Your billing cycle depends on your plan\'s billing period (monthly or yearly). The cycle starts from your subscription activation date and renews automatically unless you\'ve disabled auto-renewal. You can view your next billing date in your subscription dashboard.', 1, 3, '2026-02-05 13:25:44', '2026-02-05 13:25:44'),
(4, 'When will I be charged for renewals?', 'Auto-billing occurs 1 day after your current period ends. For example, if your subscription expires on January 15th, auto-billing will attempt on January 16th. This grace period ensures uninterrupted service.', 1, 4, '2026-02-05 13:25:44', '2026-02-05 13:25:44'),
(5, 'What happens if my payment fails?', 'If auto-billing fails, you\'ll receive notifications and have a grace period to update your payment method. Failed payments are logged in your transaction history, and you can manually retry payment from your billing dashboard.', 1, 5, '2026-02-05 13:25:44', '2026-02-05 13:25:44');

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

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

CREATE TABLE `features` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `type` enum('limit','boolean') NOT NULL DEFAULT 'boolean',
  `icon` varchar(255) DEFAULT NULL,
  `display_order` int(11) NOT NULL DEFAULT 0,
  `default` tinyint(1) NOT NULL DEFAULT 0,
  `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 `features`
--

INSERT INTO `features` (`id`, `name`, `slug`, `description`, `type`, `icon`, `display_order`, `default`, `created_at`, `updated_at`) VALUES
(1, 'Contacts ', 'contacts', 'Number of contacts allowed', 'limit', NULL, 10, 1, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(2, 'Template Bots ', 'template_bots', 'Number of template bots allowed', 'limit', NULL, 20, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(3, 'Message Bots ', 'message_bots', 'Number of message bots allowed', 'limit', NULL, 30, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(4, 'Campaigns ', 'campaigns', 'Number of campaigns allowed', 'limit', NULL, 40, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(5, 'AI Prompts ', 'ai_prompts', 'Number of ai prompts allowed', 'limit', NULL, 50, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(6, 'Canned Replies ', 'canned_replies', 'Number of canned replies allowed', 'limit', NULL, 60, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(7, 'Staff ', 'staff', 'Number of staffs allowed', 'limit', NULL, 70, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(8, 'Conversation ', 'conversations', 'Number of conversation allowed', 'limit', NULL, 80, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(9, 'Bot Flow ', 'bot_flow', 'Number of bot flows allowed', 'limit', NULL, 90, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(10, 'Enable Api', 'enable_api', 'Enable(-1) or Disable(0) Api', 'limit', NULL, 100, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(11, 'AI Personal Assistants ', 'ai_personal_assistants', 'Allow users to create and manage AI personal assistants', 'limit', NULL, 50, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(12, 'Ecommerce Webhooks ', 'ecommerce_webhooks', 'Allow users to create and manage number of webhooks for ecommerce events', 'limit', NULL, 50, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(13, 'Embedded SignUp', 'emb_signup', 'Allow users to sign up via Embedded SignUp', 'limit', NULL, 10, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43'),
(14, 'Facebook Lead Integration', 'facebook_lead', 'Allow users to connect Facebook pages and collect leads from Facebook Lead Ads', 'limit', NULL, 55, 0, '2026-02-05 13:25:43', '2026-02-05 13:25:43');

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

--
-- Table structure for table `feature_limits`
--

CREATE TABLE `feature_limits` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `plan_id` bigint(20) UNSIGNED NOT NULL,
  `feature_id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `custom_limit` varchar(255) NOT NULL,
  `reason` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `feature_usages`
--

CREATE TABLE `feature_usages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `subscription_id` bigint(20) UNSIGNED NOT NULL,
  `feature_slug` varchar(255) NOT NULL,
  `limit_value` int(11) NOT NULL DEFAULT -1,
  `used` int(11) NOT NULL DEFAULT 0,
  `reset_date` timestamp NULL DEFAULT NULL,
  `period_start` timestamp NULL DEFAULT NULL,
  `last_reset_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `groups`
--

CREATE TABLE `groups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) 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 `imports`
--

CREATE TABLE `imports` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `file_name` varchar(255) NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `importer` varchar(255) NOT NULL,
  `processed_rows` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `total_rows` int(10) UNSIGNED NOT NULL,
  `successful_rows` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `user_id` bigint(20) UNSIGNED 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 `invoices`
--

CREATE TABLE `invoices` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `subscription_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(255) NOT NULL,
  `status` enum('new','paid','cancelled') NOT NULL DEFAULT 'new',
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `metadata` text DEFAULT NULL,
  `currency_id` bigint(20) UNSIGNED NOT NULL,
  `coupon_id` bigint(20) UNSIGNED DEFAULT NULL,
  `total_tax_amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `coupon_discount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `coupon_code` varchar(255) DEFAULT NULL,
  `coupon_snapshot` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`coupon_snapshot`)),
  `fee` decimal(13,2) NOT NULL DEFAULT 0.00,
  `invoice_number` varchar(255) DEFAULT NULL,
  `due_date` timestamp NULL DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `no_payment_required_when_free` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `invoice_items`
--

CREATE TABLE `invoice_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `invoice_id` bigint(20) UNSIGNED NOT NULL,
  `item_id` bigint(20) UNSIGNED DEFAULT NULL,
  `item_type` varchar(255) DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `amount` decimal(13,2) NOT NULL,
  `quantity` 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_general_ci;

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

--
-- Table structure for table `invoice_taxes`
--

CREATE TABLE `invoice_taxes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `invoice_id` bigint(20) UNSIGNED NOT NULL,
  `tax_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `rate` decimal(8,2) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_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 `languages`
--

CREATE TABLE `languages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(5) NOT NULL,
  `status` tinyint(1) 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 `languages`
--

INSERT INTO `languages` (`id`, `tenant_id`, `name`, `code`, `status`, `created_at`, `updated_at`) VALUES
(1, NULL, 'English', 'en', 1, '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(2, NULL, 'Portuguese', 'br', 1, '2026-02-05 13:24:56', '2026-02-05 13:24:56');

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

--
-- Table structure for table `message_bots`
--

CREATE TABLE `message_bots` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL COMMENT 'Reference to tenant',
  `name` varchar(255) NOT NULL,
  `rel_type` varchar(50) NOT NULL,
  `reply_text` text NOT NULL,
  `reply_type` tinyint(4) NOT NULL,
  `trigger` text DEFAULT NULL,
  `bot_header` varchar(191) DEFAULT NULL,
  `bot_footer` varchar(191) DEFAULT NULL,
  `button1` varchar(255) DEFAULT NULL,
  `button1_id` varchar(255) DEFAULT NULL,
  `button2` varchar(255) DEFAULT NULL,
  `button2_id` varchar(255) DEFAULT NULL,
  `button3` varchar(255) DEFAULT NULL,
  `button3_id` varchar(255) DEFAULT NULL,
  `button_name` varchar(255) DEFAULT NULL,
  `button_url` varchar(255) DEFAULT NULL,
  `addedfrom` int(11) NOT NULL,
  `is_bot_active` tinyint(1) NOT NULL DEFAULT 1,
  `sending_count` int(11) NOT NULL DEFAULT 0,
  `filename` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_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
(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, '2022_12_14_083707_create_settings_table', 1),
(5, '2023_07_13_000000_create_taxes_table', 1),
(6, '2025_01_08_000001_create_module_validation_logs_table', 1),
(7, '2025_03_02_083707_alter_users_table', 1),
(8, '2025_03_24_072033_create_faqs_table', 1),
(9, '2025_03_25_130551_create_theme_settings', 1),
(10, '2025_03_26_121434_create_tenant_settings_table', 1),
(11, '2025_03_28_070510_create_system_settings', 1),
(12, '2025_03_28_074346_create_re_captcha_settings', 1),
(13, '2025_03_28_075625_create_email_settings', 1),
(14, '2025_03_28_101632_create_cron_job_settings', 1),
(15, '2025_03_28_104323_create_whats_mark_settings', 1),
(16, '2025_03_31_030310_create_tenants_table', 1),
(17, '2025_03_31_062225_create_plans_table', 1),
(18, '2025_03_31_124314_announcement_settings', 1),
(19, '2025_04_01_062442_create_languages_table', 1),
(20, '2025_04_05_172456_create_features_table', 1),
(21, '2025_04_05_172507_create_plan_features_table', 1),
(22, '2025_04_18_045949_tenant_specific_settings', 1),
(23, '2025_04_26_060520_create_currencies_table', 1),
(24, '2025_05_02_000001_create_email_layouts_table', 1),
(25, '2025_05_03_120258_create_whatsapp_settings', 1),
(26, '2025_05_04_000001_create_email_templates_table', 1),
(27, '2025_05_05_000001_create_email_logs_table', 1),
(28, '2025_05_09_062838_create_permission_tables', 1),
(29, '2025_05_19_110957_create_invoice_settings', 1),
(30, '2025_05_26_091936_create_departments_table', 1),
(31, '2025_05_28_095954_create_privacy_policy_settings', 1),
(32, '2025_06_07_123456_create_terms_conditions_settings', 1),
(33, '2025_06_12_125000_add_default_taxes_to_invoice_settings', 1),
(34, '2025_07_01_051611_create_tenant_additional_settings', 1),
(35, '2025_07_05_044100_create_miscellaneous_settings', 1),
(36, '2025_07_07_073019_create_bot_flows_table', 1),
(37, '2025_07_11_123806_add_themes_style_settings_table', 1),
(38, '2025_07_12_044529_create_groups_table', 1),
(39, '2025_07_12_072850_alter_contact_table', 1),
(40, '2025_07_16_000000_add_wm_fb_config_id_to_whatsapp_settings', 1),
(41, '2025_07_16_053052_create_modules_table', 1),
(42, '2025_07_18_093520_alter_description__pages_table', 1),
(43, '2025_07_18_102235_add_is_enable_landing_page_setting', 1),
(44, '2025_07_19_061218_alter_contacts_table', 1),
(45, '2025_08_05_120000_add_default_tenant_language_setting', 1),
(46, '2025_08_06_133503_alter_whatsapp_templates_table_add_new_fields', 1),
(47, '2025_08_18_122205_create_custom_fields_table', 1),
(48, '2025_08_18_122322_add_custom_fields_to_contacts_table', 1),
(49, '2025_08_18_123343_add_custom_fields_permissions', 1),
(50, '2025_08_21_000001_create_tenant_languages_table', 1),
(51, '2025_08_27_000001_add_max_queue_jobs_setting', 1),
(52, '2025_08_27_000001_create_contact_imports_table', 1),
(53, '2025_08_28_105718_add_deleted_at_to_tenants_table', 1),
(54, '2025_09_10_045630_create_imports_table', 1),
(55, '2025_09_10_045631_create_exports_table', 1),
(56, '2025_09_10_045632_create_failed_import_rows_table', 1),
(57, '2025_09_11_054333_create_coupons_table', 1),
(58, '2025_09_11_054353_create_coupon_usages_table', 1),
(59, '2025_09_13_101740_update_ticket_status_changed_email_template_type', 1),
(60, '2025_09_24_080751_add_message_id_index_to_chat_messages_tables', 1),
(61, '2025_10_01_000001_add_campaign_performance_indexes', 1),
(62, '2025_10_06_064335_add_heading_and_extrafeature', 1),
(63, '2025_10_17_124657_create_banner_settings', 1),
(64, '2025_10_18_110856_create_plans_page_settings', 1),
(65, '2025_10_30_062135_add_header_type_and_cards_json_to_whatsapp_templates_table', 1),
(66, '2025_11_04_120000_add_cards_params_to_template_bots_table', 1),
(67, '2025_11_08_064850_remove_unique_key_from_plans_name', 1),
(68, '2025_11_22_122255_add_is_opt_out_to_contact_table', 1),
(69, '2025_11_24_113105_add_session_reset_fields_to_chats_table', 1),
(70, '2025_12_08_052625_add_new_fields_in_chat', 1),
(71, '2025_12_16_100016_alter_enum_type_to_contacts_table', 1),
(72, '2025_11_06_051319_create_pusher_settings', 2),
(73, '2025_12_01_065314_alter_theme_settings', 2);

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

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `module_validation_logs`
--

CREATE TABLE `module_validation_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `module_name` varchar(255) NOT NULL,
  `username` varchar(255) NOT NULL,
  `purchase_code` varchar(255) NOT NULL,
  `ip_address` varchar(255) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `status` enum('pending','success','failed') NOT NULL DEFAULT 'pending',
  `validation_response` text 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 `pages`
--

CREATE TABLE `pages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `show_in_menu` tinyint(1) DEFAULT 0,
  `status` tinyint(1) DEFAULT 1,
  `parent_id` bigint(20) UNSIGNED DEFAULT NULL,
  `order` int(11) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `payment_methods`
--

CREATE TABLE `payment_methods` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `type` varchar(255) NOT NULL,
  `payment_method_id` varchar(255) DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `scope` varchar(255) NOT NULL DEFAULT 'tenant',
  `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 `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `scope`, `created_at`, `updated_at`) VALUES
(1, 'tenant.custom_fields.view', 'web', 'tenant', '2026-02-05 13:24:23', '2026-02-05 13:24:23'),
(2, 'tenant.custom_fields.create', 'web', 'tenant', '2026-02-05 13:24:23', '2026-02-05 13:24:23'),
(3, 'tenant.custom_fields.edit', 'web', 'tenant', '2026-02-05 13:24:23', '2026-02-05 13:24:23'),
(4, 'tenant.custom_fields.delete', 'web', 'tenant', '2026-02-05 13:24:23', '2026-02-05 13:24:23'),
(5, 'admin.tenants.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(6, 'admin.tenants.create', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(7, 'admin.tenants.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(8, 'admin.tenants.delete', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(9, 'admin.tenants.login', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(10, 'admin.website_settings.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(11, 'admin.website_settings.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(12, 'admin.system_settings.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(13, 'admin.system_settings.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(14, 'admin.users.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(15, 'admin.users.create', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(16, 'admin.users.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(17, 'admin.users.delete', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(18, 'admin.roles.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(19, 'admin.roles.create', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(20, 'admin.roles.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(21, 'admin.roles.delete', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(22, 'admin.department.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(23, 'admin.department.create', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(24, 'admin.department.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(25, 'admin.department.delete', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(26, 'admin.currency.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(27, 'admin.currency.create', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(28, 'admin.currency.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(29, 'admin.currency.delete', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(30, 'admin.coupon.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(31, 'admin.coupon.create', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(32, 'admin.coupon.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(33, 'admin.coupon.delete', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(34, 'admin.faq.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(35, 'admin.faq.create', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(36, 'admin.faq.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(37, 'admin.faq.delete', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(38, 'admin.pages.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(39, 'admin.pages.create', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(40, 'admin.pages.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(41, 'admin.pages.delete', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(42, 'admin.email_template.view', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(43, 'admin.email_template.edit', 'web', 'admin', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(44, 'tenant.connect_account.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(45, 'tenant.connect_account.connect', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(46, 'tenant.connect_account.disconnect', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(47, 'tenant.contact.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(48, 'tenant.contact.view_own', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(49, 'tenant.contact.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(50, 'tenant.contact.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(51, 'tenant.contact.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(52, 'tenant.contact.bulk_import', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(53, 'tenant.template.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(54, 'tenant.template.load_template', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(55, 'tenant.template.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(56, 'tenant.template.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(57, 'tenant.template.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(58, 'tenant.campaigns.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(59, 'tenant.campaigns.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(60, 'tenant.campaigns.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(61, 'tenant.campaigns.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(62, 'tenant.campaigns.show_campaign', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(63, 'tenant.bulk_campaigns.send', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(64, 'tenant.template_bot.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(65, 'tenant.template_bot.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(66, 'tenant.template_bot.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(67, 'tenant.template_bot.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(68, 'tenant.template_bot.clone', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(69, 'tenant.message_bot.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(70, 'tenant.message_bot.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(71, 'tenant.message_bot.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(72, 'tenant.message_bot.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(73, 'tenant.message_bot.clone', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(74, 'tenant.source.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(75, 'tenant.source.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(76, 'tenant.source.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(77, 'tenant.source.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(78, 'tenant.status.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(79, 'tenant.status.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(80, 'tenant.status.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(81, 'tenant.status.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(82, 'tenant.group.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(83, 'tenant.group.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(84, 'tenant.group.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(85, 'tenant.group.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(86, 'tenant.ai_prompt.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(87, 'tenant.ai_prompt.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(88, 'tenant.ai_prompt.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(89, 'tenant.ai_prompt.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(90, 'tenant.canned_reply.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(91, 'tenant.canned_reply.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(92, 'tenant.canned_reply.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(93, 'tenant.canned_reply.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(94, 'tenant.chat.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(95, 'tenant.chat.read_only', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(96, 'tenant.chat.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(97, 'tenant.activity_log.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(98, 'tenant.activity_log.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(99, 'tenant.whatsmark_settings.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(100, 'tenant.whatsmark_settings.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(101, 'tenant.system_settings.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(102, 'tenant.system_settings.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(103, 'tenant.staff.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(104, 'tenant.staff.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(105, 'tenant.staff.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(106, 'tenant.staff.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(107, 'tenant.role.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(108, 'tenant.role.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(109, 'tenant.role.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(110, 'tenant.role.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(111, 'tenant.email_template.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(112, 'tenant.email_template.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(113, 'tenant.bot_flow.view', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(114, 'tenant.bot_flow.create', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(115, 'tenant.bot_flow.edit', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(116, 'tenant.bot_flow.delete', 'web', 'tenant', '2026-02-05 13:24:47', '2026-02-05 13:24:47');

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

--
-- Table structure for table `plans`
--

CREATE TABLE `plans` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `yearly_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `yearly_discount` int(11) NOT NULL DEFAULT 0,
  `billing_period` varchar(255) NOT NULL DEFAULT 'monthly',
  `trial_days` int(11) NOT NULL DEFAULT 0,
  `interval` int(11) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_free` tinyint(1) NOT NULL DEFAULT 0,
  `featured` tinyint(1) NOT NULL DEFAULT 0,
  `color` varchar(255) DEFAULT NULL,
  `currency_id` int(11) 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 `plans`
--

INSERT INTO `plans` (`id`, `name`, `slug`, `description`, `price`, `yearly_price`, `yearly_discount`, `billing_period`, `trial_days`, `interval`, `is_active`, `is_free`, `featured`, `color`, `currency_id`, `created_at`, `updated_at`) VALUES
(1, 'Free', 'free', 'Basic plan for individuals getting started with WhatsApp', 0.00, 0.00, 0, 'monthly', 365, 1, 1, 1, 0, '#EF4444', 1, '2026-02-05 13:24:47', '2026-02-09 09:12:08');

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

--
-- Table structure for table `plan_features`
--

CREATE TABLE `plan_features` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `plan_id` bigint(20) UNSIGNED NOT NULL,
  `feature_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL COMMENT 'Feature display name',
  `slug` varchar(255) DEFAULT NULL COMMENT 'URL-friendly feature name',
  `description` text DEFAULT NULL COMMENT 'Feature description',
  `value` varchar(255) NOT NULL DEFAULT '0' COMMENT 'Feature value or limit',
  `resettable_period` int(11) DEFAULT NULL COMMENT 'Period after which usage resets',
  `resettable_interval` varchar(255) DEFAULT NULL COMMENT 'Interval for reset (day, month, year)',
  `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 `plan_features`
--

INSERT INTO `plan_features` (`id`, `plan_id`, `feature_id`, `name`, `slug`, `description`, `value`, `resettable_period`, `resettable_interval`, `created_at`, `updated_at`) VALUES
(29, 1, 1, 'Contacts ', 'contacts', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(30, 1, 2, 'Template Bots ', 'template_bots', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(31, 1, 3, 'Message Bots ', 'message_bots', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(32, 1, 4, 'Campaigns ', 'campaigns', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(33, 1, 5, 'AI Prompts ', 'ai_prompts', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(34, 1, 6, 'Canned Replies ', 'canned_replies', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(35, 1, 7, 'Staff ', 'staff', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(36, 1, 8, 'Conversation ', 'conversations', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(37, 1, 9, 'Bot Flow ', 'bot_flow', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(38, 1, 10, 'Enable Api', 'enable_api', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(39, 1, 11, 'AI Personal Assistants ', 'ai_personal_assistants', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(40, 1, 12, 'Ecommerce Webhooks ', 'ecommerce_webhooks', NULL, '-1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(41, 1, 13, 'Embedded SignUp', 'emb_signup', NULL, '1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08'),
(42, 1, 14, 'Facebook Lead Integration', 'facebook_lead', NULL, '1', NULL, NULL, '2026-02-09 09:12:08', '2026-02-09 09:12:08');

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

--
-- Table structure for table `pusher_notifications`
--

CREATE TABLE `pusher_notifications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `isread` int(11) NOT NULL DEFAULT 0,
  `isread_inline` tinyint(1) NOT NULL DEFAULT 0,
  `date` datetime NOT NULL,
  `description` mediumtext NOT NULL,
  `fromuserid` int(11) NOT NULL,
  `fromclientid` int(11) NOT NULL DEFAULT 0,
  `from_fullname` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `touserid` int(11) NOT NULL,
  `fromcompany` int(11) DEFAULT NULL,
  `link` longtext DEFAULT NULL,
  `additional_data` mediumtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_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,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) 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 `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT 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
('Faoru7fEeZ46vVEDqvgA0ZsKf3pGdKGQxdgGOZet', NULL, '123.24.142.250', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiSVdmaDJnZEJya3pKZVI1S2RoemN0czNxdXBwa25wVzFVeUdiY2RqZSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NTY6Imh0dHBzOi8vZGVtby5zd2VkYmF5Lm9yZy90aGVtZS1zdHlsZS1jc3M/dD0xNzcwNjI4NDk5MzI1Ijt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1770628500),
('Gxz9iS4CeEMMazkvsKp24aMmIPPavjm1hEd2fZ5D', NULL, '123.24.142.250', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiS3J0RGY4T2hlZXpEbHVyOXlkYTc0RUVhdUh2dEQ2cUdQYmFaUVBIcCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NTY6Imh0dHBzOi8vZGVtby5zd2VkYmF5Lm9yZy90aGVtZS1zdHlsZS1jc3M/dD0xNzcwNjI4NjE4NTc5Ijt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1770628619),
('OEcnovTSmViUhKDFEjfqXvz0Ms5P4L73L5iRQLxD', 1, '123.24.142.250', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTo4OntzOjY6Il90b2tlbiI7czo0MDoiaERTZzhDQ0lNcEEwMThwZlRjdTVnOVRSQlcxQ3pGcktyeVdFN2xjWSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDE6Imh0dHBzOi8vZGVtby5zd2VkYmF5Lm9yZy9zZXJ2aWNld29ya2VyLmpzIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTtzOjY6ImxvY2FsZSI7czoyOiJlbiI7czoxNzoicGFzc3dvcmRfaGFzaF93ZWIiO3M6NjA6IiQyeSQxMiQ1c3JqNy9Ic3FjMHNEc2VhOTM2elFPQzdKOC5meXZ3aFpabTZDT0x5OWlaWVVJZi9WWXBpaSI7czo2OiJ0YWJsZXMiO2E6Njp7czo0MDoiYzA5MmRiYWUyNjMyZDY3NTE4OTk5YTJjZTM2NWU2YWFfZmlsdGVycyI7TjtzOjM5OiJjMDkyZGJhZTI2MzJkNjc1MTg5OTlhMmNlMzY1ZTZhYV9zZWFyY2giO3M6MDoiIjtzOjM3OiJjMDkyZGJhZTI2MzJkNjc1MTg5OTlhMmNlMzY1ZTZhYV9zb3J0IjthOjI6e3M6NjoiY29sdW1uIjtOO3M6OToiZGlyZWN0aW9uIjtOO31zOjQwOiJlN2RhMDViNmVmMjNhZWFmYTg2YWY2YjBmNzhhNzc4OV9maWx0ZXJzIjthOjM6e3M6Njoic3RhdHVzIjthOjE6e3M6NToidmFsdWUiO047fXM6ODoicHJpb3JpdHkiO2E6MTp7czo1OiJ2YWx1ZSI7Tjt9czoxMDoiY3JlYXRlZF9hdCI7YToyOntzOjEyOiJjcmVhdGVkX2Zyb20iO047czoxMzoiY3JlYXRlZF91bnRpbCI7Tjt9fXM6Mzk6ImU3ZGEwNWI2ZWYyM2FlYWZhODZhZjZiMGY3OGE3Nzg5X3NlYXJjaCI7czowOiIiO3M6Mzc6ImU3ZGEwNWI2ZWYyM2FlYWZhODZhZjZiMGY3OGE3Nzg5X3NvcnQiO2E6Mjp7czo2OiJjb2x1bW4iO047czo5OiJkaXJlY3Rpb24iO047fX1zOjE5OiJsYXN0X3ZpZXdlZF90ZW5hbnRzIjtzOjE5OiIyMDI2LTAyLTA5IDA5OjE3OjI4Ijt9', 1770628741);

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `group` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `locked` tinyint(1) NOT NULL DEFAULT 0,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`payload`)),
  `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 `settings`
--

INSERT INTO `settings` (`id`, `group`, `name`, `locked`, `payload`, `created_at`, `updated_at`) VALUES
(1, 'theme', 'site_logo', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(2, 'theme', 'favicon', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(3, 'theme', 'dark_logo', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(4, 'theme', 'cover_page_image', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(5, 'theme', 'pricing_section_title', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(6, 'theme', 'pricing_section_subtitle', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(7, 'theme', 'faq_section_title', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(8, 'theme', 'faq_section_subtitle', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(9, 'theme', 'author_name', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(10, 'theme', 'seo_meta_title', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(11, 'theme', 'seo_meta_keywords', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(12, 'theme', 'seo_meta_description', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(13, 'theme', 'og_title', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(14, 'theme', 'og_description', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(15, 'theme', 'customCss', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(16, 'theme', 'custom_js_header', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(17, 'theme', 'custom_js_footer', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(18, 'theme', 'partner_logos', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(19, 'theme', 'uni_feature_image', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(20, 'theme', 'uni_feature_title', 0, '\"Innovative Features\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(21, 'theme', 'uni_feature_sub_title', 0, '\"Unlocking New Possibilities with Cutting-Edge Technology\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(22, 'theme', 'uni_feature_description', 0, '\"Deliver great service experiences fast - without the complexity of traditional ITSM solutions.\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(23, 'theme', 'uni_feature_list', 0, '\"[\\\"Continuous integration and deployment\\\",\\\"Development workflow\\\",\\\"Knowledge management\\\"]\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(24, 'theme', 'feature_title', 0, '\"We invest in the world’s potential\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(25, 'theme', 'feature_subtitle', 0, '\"Deliver great service experiences fast - without the complexity of traditional ITSM solutions. Accelerate critical development work, eliminate toil, and deploy changes with ease.\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(26, 'theme', 'feature_description', 0, '\"Deliver great service experiences fast - without the complexity of traditional ITSM solutions.\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(27, 'theme', 'feature_list', 0, '\"[\\\"Dynamic reports and dashboards\\\",\\\"Templates for everyone\\\",\\\"Development workflow\\\",\\\"Limitless business automation\\\",\\\"Knowledge management\\\"]\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(28, 'theme', 'feature_image', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(29, 'theme', 'title', 0, '\"Scale your business with WhatsApp marketing automation\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(30, 'theme', 'description', 0, '\"Transform customer engagement with our powerful WhatsApp marketing platform. Send bulk messages, create chatbots, and automate conversations to boost sales and customer satisfaction.\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(31, 'theme', 'primary_button_text', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(32, 'theme', 'primary_button_url', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(33, 'theme', 'primary_button_type', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(34, 'theme', 'secondary_button_text', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(35, 'theme', 'secondary_button_url', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(36, 'theme', 'secondary_button_type', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(37, 'theme', 'image_path', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(38, 'theme', 'image_alt_text', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(39, 'theme', 'testimonials', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(40, 'system', 'site_name', 0, '\"Whatsmark saas\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(41, 'system', 'site_description', 0, '\"Whatsmark SaaS is a cloud-based platform for automating and managing WhatsApp marketing campaigns\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(42, 'system', 'timezone', 0, '\"UTC\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(43, 'system', 'date_format', 0, '\"Y-m-d\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(44, 'system', 'time_format', 0, '\"24\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(45, 'system', 'active_language', 0, '\"en\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(46, 'system', 'company_name', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(47, 'system', 'company_country_id', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(48, 'system', 'company_email', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(49, 'system', 'company_city', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(50, 'system', 'company_state', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(51, 'system', 'company_zip_code', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(52, 'system', 'company_address', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:25:23'),
(53, 're-captcha', 'isReCaptchaEnable', 0, 'false', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(54, 're-captcha', 'site_key', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(55, 're-captcha', 'secret_key', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(56, 'email', 'mailer', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(57, 'email', 'smtp_port', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(58, 'email', 'smtp_username', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(59, 'email', 'smtp_password', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(60, 'email', 'smtp_encryption', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(61, 'email', 'sender_name', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(62, 'email', 'sender_email', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(63, 'email', 'smtp_host', 0, '\"\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(64, 'cron-job', 'last_cron_run', 0, 'false', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(65, 'cron-job', 'status', 0, '\"unknown\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(66, 'cron-job', 'last_cron_stats', 0, '\"{}\"', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(67, 'cron-job', 'last_execution_time', 0, '0', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(68, 'cron-job', 'job_start_time', 0, '0', '2026-02-05 13:24:18', '2026-02-05 13:24:18'),
(69, 'whats-mark', 'wm_version', 0, '\"2.0.0\"', '2026-02-05 13:24:18', '2026-02-09 09:17:16'),
(70, 'whats-mark', 'wm_verification_id', 0, '\"NTg3MTQ5Njh8MTMxN3xrYWRrd3JpdHwxOWM3MjM4ZS02MmM2LTQ4N2YtYThjMi1lOWE5YTViYzA4M2I=\"', '2026-02-05 13:24:18', '2026-02-09 09:17:16'),
(71, 'whats-mark', 'wm_verification_token', 0, '\"NTg3MTQ5Njh8MTMxN3xrYWRrd3JpdHwxOWM3MjM4ZS02MmM2LTQ4N2YtYThjMi1lOWE5YTViYzA4M2I=|eyJwdXJjaGFzZV9jb2RlIjoiMTljNzIzOGUtNjJjNi00ODdmLWE4YzItZTlhOWE1YmMwODNiIiwiaXRlbV9pZCI6NTg3MTQ5NjgsImJ1eWVyIjoia2Fka3dyaXQiLCJwdXJjaGFzZV9jb3VudCI6MSwiYWN0aXZhdGVkX2RvbWFpbiI6Imh0dHBzOlwvXC92cHNpb3QuY29tIiwiaXAiOiIxNjguMjM1LjgzLjEzNyIsInB1cmNoYXNlX3RpbWUiOiIyMDI2LTAyLTA2VDAwOjEzOjEzKzExOjAwIiwiY2hlY2tfaW50ZXJ2YWwiOjI1OTIwMCwiY3JlYXRlZF9hdCI6MTc3MDI5NzgyOX0=.d4fb86d8dfba05d5ce217187b67d7a41f7be8e7ef1b9da4c5127096ca4facc1cffa3d64ab3e3421a6d772e0fe57176cf8aed6542ced9424b209b7617f83f3096\"', '2026-02-05 13:24:18', '2026-02-09 09:17:16'),
(72, 'whats-mark', 'wm_last_verification', 0, '\"1770628636\"', '2026-02-05 13:24:19', '2026-02-09 09:17:16'),
(73, 'whats-mark', 'wm_support_until', 0, '\"2026-08-07T14:13:13+10:00\"', '2026-02-05 13:24:19', '2026-02-09 09:17:16'),
(74, 'whats-mark', 'wm_validate', 0, 'true', '2026-02-05 13:24:19', '2026-02-09 09:17:16'),
(75, 'whats-mark', 'whatsmark_latest_version', 0, '\"1.0.0\"', '2026-02-05 13:24:19', '2026-02-09 09:17:16'),
(76, 'announcement', 'isEnable', 0, '\"\"', '2026-02-05 13:24:19', '2026-02-05 13:24:19'),
(77, 'announcement', 'message', 0, '\"\"', '2026-02-05 13:24:19', '2026-02-05 13:24:19'),
(78, 'announcement', 'link', 0, '\"\"', '2026-02-05 13:24:19', '2026-02-05 13:24:19'),
(79, 'announcement', 'link_text', 0, '\"\"', '2026-02-05 13:24:19', '2026-02-05 13:24:19'),
(80, 'announcement', 'background_color', 0, '\"\"', '2026-02-05 13:24:19', '2026-02-05 13:24:19'),
(81, 'announcement', 'link_text_color', 0, '\"\"', '2026-02-05 13:24:19', '2026-02-05 13:24:19'),
(82, 'announcement', 'message_color', 0, '\"\"', '2026-02-05 13:24:19', '2026-02-05 13:24:19'),
(83, 'tenant', 'isRegistrationEnabled', 0, 'true', '2026-02-05 13:24:20', '2026-02-09 09:04:18'),
(84, 'tenant', 'isVerificationEnabled', 0, 'false', '2026-02-05 13:24:20', '2026-02-09 09:04:18'),
(85, 'whatsapp', 'wm_fb_app_id', 0, '\"\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(86, 'whatsapp', 'wm_fb_app_secret', 0, '\"\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(87, 'whatsapp', 'is_webhook_connected', 0, '\"0\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(88, 'whatsapp', 'api_version', 0, '\"v21.0\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(89, 'whatsapp', 'daily_limit', 0, '\"1000\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(90, 'whatsapp', 'webhook_verify_token', 0, '\"W6vBRGmiFjzb6uIU\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(91, 'whatsapp', 'queue', 0, '\"{\\\"name\\\":\\\"whatsapp-messages\\\",\\\"connection\\\":\\\"database\\\",\\\"retry_after\\\":180,\\\"timeout\\\":60}\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(92, 'whatsapp', 'paths', 0, '\"{\\\"qrcodes\\\":\\\"\\\\/home\\\\/vpsiot\\\\/htdocs\\\\/vpsiot.com\\\\/storage\\\\/app\\\\/public\\\\/whatsapp\\\\/qrcodes\\\",\\\"media\\\":\\\"\\\\/home\\\\/vpsiot\\\\/htdocs\\\\/vpsiot.com\\\\/storage\\\\/app\\\\/public\\\\/whatsapp\\\\/media\\\"}\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(93, 'whatsapp', 'logging', 0, '\"{\\\"enabled\\\":false,\\\"channel\\\":\\\"whatsapp\\\",\\\"level\\\":\\\"info\\\"}\"', '2026-02-05 13:24:20', '2026-02-05 13:24:20'),
(94, 'invoice', 'bank_name', 0, '\"\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(95, 'invoice', 'account_name', 0, '\"\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(96, 'invoice', 'account_number', 0, '\"\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(97, 'invoice', 'ifsc_code', 0, '\"\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(98, 'invoice', 'prefix', 0, '\"INV\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(99, 'invoice', 'footer_text', 0, '\"Thanks for your purchase. Contact support for help.\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(100, 'privacy-policy', 'title', 0, '\"Privacy Policy\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(101, 'privacy-policy', 'content', 0, '\"<h2>Privacy Policy</h2><p>Your privacy is important to us. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our service.</p><p>Please read this Privacy Policy carefully. If you do not agree with the terms of this Privacy Policy, please do not access the application.</p>\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(102, 'privacy-policy', 'updated_at', 0, 'null', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(103, 'terms-conditions', 'title', 0, '\"Terms and Conditions\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(104, 'terms-conditions', 'content', 0, '\"<h2>Terms and Conditions</h2><p>Please read these Terms and Conditions carefully before using our service. Your access to and use of the service is conditioned on your acceptance of and compliance with these Terms.</p><p>By accessing or using the service you agree to be bound by these Terms. If you disagree with any part of the terms then you may not access the service.</p>\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(105, 'terms-conditions', 'updated_at', 0, 'null', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(106, 'invoice', 'default_taxes', 0, '\"[]\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(107, 'tenant', 'isEmailConfirmationEnabled', 0, 'true', '2026-02-05 13:24:22', '2026-02-09 09:04:18'),
(108, 'tenant', 'isEnableWelcomeEmail', 0, 'false', '2026-02-05 13:24:22', '2026-02-09 09:04:18'),
(109, 'system', 'default_country_code', 0, '[]', '2026-02-05 13:24:22', '2026-02-05 13:25:23'),
(110, 'system', 'tables_pagination_limit', 0, '10', '2026-02-05 13:24:22', '2026-02-05 13:25:23'),
(111, 'theme', 'theme_style', 0, '\"{\\\"primary\\\":{\\\"valueStop\\\":600,\\\"lMax\\\":100,\\\"lMin\\\":0,\\\"hex\\\":\\\"#4f46e5\\\",\\\"swatches\\\":[{\\\"stop\\\":0,\\\"hex\\\":\\\"#FFFFFF\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":100},{\\\"stop\\\":50,\\\"hex\\\":\\\"#F2F2FD\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":97},{\\\"stop\\\":100,\\\"hex\\\":\\\"#E1E0FB\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":93},{\\\"stop\\\":200,\\\"hex\\\":\\\"#C3C0F6\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":86},{\\\"stop\\\":300,\\\"hex\\\":\\\"#A5A1F2\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":79},{\\\"stop\\\":400,\\\"hex\\\":\\\"#8782ED\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":72},{\\\"stop\\\":500,\\\"hex\\\":\\\"#6D67EA\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":66},{\\\"stop\\\":600,\\\"hex\\\":\\\"#4F46E5\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":58.6},{\\\"stop\\\":700,\\\"hex\\\":\\\"#241CC5\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":44},{\\\"stop\\\":800,\\\"hex\\\":\\\"#181282\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":29},{\\\"stop\\\":900,\\\"hex\\\":\\\"#0C0943\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":15},{\\\"stop\\\":950,\\\"hex\\\":\\\"#06041F\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":7},{\\\"stop\\\":1000,\\\"hex\\\":\\\"#000000\\\",\\\"h\\\":243,\\\"hScale\\\":0,\\\"s\\\":75.4,\\\"sScale\\\":0,\\\"l\\\":0}]},\\\"danger\\\":{\\\"valueStop\\\":600,\\\"lMax\\\":100,\\\"lMin\\\":0,\\\"hex\\\":\\\"#dc2626\\\",\\\"swatches\\\":[{\\\"stop\\\":0,\\\"hex\\\":\\\"#FFFFFF\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":100},{\\\"stop\\\":50,\\\"hex\\\":\\\"#FCEDED\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":96},{\\\"stop\\\":100,\\\"hex\\\":\\\"#F9DCDC\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":92},{\\\"stop\\\":200,\\\"hex\\\":\\\"#F4B9B9\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":84},{\\\"stop\\\":300,\\\"hex\\\":\\\"#ED9191\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":75},{\\\"stop\\\":400,\\\"hex\\\":\\\"#E86E6E\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":67},{\\\"stop\\\":500,\\\"hex\\\":\\\"#E24B4B\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":59},{\\\"stop\\\":600,\\\"hex\\\":\\\"#DC2626\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":50.6},{\\\"stop\\\":700,\\\"hex\\\":\\\"#A71B1B\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":38},{\\\"stop\\\":800,\\\"hex\\\":\\\"#6E1212\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":25},{\\\"stop\\\":900,\\\"hex\\\":\\\"#390909\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":13},{\\\"stop\\\":950,\\\"hex\\\":\\\"#1A0404\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":6},{\\\"stop\\\":1000,\\\"hex\\\":\\\"#000000\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":72.2,\\\"sScale\\\":0,\\\"l\\\":0}]},\\\"warning\\\":{\\\"valueStop\\\":600,\\\"lMax\\\":100,\\\"lMin\\\":0,\\\"hex\\\":\\\"#eab308\\\",\\\"swatches\\\":[{\\\"stop\\\":0,\\\"hex\\\":\\\"#FFFFFF\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":100},{\\\"stop\\\":50,\\\"hex\\\":\\\"#fefce8\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":95},{\\\"stop\\\":100,\\\"hex\\\":\\\"#fef9c3\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":90},{\\\"stop\\\":200,\\\"hex\\\":\\\"#fef08a\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":80},{\\\"stop\\\":300,\\\"hex\\\":\\\"#fde047\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":70},{\\\"stop\\\":400,\\\"hex\\\":\\\"#facc15\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":60},{\\\"stop\\\":500,\\\"hex\\\":\\\"#eab308\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":50},{\\\"stop\\\":600,\\\"hex\\\":\\\"#eab308\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":40.4},{\\\"stop\\\":700,\\\"hex\\\":\\\"#a16207\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":30},{\\\"stop\\\":800,\\\"hex\\\":\\\"#854d0e\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":20},{\\\"stop\\\":900,\\\"hex\\\":\\\"#713f12\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":10},{\\\"stop\\\":950,\\\"hex\\\":\\\"#191100\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":5},{\\\"stop\\\":1000,\\\"hex\\\":\\\"#000000\\\",\\\"h\\\":41,\\\"hScale\\\":0,\\\"s\\\":96.1,\\\"sScale\\\":0,\\\"l\\\":0}]},\\\"success\\\":{\\\"valueStop\\\":600,\\\"lMax\\\":100,\\\"lMin\\\":0,\\\"hex\\\":\\\"#16a34a\\\",\\\"swatches\\\":[{\\\"stop\\\":0,\\\"hex\\\":\\\"#FFFFFF\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":100},{\\\"stop\\\":50,\\\"hex\\\":\\\"#E9FCF0\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":95},{\\\"stop\\\":100,\\\"hex\\\":\\\"#CEF8DD\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":89},{\\\"stop\\\":200,\\\"hex\\\":\\\"#A1F2BF\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":79},{\\\"stop\\\":300,\\\"hex\\\":\\\"#6FEC9D\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":68},{\\\"stop\\\":400,\\\"hex\\\":\\\"#42E67E\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":58},{\\\"stop\\\":500,\\\"hex\\\":\\\"#1DD35F\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":47},{\\\"stop\\\":600,\\\"hex\\\":\\\"#16A34A\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":36.3},{\\\"stop\\\":700,\\\"hex\\\":\\\"#107937\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":27},{\\\"stop\\\":800,\\\"hex\\\":\\\"#0B5125\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":18},{\\\"stop\\\":900,\\\"hex\\\":\\\"#052812\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":9},{\\\"stop\\\":950,\\\"hex\\\":\\\"#03160A\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":5},{\\\"stop\\\":1000,\\\"hex\\\":\\\"#000000\\\",\\\"h\\\":142,\\\"hScale\\\":0,\\\"s\\\":76.2,\\\"sScale\\\":0,\\\"l\\\":0}]},\\\"info\\\":{\\\"valueStop\\\":600,\\\"lMax\\\":100,\\\"lMin\\\":0,\\\"hex\\\":\\\"#0284c7\\\",\\\"swatches\\\":[{\\\"stop\\\":0,\\\"hex\\\":\\\"#FFFFFF\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":100},{\\\"stop\\\":50,\\\"hex\\\":\\\"#E6F6FF\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":95},{\\\"stop\\\":100,\\\"hex\\\":\\\"#CDEEFE\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":90},{\\\"stop\\\":200,\\\"hex\\\":\\\"#9ADDFE\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":80},{\\\"stop\\\":300,\\\"hex\\\":\\\"#68CBFD\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":70},{\\\"stop\\\":400,\\\"hex\\\":\\\"#35BAFD\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":60},{\\\"stop\\\":500,\\\"hex\\\":\\\"#03A9FC\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":50},{\\\"stop\\\":600,\\\"hex\\\":\\\"#0284C7\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":39.4},{\\\"stop\\\":700,\\\"hex\\\":\\\"#026597\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":30},{\\\"stop\\\":800,\\\"hex\\\":\\\"#014465\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":20},{\\\"stop\\\":900,\\\"hex\\\":\\\"#012232\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":10},{\\\"stop\\\":950,\\\"hex\\\":\\\"#001119\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":5},{\\\"stop\\\":1000,\\\"hex\\\":\\\"#000000\\\",\\\"h\\\":200,\\\"hScale\\\":0,\\\"s\\\":98,\\\"sScale\\\":0,\\\"l\\\":0}]},\\\"neutral\\\":{\\\"valueStop\\\":600,\\\"lMax\\\":100,\\\"lMin\\\":0,\\\"hex\\\":\\\"#525252\\\",\\\"swatches\\\":[{\\\"stop\\\":0,\\\"hex\\\":\\\"#FFFFFF\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":100},{\\\"stop\\\":50,\\\"hex\\\":\\\"#F0F0F0\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":94},{\\\"stop\\\":100,\\\"hex\\\":\\\"#E3E3E3\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":89},{\\\"stop\\\":200,\\\"hex\\\":\\\"#C4C4C4\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":77},{\\\"stop\\\":300,\\\"hex\\\":\\\"#A8A8A8\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":66},{\\\"stop\\\":400,\\\"hex\\\":\\\"#8C8C8C\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":55},{\\\"stop\\\":500,\\\"hex\\\":\\\"#707070\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":44},{\\\"stop\\\":600,\\\"hex\\\":\\\"#525252\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":32.2},{\\\"stop\\\":700,\\\"hex\\\":\\\"#3D3D3D\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":24},{\\\"stop\\\":800,\\\"hex\\\":\\\"#292929\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":16},{\\\"stop\\\":900,\\\"hex\\\":\\\"#141414\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":8},{\\\"stop\\\":950,\\\"hex\\\":\\\"#0A0A0A\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":4},{\\\"stop\\\":1000,\\\"hex\\\":\\\"#000000\\\",\\\"h\\\":0,\\\"hScale\\\":0,\\\"s\\\":0,\\\"sScale\\\":0,\\\"l\\\":0}]},\\\"secondary\\\":{\\\"valueStop\\\":600,\\\"lMax\\\":100,\\\"lMin\\\":0,\\\"hex\\\":\\\"#4b5563\\\",\\\"swatches\\\":[{\\\"stop\\\":0,\\\"hex\\\":\\\"#FFFFFF\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":100},{\\\"stop\\\":50,\\\"hex\\\":\\\"#F0F2F4\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":95},{\\\"stop\\\":100,\\\"hex\\\":\\\"#DFE2E7\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":89},{\\\"stop\\\":200,\\\"hex\\\":\\\"#BFC6CF\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":78},{\\\"stop\\\":300,\\\"hex\\\":\\\"#9FA9B6\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":67},{\\\"stop\\\":400,\\\"hex\\\":\\\"#7F8C9E\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":56},{\\\"stop\\\":500,\\\"hex\\\":\\\"#637083\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":45},{\\\"stop\\\":600,\\\"hex\\\":\\\"#4B5563\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":34.1},{\\\"stop\\\":700,\\\"hex\\\":\\\"#39414B\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":26},{\\\"stop\\\":800,\\\"hex\\\":\\\"#252A31\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":17},{\\\"stop\\\":900,\\\"hex\\\":\\\"#14161A\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":9},{\\\"stop\\\":950,\\\"hex\\\":\\\"#090A0C\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":4},{\\\"stop\\\":1000,\\\"hex\\\":\\\"#000000\\\",\\\"h\\\":215,\\\"hScale\\\":0,\\\"s\\\":13.8,\\\"sScale\\\":0,\\\"l\\\":0}]}}\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(112, 'theme', 'theme_style_modified_at', 0, 'null', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(113, 'whatsapp', 'wm_fb_config_id', 0, '\"\"', '2026-02-05 13:24:22', '2026-02-05 13:24:22'),
(114, 'system', 'is_enable_landing_page', 0, 'true', '2026-02-05 13:24:23', '2026-02-05 13:25:23'),
(115, 'tenant', 'set_default_tenant_language', 0, '\"en\"', '2026-02-05 13:24:23', '2026-02-09 09:04:18'),
(116, 'system', 'max_queue_jobs', 0, '100', '2026-02-05 13:24:23', '2026-02-05 13:25:23'),
(117, 'theme', 'hero_heading', 0, '\"Empower Your Business with Our Smart Solutions\"', '2026-02-05 13:24:25', '2026-02-05 13:24:25'),
(118, 'theme', 'feature_two_enabled', 0, 'true', '2026-02-05 13:24:25', '2026-02-05 13:24:25'),
(119, 'theme', 'feature_title_two', 0, '\"No-code, drag-and-drop Bot Flow Builder\"', '2026-02-05 13:24:25', '2026-02-05 13:24:25'),
(120, 'theme', 'feature_subtitle_two', 0, '\"Create AI-powered WhatsApp chatbots easily with our no-code drag & drop flow builder. Automate chats, capture leads, and engage customers 24 7.\"', '2026-02-05 13:24:25', '2026-02-05 13:24:25'),
(121, 'theme', 'feature_description_two', 0, '\"all without writing a single line of code.\"', '2026-02-05 13:24:25', '2026-02-05 13:24:25'),
(122, 'theme', 'feature_list_two', 0, '[\"Free up your team! Automatically reply to customer messages on WhatsApp using AI.\", \"Transfer complex cases to human agents for better support and customer experience.\", \"Automatically trigger custom message flows based on keywords messages for maximum engagement.\", \"Keep your WhatsApp active round-the-clock with automated responses and lead collection.\"]', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(123, 'theme', 'feature_image_two', 0, '\"\"', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(124, 'theme', 'feature_three_enabled', 0, 'true', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(125, 'theme', 'feature_title_three', 0, '\"Ecommerce Integration & Personal AI Assistant & Knowledgebase\"', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(126, 'theme', 'feature_subtitle_three', 0, '\"no team require, ai will manage it everything\"', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(127, 'theme', 'feature_description_three', 0, '\"Trigger WhatsApp messages instantly with ecommerce events. Automate cart, checkout, and payment notifications for higher engagement and conversions.\"', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(128, 'theme', 'feature_list_three', 0, '[\"Automate WhatsApp Notifications with Ecommerce Webhooks\", \"AI WhatsApp Assistant | Automate Conversations & Support\", \"Engage Customers Smarter with Personal AI Assistant & Knowledgebase\", \"Answer common queries instantly with AI-powered responses.\"]', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(129, 'theme', 'feature_image_three', 0, '\"\"', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(130, 'banner', 'time_of_banner_presentation', 0, '2000', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(131, 'banner', 'enabled_banner_random_mode', 0, 'false', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(132, 'theme', 'plans_page_title', 0, '\"\"', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(133, 'theme', 'plans_page_link', 0, '\"\"', '2026-02-05 13:24:26', '2026-02-05 13:24:26'),
(158, 'pusher', 'app_id', 0, 'null', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(159, 'pusher', 'app_key', 0, 'null', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(160, 'pusher', 'app_secret', 0, 'null', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(161, 'pusher', 'cluster', 0, '\"\"', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(162, 'pusher', 'real_time_notify', 0, 'false', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(163, 'pusher', 'desk_notify', 0, 'false', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(164, 'pusher', 'dismiss_desk_notification', 0, '\"\"', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(165, 'theme', 'partners_logos_enabled', 0, 'true', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(166, 'theme', 'partners_logo_header', 0, '\"Trusted by Leading Companies\"', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(167, 'theme', 'partners_logo_description', 0, '\"Join thousands of satisfied clients who trust our platform for their business growth\"', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(168, 'theme', 'partners_logo_footer', 0, '\"Top companies trust our platform worldwide\"', '2026-02-05 13:25:22', '2026-02-05 13:25:22'),
(215, 'payment', 'stripe_enabled', 0, 'true', NULL, '2026-02-09 09:18:29'),
(216, 'payment', 'stripe_key', 0, '\"pk_test_1111\"', NULL, '2026-02-09 09:18:29'),
(217, 'payment', 'stripe_secret', 0, '\"sk_test_11111\"', NULL, '2026-02-09 09:18:29'),
(218, 'payment', 'stripe_webhook_secret', 0, '\"\"', NULL, '2026-02-09 09:18:29'),
(219, 'payment', 'stripe_webhook_id', 0, '\"\"', NULL, '2026-02-09 09:18:29'),
(220, 'payment', 'offline_enabled', 0, 'true', NULL, '2026-02-09 09:18:29'),
(221, 'payment', 'offline_instructions', 0, '\"Bank Acc: 123456789\"', NULL, '2026-02-09 09:18:29'),
(222, 'payment', 'offline_bank_details', 0, '\"\"', NULL, NULL),
(223, 'payment', 'razorpay_enabled', 0, 'false', NULL, '2026-02-09 09:18:29'),
(224, 'payment', 'razorpay_key', 0, '\"\"', NULL, NULL),
(225, 'payment', 'razorpay_secret', 0, '\"\"', NULL, NULL),
(226, 'payment', 'razorpay_webhook_secret', 0, '\"\"', NULL, '2026-02-09 09:18:29'),
(227, 'payment', 'default_gateway', 0, '\"stripe\"', '2026-02-09 09:03:38', '2026-02-09 09:18:29'),
(228, 'payment', 'offline_description', 0, '\"Pay via direct bank transfer.\"', '2026-02-09 09:03:38', '2026-02-09 09:18:29'),
(229, 'payment', 'razorpay_key_id', 0, '\"\"', '2026-02-09 09:03:38', '2026-02-09 09:18:29'),
(230, 'payment', 'razorpay_key_secret', 0, '\"\"', '2026-02-09 09:03:38', '2026-02-09 09:18:29'),
(231, 'payment', 'tax_enabled', 0, 'false', '2026-02-09 09:03:38', '2026-02-09 09:18:29');

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

--
-- Table structure for table `sources`
--

CREATE TABLE `sources` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `statuses`
--

CREATE TABLE `statuses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `color` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#28B8DA',
  `isdefault` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `subscriptions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `plan_id` bigint(20) UNSIGNED NOT NULL,
  `status` enum('new','active','ended','cancelled','terminated','trial','paused') NOT NULL DEFAULT 'new',
  `current_period_ends_at` timestamp NULL DEFAULT NULL,
  `trial_starts_at` timestamp NULL DEFAULT NULL,
  `trial_ends_at` timestamp NULL DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 1,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `terminated_at` timestamp NULL DEFAULT NULL,
  `canceled_at` timestamp NULL DEFAULT NULL,
  `cancellation_reason` text DEFAULT NULL,
  `payment_attempt_count` int(11) NOT NULL DEFAULT 0,
  `last_payment_attempt_at` timestamp NULL DEFAULT NULL,
  `metadata` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `subscription_logs`
--

CREATE TABLE `subscription_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `subscription_id` bigint(20) UNSIGNED NOT NULL,
  `type` varchar(255) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `transaction_id` bigint(20) UNSIGNED DEFAULT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `taxes`
--

CREATE TABLE `taxes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `rate` decimal(8,2) NOT NULL,
  `description` varchar(255) 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 `taxes`
--

INSERT INTO `taxes` (`id`, `name`, `rate`, `description`, `created_at`, `updated_at`) VALUES
(1, 'CGST', 9.00, 'Standard CGST rate (9%)', '2026-02-05 13:24:47', '2026-02-05 13:24:47'),
(2, 'SGST', 9.00, 'Standard SGST rate (9%)', '2026-02-05 13:24:47', '2026-02-05 13:24:47');

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

--
-- Table structure for table `template_bots`
--

CREATE TABLE `template_bots` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `rel_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `template_id` bigint(20) UNSIGNED DEFAULT NULL,
  `header_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `body_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `footer_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `filename` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trigger` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reply_type` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `is_bot_active` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `cards_params` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`cards_params`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `sending_count` int(10) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `tenants`
--

CREATE TABLE `tenants` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `domain` varchar(255) DEFAULT NULL COMMENT 'Custom domain if available',
  `subdomain` varchar(255) NOT NULL COMMENT 'Subdomain for tenant access',
  `stripe_customer_id` text DEFAULT NULL,
  `status` enum('active','deactive','suspended') NOT NULL DEFAULT 'active',
  `custom_colors` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Tenant UI customization colors' CHECK (json_valid(`custom_colors`)),
  `timezone` varchar(255) DEFAULT 'UTC',
  `has_custom_domain` tinyint(1) DEFAULT 0,
  `features_config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Tenant-specific feature configuration' CHECK (json_valid(`features_config`)),
  `address` text DEFAULT NULL,
  `country_id` int(11) DEFAULT NULL,
  `payment_method` varchar(255) DEFAULT NULL,
  `payment_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payment_details`)),
  `billing_name` varchar(255) DEFAULT NULL,
  `billing_email` varchar(255) DEFAULT NULL,
  `billing_address` text DEFAULT NULL,
  `billing_city` varchar(255) DEFAULT NULL,
  `billing_state` varchar(255) DEFAULT NULL,
  `billing_zip_code` varchar(255) DEFAULT NULL,
  `billing_country` varchar(255) DEFAULT NULL,
  `billing_phone` varchar(255) DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_date` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tenant_credit_balances`
--

CREATE TABLE `tenant_credit_balances` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `balance` decimal(13,2) NOT NULL DEFAULT 0.00,
  `currency_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `tenant_email_templates`
--

CREATE TABLE `tenant_email_templates` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` longtext DEFAULT NULL,
  `merge_fields_groups` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`merge_fields_groups`)),
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_system` tinyint(1) NOT NULL DEFAULT 0,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `layout_id` int(10) UNSIGNED DEFAULT NULL,
  `use_layout` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `tenant_languages`
--

CREATE TABLE `tenant_languages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(3) NOT 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 `tenant_languages`
--

INSERT INTO `tenant_languages` (`id`, `name`, `code`, `created_at`, `updated_at`) VALUES
(1, 'Portuguese', 'br', '2026-02-05 13:24:56', '2026-02-05 13:24:56');

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

--
-- Table structure for table `test_users`
--

CREATE TABLE `test_users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `themes`
--

CREATE TABLE `themes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `payload` longtext DEFAULT NULL,
  `theme_html` longtext DEFAULT NULL,
  `theme_css` longtext DEFAULT NULL,
  `type` enum('core','custom') NOT NULL DEFAULT 'core',
  `folder` varchar(191) NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 0,
  `version` varchar(255) DEFAULT NULL,
  `theme_url` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `tickets`
--

CREATE TABLE `tickets` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `tenant_staff_id` bigint(20) UNSIGNED DEFAULT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `department_id` bigint(20) UNSIGNED NOT NULL,
  `assignee_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `priority` enum('low','medium','high') NOT NULL DEFAULT 'medium',
  `status` enum('open','answered','closed','on_hold') NOT NULL DEFAULT 'open',
  `ticket_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `admin_viewed` tinyint(1) NOT NULL DEFAULT 0,
  `tenant_viewed` tinyint(1) NOT NULL DEFAULT 1,
  `attachments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attachments`)),
  `body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `closed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `ticket_replies`
--

CREATE TABLE `ticket_replies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `ticket_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_type` enum('admin','tenant','tenant_staff','system') NOT NULL DEFAULT 'tenant',
  `attachments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attachments`)),
  `viewed` tinyint(1) NOT NULL DEFAULT 0,
  `send_notification` tinyint(1) DEFAULT 0,
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `invoice_id` bigint(20) UNSIGNED NOT NULL,
  `payment_method_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(255) NOT NULL,
  `status` enum('pending','success','failed') NOT NULL DEFAULT 'pending',
  `amount` decimal(13,2) NOT NULL,
  `idempotency_key` text DEFAULT NULL,
  `currency_id` bigint(20) UNSIGNED NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `error` text DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `uploaded_files`
--

CREATE TABLE `uploaded_files` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `webhook_logs`
--

CREATE TABLE `webhook_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED DEFAULT NULL,
  `event` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempt` int(11) NOT NULL DEFAULT 1,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`payload`)),
  `response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response`)),
  `error_message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status_code` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `ai_prompts`
--
ALTER TABLE `ai_prompts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ai_prompts_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `bot_flows`
--
ALTER TABLE `bot_flows`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bot_flows_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `campaigns`
--
ALTER TABLE `campaigns`
  ADD PRIMARY KEY (`id`),
  ADD KEY `campaigns_name_is_sent_scheduled_send_time_index` (`name`,`is_sent`,`scheduled_send_time`),
  ADD KEY `campaigns_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `campaign_details`
--
ALTER TABLE `campaign_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `campaign_details_campaign_id_tenant_id_index` (`campaign_id`,`tenant_id`),
  ADD KEY `campaign_details_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `canned_replies`
--
ALTER TABLE `canned_replies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `canned_replies_tenant_id_index` (`tenant_id`);

--
-- Indexes for table `contact_imports`
--
ALTER TABLE `contact_imports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contact_imports_tenant_id_index` (`tenant_id`);

--
-- Indexes for table `coupons`
--
ALTER TABLE `coupons`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `coupons_code_unique` (`code`),
  ADD KEY `coupons_code_is_active_index` (`code`,`is_active`),
  ADD KEY `coupons_starts_at_expires_at_index` (`starts_at`,`expires_at`),
  ADD KEY `coupons_is_active_created_at_index` (`is_active`,`created_at`),
  ADD KEY `coupons_created_by_index` (`created_by`);

--
-- Indexes for table `coupon_usages`
--
ALTER TABLE `coupon_usages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `coupon_usages_coupon_id_tenant_id_index` (`coupon_id`,`tenant_id`),
  ADD KEY `coupon_usages_tenant_id_created_at_index` (`tenant_id`,`created_at`),
  ADD KEY `coupon_usages_invoice_id_index` (`invoice_id`),
  ADD KEY `coupon_usages_subscription_id_index` (`subscription_id`);

--
-- Indexes for table `credit_transactions`
--
ALTER TABLE `credit_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `credit_transactions_currency_id_foreign` (`currency_id`),
  ADD KEY `credit_transactions_invoice_id_foreign` (`invoice_id`),
  ADD KEY `credit_transactions_tenant_id_foreign` (`tenant_id`);

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

--
-- Indexes for table `custom_fields`
--
ALTER TABLE `custom_fields`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `custom_fields_tenant_id_field_name_unique` (`tenant_id`,`field_name`),
  ADD KEY `custom_fields_tenant_id_is_active_index` (`tenant_id`,`is_active`),
  ADD KEY `custom_fields_tenant_id_display_order_index` (`tenant_id`,`display_order`);

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

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

--
-- Indexes for table `email_logs`
--
ALTER TABLE `email_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `email_logs_email_template_id_foreign` (`email_template_id`);

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

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

--
-- Indexes for table `failed_import_rows`
--
ALTER TABLE `failed_import_rows`
  ADD PRIMARY KEY (`id`),
  ADD KEY `failed_import_rows_import_id_foreign` (`import_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 `faqs`
--
ALTER TABLE `faqs`
  ADD PRIMARY KEY (`id`);

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

--
-- Indexes for table `feature_limits`
--
ALTER TABLE `feature_limits`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `feature_limits_plan_id_feature_id_tenant_id_unique` (`plan_id`,`feature_id`,`tenant_id`),
  ADD KEY `feature_limits_plan_id_feature_id_tenant_id_index` (`plan_id`,`feature_id`,`tenant_id`),
  ADD KEY `feature_limits_feature_id_foreign` (`feature_id`),
  ADD KEY `feature_limits_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `feature_usages`
--
ALTER TABLE `feature_usages`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `feature_usages_tenant_id_subscription_id_feature_slug_unique` (`tenant_id`,`subscription_id`,`feature_slug`),
  ADD KEY `feature_usages_subscription_id_foreign` (`subscription_id`);

--
-- Indexes for table `groups`
--
ALTER TABLE `groups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `groups_tenant_id_foreign` (`tenant_id`);

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

--
-- Indexes for table `invoices`
--
ALTER TABLE `invoices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `invoices_currency_id_foreign` (`currency_id`),
  ADD KEY `invoices_subscription_id_foreign` (`subscription_id`),
  ADD KEY `invoices_tenant_id_foreign` (`tenant_id`),
  ADD KEY `invoices_coupon_id_foreign` (`coupon_id`);

--
-- Indexes for table `invoice_items`
--
ALTER TABLE `invoice_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `invoice_items_invoice_id_foreign` (`invoice_id`);

--
-- Indexes for table `invoice_taxes`
--
ALTER TABLE `invoice_taxes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `invoice_taxes_invoice_id_index` (`invoice_id`),
  ADD KEY `invoice_taxes_tax_id_foreign` (`tax_id`);

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

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

--
-- Indexes for table `languages`
--
ALTER TABLE `languages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `languages_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `message_bots`
--
ALTER TABLE `message_bots`
  ADD PRIMARY KEY (`id`),
  ADD KEY `message_bots_tenant_id_index` (`tenant_id`);

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

--
-- Indexes for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  ADD UNIQUE KEY `model_has_permissions_permission_model_type_unique` (`tenant_id`,`permission_id`,`model_id`,`model_type`),
  ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
  ADD KEY `model_has_permissions_team_foreign_key_index` (`tenant_id`);

--
-- Indexes for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  ADD UNIQUE KEY `model_has_roles_role_model_type_unique` (`tenant_id`,`role_id`,`model_id`,`model_type`),
  ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
  ADD KEY `model_has_roles_team_foreign_key_index` (`tenant_id`);

--
-- Indexes for table `module_validation_logs`
--
ALTER TABLE `module_validation_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `module_validation_logs_module_name_created_at_index` (`module_name`,`created_at`),
  ADD KEY `module_validation_logs_user_id_created_at_index` (`user_id`,`created_at`);

--
-- Indexes for table `pages`
--
ALTER TABLE `pages`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `pages_slug_unique` (`slug`),
  ADD KEY `pages_parent_id_foreign` (`parent_id`);

--
-- Indexes for table `payment_methods`
--
ALTER TABLE `payment_methods`
  ADD PRIMARY KEY (`id`),
  ADD KEY `payment_methods_tenant_id_foreign` (`tenant_id`);

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

--
-- Indexes for table `plans`
--
ALTER TABLE `plans`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `plans_slug_unique` (`slug`),
  ADD KEY `plans_is_active_slug_index` (`is_active`,`slug`);

--
-- Indexes for table `plan_features`
--
ALTER TABLE `plan_features`
  ADD PRIMARY KEY (`id`),
  ADD KEY `plan_features_plan_id_index` (`plan_id`),
  ADD KEY `plan_features_feature_id_index` (`feature_id`);

--
-- Indexes for table `pusher_notifications`
--
ALTER TABLE `pusher_notifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pusher_notifications_tenant_id_index` (`tenant_id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `roles_tenant_id_name_guard_name_unique` (`tenant_id`,`name`,`guard_name`),
  ADD KEY `roles_team_foreign_key_index` (`tenant_id`);

--
-- Indexes for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`role_id`),
  ADD KEY `role_has_permissions_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 `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `settings_group_name_unique` (`group`,`name`);

--
-- Indexes for table `sources`
--
ALTER TABLE `sources`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sources_name_tenant_id_index` (`name`,`tenant_id`),
  ADD KEY `sources_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `statuses`
--
ALTER TABLE `statuses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `statuses_name_tenant_id_index` (`name`,`tenant_id`),
  ADD KEY `statuses_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subscriptions_plan_id_foreign` (`plan_id`),
  ADD KEY `subscriptions_tenant_id_foreign` (`tenant_id`);

--
-- Indexes for table `subscription_logs`
--
ALTER TABLE `subscription_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subscription_logs_subscription_id_foreign` (`subscription_id`),
  ADD KEY `subscription_logs_transaction_id_foreign` (`transaction_id`);

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

--
-- Indexes for table `template_bots`
--
ALTER TABLE `template_bots`
  ADD PRIMARY KEY (`id`),
  ADD KEY `template_bots_tenant_id_index` (`tenant_id`),
  ADD KEY `template_bots_template_id_foreign` (`template_id`);

--
-- Indexes for table `tenants`
--
ALTER TABLE `tenants`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `tenants_subdomain_unique` (`subdomain`),
  ADD KEY `tenants_status_index` (`status`),
  ADD KEY `tenants_subdomain_index` (`subdomain`),
  ADD KEY `tenants_expires_at_index` (`expires_at`);

--
-- Indexes for table `tenant_credit_balances`
--
ALTER TABLE `tenant_credit_balances`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `tenant_credit_balances_tenant_id_unique` (`tenant_id`),
  ADD KEY `tenant_credit_balances_currency_id_foreign` (`currency_id`);

--
-- Indexes for table `tenant_email_templates`
--
ALTER TABLE `tenant_email_templates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tenant_email_templates_created_by_foreign` (`created_by`),
  ADD KEY `tenant_email_templates_tenant_id_foreign` (`tenant_id`),
  ADD KEY `tenant_email_templates_updated_by_foreign` (`updated_by`);

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

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

--
-- Indexes for table `themes`
--
ALTER TABLE `themes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `themes_folder_unique` (`folder`);

--
-- Indexes for table `tickets`
--
ALTER TABLE `tickets`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `tickets_ticket_id_unique` (`ticket_id`),
  ADD KEY `tickets_department_id_foreign` (`department_id`),
  ADD KEY `tickets_tenant_id_foreign` (`tenant_id`),
  ADD KEY `tickets_tenant_staff_id_foreign` (`tenant_staff_id`);

--
-- Indexes for table `ticket_replies`
--
ALTER TABLE `ticket_replies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ticket_replies_ticket_id_foreign` (`ticket_id`),
  ADD KEY `ticket_replies_user_id_foreign` (`user_id`);

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transactions_currency_id_foreign` (`currency_id`),
  ADD KEY `transactions_invoice_id_foreign` (`invoice_id`),
  ADD KEY `transactions_payment_method_id_foreign` (`payment_method_id`);

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

--
-- Indexes for table `webhook_logs`
--
ALTER TABLE `webhook_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `webhook_logs_model_event_status_created_at_tenant_id_index` (`model`,`event`,`status`,`created_at`,`tenant_id`),
  ADD KEY `webhook_logs_tenant_id_foreign` (`tenant_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `invoice_taxes`
--
ALTER TABLE `invoice_taxes`
  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 `languages`
--
ALTER TABLE `languages`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `message_bots`
--
ALTER TABLE `message_bots`
  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=74;

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `pusher_notifications`
--
ALTER TABLE `pusher_notifications`
  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 for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=321;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `ai_prompts`
--
ALTER TABLE `ai_prompts`
  ADD CONSTRAINT `ai_prompts_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `bot_flows`
--
ALTER TABLE `bot_flows`
  ADD CONSTRAINT `bot_flows_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `campaigns`
--
ALTER TABLE `campaigns`
  ADD CONSTRAINT `campaigns_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `campaign_details`
--
ALTER TABLE `campaign_details`
  ADD CONSTRAINT `campaign_details_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `campaign_details_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `canned_replies`
--
ALTER TABLE `canned_replies`
  ADD CONSTRAINT `canned_replies_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `coupons`
--
ALTER TABLE `coupons`
  ADD CONSTRAINT `coupons_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `coupon_usages`
--
ALTER TABLE `coupon_usages`
  ADD CONSTRAINT `coupon_usages_coupon_id_foreign` FOREIGN KEY (`coupon_id`) REFERENCES `coupons` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `coupon_usages_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `coupon_usages_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `coupon_usages_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `credit_transactions`
--
ALTER TABLE `credit_transactions`
  ADD CONSTRAINT `credit_transactions_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  ADD CONSTRAINT `credit_transactions_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `credit_transactions_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `custom_fields`
--
ALTER TABLE `custom_fields`
  ADD CONSTRAINT `custom_fields_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `email_logs`
--
ALTER TABLE `email_logs`
  ADD CONSTRAINT `email_logs_email_template_id_foreign` FOREIGN KEY (`email_template_id`) REFERENCES `email_templates` (`id`) ON DELETE SET NULL;

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

--
-- Constraints for table `failed_import_rows`
--
ALTER TABLE `failed_import_rows`
  ADD CONSTRAINT `failed_import_rows_import_id_foreign` FOREIGN KEY (`import_id`) REFERENCES `imports` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `feature_limits`
--
ALTER TABLE `feature_limits`
  ADD CONSTRAINT `feature_limits_feature_id_foreign` FOREIGN KEY (`feature_id`) REFERENCES `features` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `feature_limits_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `feature_limits_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `feature_usages`
--
ALTER TABLE `feature_usages`
  ADD CONSTRAINT `feature_usages_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `feature_usages_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `groups`
--
ALTER TABLE `groups`
  ADD CONSTRAINT `groups_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `invoices`
--
ALTER TABLE `invoices`
  ADD CONSTRAINT `invoices_coupon_id_foreign` FOREIGN KEY (`coupon_id`) REFERENCES `coupons` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `invoices_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  ADD CONSTRAINT `invoices_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `invoices_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `invoice_items`
--
ALTER TABLE `invoice_items`
  ADD CONSTRAINT `invoice_items_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `invoice_taxes`
--
ALTER TABLE `invoice_taxes`
  ADD CONSTRAINT `invoice_taxes_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `invoice_taxes_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `taxes` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `languages`
--
ALTER TABLE `languages`
  ADD CONSTRAINT `languages_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `message_bots`
--
ALTER TABLE `message_bots`
  ADD CONSTRAINT `message_bots_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `payment_methods`
--
ALTER TABLE `payment_methods`
  ADD CONSTRAINT `payment_methods_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `plan_features`
--
ALTER TABLE `plan_features`
  ADD CONSTRAINT `plan_features_feature_id_foreign` FOREIGN KEY (`feature_id`) REFERENCES `features` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `plan_features_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pusher_notifications`
--
ALTER TABLE `pusher_notifications`
  ADD CONSTRAINT `pusher_notifications_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

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

--
-- Constraints for table `sources`
--
ALTER TABLE `sources`
  ADD CONSTRAINT `sources_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `statuses`
--
ALTER TABLE `statuses`
  ADD CONSTRAINT `statuses_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD CONSTRAINT `subscriptions_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`),
  ADD CONSTRAINT `subscriptions_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscription_logs`
--
ALTER TABLE `subscription_logs`
  ADD CONSTRAINT `subscription_logs_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subscription_logs_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `template_bots`
--
ALTER TABLE `template_bots`
  ADD CONSTRAINT `template_bots_template_id_foreign` FOREIGN KEY (`template_id`) REFERENCES `whatsapp_templates` (`template_id`) ON DELETE SET NULL,
  ADD CONSTRAINT `template_bots_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tenant_credit_balances`
--
ALTER TABLE `tenant_credit_balances`
  ADD CONSTRAINT `tenant_credit_balances_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  ADD CONSTRAINT `tenant_credit_balances_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tenant_email_templates`
--
ALTER TABLE `tenant_email_templates`
  ADD CONSTRAINT `tenant_email_templates_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `tenant_email_templates_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `tenant_email_templates_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `tickets`
--
ALTER TABLE `tickets`
  ADD CONSTRAINT `tickets_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `tickets_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `tickets_tenant_staff_id_foreign` FOREIGN KEY (`tenant_staff_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ticket_replies`
--
ALTER TABLE `ticket_replies`
  ADD CONSTRAINT `ticket_replies_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ticket_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `transactions`
--
ALTER TABLE `transactions`
  ADD CONSTRAINT `transactions_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  ADD CONSTRAINT `transactions_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transactions_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `webhook_logs`
--
ALTER TABLE `webhook_logs`
  ADD CONSTRAINT `webhook_logs_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE;
COMMIT;

